mirror of
https://github.com/pytorch/pytorch.git
synced 2026-10-25 18:53:39 +08:00
I have approve to split origin PRs, because origin one is too long to land. > This description was drafted with AI assistance and reviewed by the author. > > This is PR 2 of 6 splitting the combined work from #193295. > > `BatchLinearLHSFusion.fuse()` concatenates projection weights and biases. The matcher must reject shapes that do not preserve the original linear semantics under concatenation. > > This PR: > > - rejects zero-width projection weights > - rejects biases that are missing `example_value`, are not exactly one-dimensional, or whose width differs from the projection output width > - groups candidates by bias presence instead of bias rank > - adds matcher tests for valid and invalid projection shapes > - adds end-to-end compile regressions that keep valid projections fusing while malformed projections stay eager > - preserves zero-width eager strides in a dedicated regression > > **Dependency** > > This draft depends on PR 1. Its branch temporarily contains the earlier stack commit until that dependency merges and this PR is rebased. > > **Split series** > > 1. [[1/6] Harden batch_linear_lhs test coverage](https://github.com/pytorch/pytorch/pull/201531) (pending) > 2. **[[2/6] Validate batch_linear_lhs projection shapes](https://github.com/pytorch/pytorch/pull/201532)** (this PR) > 3. [[3/6] Guard batch_linear_lhs layout-sensitive users](https://github.com/pytorch/pytorch/pull/201951) (pending) > 4. [[4/6] Add batch_linear_lhs alias regressions](https://github.com/pytorch/pytorch/pull/201533) (pending) > 5. [[5/6] Preserve batch_linear_lhs aliases after materialization](https://github.com/pytorch/pytorch/pull/201534) (pending) > 6. [[6/6] Re-enable batch_linear_lhs on XPU](https://github.com/pytorch/pytorch/pull/201535) (pending) Pull Request resolved: https://github.com/pytorch/pytorch/pull/201532 Approved by: https://github.com/jansel