Wire MoE and MXFP8Linear training paths to CuTeDSL by default - #4705
Open
alexsamardzic wants to merge 1 commit into
Open
Wire MoE and MXFP8Linear training paths to CuTeDSL by default#4705alexsamardzic wants to merge 1 commit into
alexsamardzic wants to merge 1 commit into
Conversation
Collaborator
Author
|
Stack from ghstack (oldest at bottom): |
alexsamardzic
requested review from
andrewor14,
jerryzh168 and
vkuzo
as code owners
August 5, 2026 17:56
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4705
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 2 New Failures, 1 Unrelated FailureAs of commit da0c29d with merge base 33ba9f7 ( NEW FAILURES - The following jobs have failed:
BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This was referenced Aug 5, 2026
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.
(Replaces #4620 due to incorrect ghstack base branch targeting.)
This PR wires the MXFP8 MoE grouped-mm and MXFP8Linear training paths to use the CuTeDSL backend by default, while keeping the legacy CUDA/Triton backend selectable for validation and benchmarking. It adds end-to-end correctness tests for grouped-mm, padded grouped-mm, prequantized MXTensor grouped-mm, and MXFP8Linear fwd/bwd, plus benchmark support for comparing CuTeDSL against the legacy backend. This prepares the next PR to delete torchao._C_mxfp8 and the now-obsolete legacy CUDA/Triton paths.
To run tests:
pytest -q \ test/prototype/moe_training/test_mxfp8_grouped_mm.py::test_mxfp8_grouped_gemm_backend_fwd_bwd \ test/prototype/moe_training/test_mxfp8_grouped_mm.py::test_mxfp8_grouped_gemm_padded_backend_fwd_bwd \ test/prototype/moe_training/test_mxfp8_grouped_mm.py::test_mxfp8_grouped_gemm_mxtensor_backend_forward \ test/prototype/moe_training/test_mxfp8_grouped_mm.py::test_mxfp8_grouped_gemm_with_dq_fwd_bwd \ test/prototype/moe_training/test_mxfp8_linear.py::test_mxfp8_linear_fwd_bwd_sqnrTo run MoE grouped-mm fwd/bwd recipe benchmark:
python benchmarks/prototype/moe_training/mxfp8/roofline_unified.py \ --backend=both --K=4096 --N=4096 --G=8 --breakdown_M=16384 \ --outfile_speedup=roofline_speedup_K4096_N4096.csv \ --outfile_quant_2d=roofline_quant_2d_K4096_N4096.csv \ --outfile_quant_3d=roofline_quant_3d_K4096_N4096.csv \ --plot_file=roofline_K4096_N4096.pngResults of benchmark above:

To run MXFP8Linear fwd/bwd recipe benchmark:
python scripts/validate_mxfp8_linear_cutedsl.py \ --M 4096 --N 4096 --K 2048 \ --cuda-graph-bench --graph-iters 100Would be good to run on multi-GPU machine:
torchrun --nproc-per-node=2 --local-ranks-filter=0 \ benchmarks/prototype/moe_training/mxfp8/bench_ep_pipeline.py --backend=legacy torchrun --nproc-per-node=2 --local-ranks-filter=0 \ benchmarks/prototype/moe_training/mxfp8/bench_ep_pipeline.py --backend=cutedsl