Repository navigation
[Triton/Gluon] Remove bad moe gemm wrapper code - #6035
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Deleting moe_utils.py breaks the retained moe_gemm_per_token import path.
Review effort: Balanced
Findings: None
What changed in this PR
Removes the MXFP8 MoE GEMM wrapper and its supporting test and benchmark.
Changes:
- Removes
moe_gemm_mxfp8and its package export. - Deletes routing utilities, tests, and benchmark coverage.
| File | Description |
|---|---|
aiter/ops/triton/moe/moe_gemm_mxfp8.py |
Removes the MXFP8 wrapper. |
aiter/ops/triton/moe/moe_utils.py |
Removes shared routing helpers. |
aiter/ops/triton/moe/__init__.py |
Removes the public export. |
op_tests/triton_tests/moe/test_moe_gemm_mxfp8.py |
Removes correctness tests. |
op_tests/op_benchmarks/triton/bench_moe_gemm_mxfp8.py |
Removes the benchmark. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Replaces ROCm#5831. Per review, the fixes land on the long-standing moe_gemm_a8w8 wrapper instead of moe_gemm_mxfp8.py, which ROCm#6035 removes. - Select USE_FNUZ from the input dtype. float8_e4m3fnuz inputs previously failed to compile because tl.dot_scaled rejects fp8e4b8. - Plain FP8 (static, per-token or per-expert scales) runs tl.dot on the FP8 operands; scales stay in the fp32 epilogue. - MXFP8 uses BLOCK_K=32 so each K step carries one E8M0 scale per operand and takes the FP8 MFMA path from ROCm#5832 instead of upcasting to fp32. Tiles come from the new gfx942 A8W8_MXFP8_FNUZ dispatch table, keyed by block_m so decode and prefill get separate configs; long-K decode shapes use split-K. - Split-K partials accumulate in fp32 and are reduced to the output dtype. - The matmul output is zero-initialised only when a scatter can leave rows unwritten. - dynamic_mxfp8_quant uses the fnuz range (max 240) for float8_e4m3fnuz. Weights stored as [E, N, K] are consumed through the [E, K, N] transposed view, so no per-call copy is made. Tests (gfx942): test_op_fnuz and test_op_mxfp8_fnuz, 111 passed.
Replaces ROCm#5831. Per review, the gfx942 support lands on the existing moe_gemm_a8w8 wrapper instead of moe_gemm_mxfp8.py, which ROCm#6035 removes. - Pass USE_FNUZ from the input dtype. float8_e4m3fnuz inputs previously failed to compile because tl.dot_scaled rejects fp8e4b8. - Plain FP8 on gfx942 runs tl.dot on the FP8 operands; scales stay in the fp32 epilogue. - MXFP8 on gfx942 uses BLOCK_K=32 so each K step carries one E8M0 scale per operand and takes the FP8 MFMA path from ROCm#5832. - Add the tuned dispatch that a8w4 and a16w4 already use, keyed by bm<block_m>_n<N>_k<K>, with a gfx942 table for Hy4-preview-FP8 at TP8. NUM_KSPLIT is honoured for the long-K gate/up shapes. Untuned shapes and other archs keep the existing heuristic. - dynamic_mxfp8_quant uses the fnuz range (max 240) for float8_e4m3fnuz. The test adds one gfx942 case per path (plain FP8, MXFP8 decode, MXFP8 prefill) to test_moe_gemm_a8w8.py.
Replaces ROCm#5831. Per review, the gfx942 support lands on the existing moe_gemm_a8w8 wrapper instead of moe_gemm_mxfp8.py, which ROCm#6035 removes. - Pass USE_FNUZ from the input dtype. float8_e4m3fnuz inputs previously failed to compile because tl.dot_scaled rejects fp8e4b8. - Plain FP8 on gfx942 runs tl.dot on the FP8 operands; scales stay in the fp32 epilogue. - MXFP8 on gfx942 uses BLOCK_K=32 so each K step carries one E8M0 scale per operand and takes the FP8 MFMA path from ROCm#5832. - Add the tuned dispatch that a8w4 and a16w4 already use, keyed by bm<block_m>_n<N>_k<K>, with a gfx942 table for Hy4-preview-FP8 at TP8. NUM_KSPLIT is honoured for the long-K gate/up shapes. Untuned shapes and other archs keep the existing heuristic. - dynamic_mxfp8_quant uses the fnuz range (max 240) for float8_e4m3fnuz. The test adds one gfx942 case per path (plain FP8, MXFP8 decode, MXFP8 prefill) to test_moe_gemm_a8w8.py.
Replaces ROCm#5831. Per review, the gfx942 support lands on the existing moe_gemm_a8w8 wrapper instead of moe_gemm_mxfp8.py, which ROCm#6035 removes. - Pass USE_FNUZ from the input dtype. float8_e4m3fnuz inputs previously failed to compile because tl.dot_scaled rejects fp8e4b8. - Plain FP8 on gfx942 runs tl.dot on the FP8 operands; scales stay in the fp32 epilogue. - MXFP8 on gfx942 uses BLOCK_K=32 so each K step carries one E8M0 scale per operand and takes the FP8 MFMA path from ROCm#5832. - Add the tuned dispatch that a8w4 and a16w4 already use, keyed by bm<block_m>_n<N>_k<K>, with a gfx942 table for Hy4-preview-FP8 at TP8. NUM_KSPLIT is honoured for the long-K gate/up shapes. Untuned shapes and other archs keep the existing heuristic. - dynamic_mxfp8_quant uses the fnuz range (max 240) for float8_e4m3fnuz. The test adds one gfx942 case per path (plain FP8, MXFP8 decode, MXFP8 prefill) to test_moe_gemm_a8w8.py.
moe_gemm_mxfp8 was removed in ROCm#6035, and nothing on main reads configs/<arch>/triton/moe/mxfp8_fnuz any more, so these three tables would have no reader. Signed-off-by: Martin Domanský <[email protected]>
…gfx1151: sparse_mla_dsv4_train, sonicmoe (#6158) * Add sparse_mla_dsv4_train Triton config for gfx1101 Signed-off-by: Martin Domanský <[email protected]> * Add moe_gemm_mxfp8 and sonicmoe Triton configs for gfx1101 The values are the gfx942 entries, written out in the gfx1101 files; a search on gfx1101 did not beat them on every measured shape. Signed-off-by: Martin Domanský <[email protected]> * Add MoE and MLA Triton configs for gfx1150 and gfx1151 sparse_mla_dsv4_train is tuned on gfx1150 (Radeon 890M): the forward kernel takes BLOCK_H 16, BLOCK_K 16 and 8 warps, the backward kernel the gfx1101 values, as no other candidate was faster. moe_gemm_mxfp8 and sonicmoe carry the gfx942 entries; a search on gfx1150 did not beat them on every measured shape. The gfx1151 files are copies of gfx1150 (same RDNA 3.5 generation); only the sonicmoe _comment differs. They are not measured: no gfx1151 hardware was available. Signed-off-by: Martin Domanský <[email protected]> * Drop the mxfp8_fnuz configs for gfx1101, gfx1150 and gfx1151 moe_gemm_mxfp8 was removed in #6035, and nothing on main reads configs/<arch>/triton/moe/mxfp8_fnuz any more, so these three tables would have no reader. Signed-off-by: Martin Domanský <[email protected]> * Drop the model names from the sonicmoe config comments Review of 2026-10-21 on #6158: the _comment fields in the gfx1101 and gfx1150 sonicmoe_bf16 tables name the architecture only. * Remove the _comment fields from the sonicmoe config tables Review of 2026-10-23 on #6158 (azaidy): no comments in config files. Drops the _comment key from the gfx1101, gfx1150 and gfx1151 sonicmoe_bf16 tables. Values unchanged. --------- Signed-off-by: Martin Domanský <[email protected]>
…gfx1151: sparse_mla_dsv4_train, sonicmoe (ROCm#6158) * Add sparse_mla_dsv4_train Triton config for gfx1101 Signed-off-by: Martin Domanský <[email protected]> * Add moe_gemm_mxfp8 and sonicmoe Triton configs for gfx1101 The values are the gfx942 entries, written out in the gfx1101 files; a search on gfx1101 did not beat them on every measured shape. Signed-off-by: Martin Domanský <[email protected]> * Add MoE and MLA Triton configs for gfx1150 and gfx1151 sparse_mla_dsv4_train is tuned on gfx1150 (Radeon 890M): the forward kernel takes BLOCK_H 16, BLOCK_K 16 and 8 warps, the backward kernel the gfx1101 values, as no other candidate was faster. moe_gemm_mxfp8 and sonicmoe carry the gfx942 entries; a search on gfx1150 did not beat them on every measured shape. The gfx1151 files are copies of gfx1150 (same RDNA 3.5 generation); only the sonicmoe _comment differs. They are not measured: no gfx1151 hardware was available. Signed-off-by: Martin Domanský <[email protected]> * Drop the mxfp8_fnuz configs for gfx1101, gfx1150 and gfx1151 moe_gemm_mxfp8 was removed in ROCm#6035, and nothing on main reads configs/<arch>/triton/moe/mxfp8_fnuz any more, so these three tables would have no reader. Signed-off-by: Martin Domanský <[email protected]> * Drop the model names from the sonicmoe config comments Review of 2026-10-21 on ROCm#6158: the _comment fields in the gfx1101 and gfx1150 sonicmoe_bf16 tables name the architecture only. * Remove the _comment fields from the sonicmoe config tables Review of 2026-10-23 on ROCm#6158 (azaidy): no comments in config files. Drops the _comment key from the gfx1101, gfx1150 and gfx1151 sonicmoe_bf16 tables. Values unchanged. --------- Signed-off-by: Martin Domanský <[email protected]>
Motivation
Routing code does not belong inside moe gemm wrapper and also it should not be written purely in torch. We already have triton kernels that cover moe routing. Also moe_gemm_per_token should be another feature added to a8w8 kernel rather than separate kernel by itself.
Submission Checklist