Repository navigation
Compose dist-GEMM from parallel linear projections - #4702
Closed
anijain2305 wants to merge 1 commit into
Closed
anijain2305 wants to merge 1 commit into
anijain2305 wants to merge 1 commit into
Conversation
anijain2305
requested review from
fegin,
tianyu-l,
wconstab and
wwwjn
as code owners
September 15, 2026 17:04
This was referenced Sep 15, 2026
anijain2305
marked this pull request as draft
September 15, 2026 17:05
Contributor
Author
|
Opened accidentally because compose-dist-gemm was still an ancestor of the linear stack. The work is preserved locally on compose-dist-gemm and is not part of this PR stack. |
sanketpurandare
added a commit
that referenced
this pull request
Oct 12, 2026
## Agent details Prepared with AI assistance. Reuse TorchAO's fused rowwise/columnwise activation cast and existing single-axis CuTeDSL casts, consuming blocked E8M0 scales without separate rearrangement kernels. Keep CUDA as the default and expose CuTeDSL as an explicit activation_quantization_backend option through both the linear and its converter. Input-save format, weight quantization, output ownership, FSDP lifetime and gradient accumulation policy are unchanged. CuTeDSL requires 128-aligned BF16 matrices and the required runtime/API at construction. Unsupported shapes fail explicitly rather than padding activations to a larger GEMM or silently selecting another implementation. Represent dense matrices as one group, view the valid column-scale prefix, and retain immutable real endpoints for CUDA-graph pointer lifetime. Fake endpoints never enter the real cache. Explicitly request RCEIL for every activation cast, matching the weight-scale policy independently of provider defaults. The existing operand tests check this forwarding while still executing each real provider kernel. Depends on pytorch/ao#4995 as the single AO dependency. That PR preserves Protonu's kernel from #4895 and includes current nonfinite handling, the 32x1 FakeTensor fix (also addressed by Aleksandar in #4702), and byte-oracle regressions. The original PRs are provenance, not additional dependencies. ## Test Plan Real CUDA comparisons validate all cast directions and two backward contributions, including in-place accumulation. Real two-rank FSDP checks cover compiled RAF=true, retained PP weights and CUDA-graph replay. Schema/FakeTensor opchecks validate provider layouts. Matched CUDA-graph replay checks defined output bytes, timing and actual target kernels. ```bash python -m pytest tests/unit_tests/cpu/quantization/test_quantization.py tests/unit_tests/cpu/quantization/test_quantized_fsdp_tensor.py -q python -m pytest tests/unit_tests/gpu/quantization/test_mxfp8_linear.py -q python -m pytest tests/unit_tests/gpu/quantization/test_mxfp8_fsdp.py -q -k 'cutedsl or (tensor_lifecycle and not simple)' pre-commit run --all-files ```
sanketpurandare
added a commit
that referenced
this pull request
Oct 13, 2026
## Agent details Prepared with AI assistance. Reuse TorchAO's fused rowwise/columnwise activation cast and existing single-axis CuTeDSL casts, consuming blocked E8M0 scales without separate rearrangement kernels. Keep CUDA as the default and expose CuTeDSL as an explicit activation_quantization_backend option through both the linear and its converter. Input-save format, weight quantization, output ownership, FSDP lifetime and gradient accumulation policy are unchanged. CuTeDSL requires 128-aligned BF16 matrices and the required runtime/API at construction. Unsupported shapes fail explicitly rather than padding activations to a larger GEMM or silently selecting another implementation. Represent dense matrices as one group, view the valid column-scale prefix, and retain immutable real endpoints for CUDA-graph pointer lifetime. Fake endpoints never enter the real cache. Explicitly request RCEIL for every activation cast, matching the weight-scale policy independently of provider defaults. The existing operand tests check this forwarding while still executing each real provider kernel. Depends on pytorch/ao#4995 as the single AO dependency. That PR preserves Protonu's kernel from #4895 and includes current nonfinite handling, the 32x1 FakeTensor fix (also addressed by Aleksandar in #4702), and byte-oracle regressions. The original PRs are provenance, not additional dependencies. ## Test Plan Real CUDA comparisons validate all cast directions and two backward contributions, including in-place accumulation. Real two-rank FSDP checks cover compiled RAF=true, retained PP weights and CUDA-graph replay. Schema/FakeTensor opchecks validate provider layouts. Matched CUDA-graph replay checks defined output bytes, timing and actual target kernels. ```bash python -m pytest tests/unit_tests/cpu/quantization/test_quantization.py tests/unit_tests/cpu/quantization/test_quantized_fsdp_tensor.py -q python -m pytest tests/unit_tests/gpu/quantization/test_mxfp8_linear.py -q python -m pytest tests/unit_tests/gpu/quantization/test_mxfp8_fsdp.py -q -k 'cutedsl or (tensor_lifecycle and not simple)' pre-commit run --all-files ```
sanketpurandare
added a commit
that referenced
this pull request
Oct 14, 2026
Performnace of this fused cute-dsl quantizer is better than cuda, a single API for dense and grouped mxfp8 linears, no need for scale rearrangements since swizzled layouts are directly output. AI-assisted implementation details: > Reuse TorchAO's fused dense rowwise/columnwise activation cast and existing > single-axis CuTeDSL casts, consuming directly blocked E8M0 scales. Keep CUDA > as the default and CuTeDSL as explicit activation_quantization_backend opt-in > through the Linear and converter. Input-save format, weight quantization, > output ownership, FSDP lifetime and gradient accumulation policy are unchanged. > > Use the provider's offs=None dense specialization, with compact column scales > and no synthetic endpoint, cache, FakeTensor endpoint branch or padding trim. > Construction rejects an older required-offset provider as well as missing > symbols/runtime. Both real and fake paths use the same dense contract. > > CuTeDSL requires 128-aligned BF16 matrices. Unsupported shapes fail explicitly, > without padding to a larger GEMM or silently changing implementations. Pin > RCEIL for every activation cast to match the 32x32 weight-scale policy. > > Depends only on pytorch/ao#4995. Preserve credit to Protonu's original #4895 > kernel and Aleksandar's #4702 single-axis metadata work; those PRs remain > provenance, not additional dependencies. > > Test plan: current CPU contracts, real CUDA cast directions/backward formats > and accumulation, two-rank compiled/retained/CUDA-graph FSDP lifecycle, > strict configuration/README rendering, complete repository lint and matched > replay timings with actual target-kernel traces.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack from ghstack (oldest at bottom):