Repository navigation
Wire MoE and MXFP8Linear training paths to CuTeDSL by default - #4620
alexsamardzic wants to merge 2 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4620
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 5 Unrelated FailuresAs of commit 864b33b with merge base 3818749 ( NEW FAILURE - The following job has failed:
BROKEN TRUNK - The following jobs 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 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.pngTo 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 |
|
Added |
|
Hi @alexsamardzic, is this the PR that's incorrectly wired? Should we close it then? |
|
Replaced by #4705. |
All five on the stack were wrong, I used plain Btw: All five of these PRs are reasonably simple, I've stated test plans, and also benchmarking results showing that the perfomance is unchanged, or better - so I hope we could merge them quickly. The top one, #4705, is the only one to be careful about, as this one switches the default to new CuTeDSL kernels. After we merge this, and then if we see for couple weeks that there are no issues, I'll post another PR to delete legacy kernels and the C++ extension. |

Stack from ghstack (oldest at bottom):