Skip to content

[Triton/Gluon] Remove bad moe gemm wrapper code - #6035

Merged
vgokhale merged 4 commits into
mainfrom
moe_cleanup
Oct 6, 2026
Merged

vgokhale merged 4 commits into
mainfrom
moe_cleanup

Conversation

@lburzawa

@lburzawa lburzawa commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

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

@lburzawa
lburzawa requested a review from a team October 1, 2026 05:00
@lburzawa lburzawa changed the title Remove bad moe gemm wrapper code [Triton/Gluon] Remove bad moe gemm wrapper code Oct 1, 2026
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
multigpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: GPT-OSS-120B, DeepSeek-R1-0528, Kimi-K2.5
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 6035 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_mxfp8 and 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.

vgokhale
vgokhale previously approved these changes Oct 5, 2026
@vgokhale
vgokhale merged commit d0029e8 into main Oct 6, 2026
@vgokhale
vgokhale deleted the moe_cleanup branch October 6, 2026 15:54
akii96 added a commit to akii96/aiter that referenced this pull request Oct 7, 2026
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.
akii96 added a commit to akii96/aiter that referenced this pull request Oct 7, 2026
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.
akii96 added a commit to akii96/aiter that referenced this pull request Oct 7, 2026
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.
akii96 added a commit to akii96/aiter that referenced this pull request Oct 7, 2026
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.
Ragua1 added a commit to Ragua1/aiter that referenced this pull request Oct 15, 2026
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]>
Boss2002n pushed a commit that referenced this pull request Nov 3, 2026
…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]>
shantipriya-amd pushed a commit to shantipriya-amd/aiter that referenced this pull request Nov 18, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants