Skip to content

[FlyDSL] [CI] mega_moe_tp: decode id routing, GEMM tile primitives and the router GEMM (1-128 rows) - #8548

Closed
ganyi1996ppo wants to merge 16 commits into
ROCm:mainfrom
ganyi1996ppo:ganyi/mega-moe-tp-decode-primitives
Closed

ganyi1996ppo wants to merge 16 commits into
ROCm:mainfrom
ganyi1996ppo:ganyi/mega-moe-tp-decode-primitives

Conversation

@ganyi1996ppo

@ganyi1996ppo ganyi1996ppo commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

First PR of the MiniMax-M3.1 decode MoE series (E128 top-4, H6144 / I768, 1-128 rows, gfx950). It adds the building blocks of mega_moe_tp that the decode path needs and that aiter did not have, so the decode MoE can run without the amd-kernels package:

Ported from amd-kernels (moe/mxfp4_h6144_i768_e128_top4, Apache-2.0, credited in the file headers); kernel bodies are unchanged, imports moved to aiter's buffer_ops / tensor_shim. No amd_kernels import.

Performance (MI355X gfx950, 1 GPU)

These are primitives and a router GEMM that replace the amd-kernels originals, so the goal is parity, not a speedup of their own:

  • Router GEMM, CUDA-graph replay, vs amd-kernels: 2.00 / 2.07 / 2.11 / 2.33 / 2.35 / 2.40 us at 1 / 8 / 16 / 17 / 24 / 32 rows (equal within +-0.01 us); 33-128 rows within +-0.03 us (2.0 .. 3.4 us). Eager host time is +0.2..0.4 us per call (irrelevant under graphs).
  • Primitives: the expert kernel assembled from them (private model-side integration, not in this PR) measured -21.3 / -12.1 / -13.4 us vs production at n=16/24/32 rows, within +0.2..+1.7 us of the pre-port amd-kernels version (200 iterations).
  • End-to-end effect: none by itself; the per-layer gain of the whole decode MoE chain (public path 96.8 -> 38.0 us at 8 rows, 144.0 -> 81.8 us at 128 rows) is measured in [CK] [FlyDSL] [CI] [Perf] MiniMax-M3.1 TP4 decode MoE through fused_moe(shared_folded) + tuned rows + --decode-chain tuner #8676.

Tests / how to run

  • pytest op_tests/flydsl_tests/test_decode_id_routing.py: torch oracle for the routing, 8..128 rows, partial blocks, skewed / all-one-expert ids, ids outside [0, E) (40 passed on gfx950). Wired into aiter_test.sh; the module is collected and skipped (not an empty run) on non-gfx950 GPUs.
  • pytest op_tests/test_decode_router_gemm.py: partials sum to x @ W.T (fp64 reference), 1-128 rows (30 passed).
  • Bit identity against amd-kernels (not part of the PR, harness imports amd-kernels): router partials 672/672 for rows 1..128 x 3 input kinds; 72/72 adversarial calls for the assembled kernel. The MFMA / quant primitives are covered through the bitwise test in [FlyDSL] [CI] mega_moe_tp: decode-shape (8-128 row) MoE expert GEMM1/GEMM2 tiles with the shared expert folded in #8555.
  • Known unrelated CI failure: Triton Tests (MI35X) / Shard 4 (test_gemm_a16wfp4), see the PR discussion; this PR does not touch Triton.

Dependencies / merge order

Merge order of the series: #8548 -> #8553 -> #8555 -> #8676; #8556 is independent. #8553 and #8555 branches contain this PR's commits (merged, not rebased), so their diffs shrink once this one lands. #8548 absorbs the earlier #8551 / #8552 (closed).

PR Self-Review

Reviewed revision

0374946

Behavior and intent

Adds the decode routing / tile primitives and the 1-128 row router GEMM (previously #8548, #8551, #8552) so the MiniMax-M3.1 decode MoE can run without amd-kernels.

Validation and unverified scope

Router partials and the assembled kernel are bit-identical to amd-kernels and at kernel-time parity (see Performance). Not verified: no standalone benchmark of the primitives; CI Triton shards were flaky/pending at this revision.

PR-specific question

This PR touches .github/scripts/aiter_test.sh / split_tests.sh only to add test files to the existing pytest lists: no workflow, permission or secret change, and no fork-controlled text reaches a privileged step.

Changed op tests

  • op_tests/flydsl_tests/test_decode_id_routing.py: torch oracle for the in-kernel canonical expert-block routing (8-128 rows, partial blocks, skewed ids, ids outside [0, E)); nothing else in the tree exercises decode_id_routing.
  • op_tests/test_decode_router_gemm.py: split-K partials of the router GEMM sum to x @ W.T in fp64 for 1-128 rows; no other test covers these kernels.

🤖 Generated with Claude Code

…MM tile primitives

Adds two new, self-contained helper modules to aiter's existing
mega_moe_tp family:

- decode_id_routing.py: in-kernel canonical expert-block routing for the
  small-M decode shape (<=128 rows, E128 top4) -- one workgroup resolves
  its 16-row expert block straight from topk_ids via an LDS-atomic
  histogram and a DPP wave scan, no sort launch and no global atomics.
- decode_tile_primitives.py: per-tile building blocks for the same shape's
  GEMM1/GEMM2 compute at H6144/I768 -- scaled-MFMA wrappers (MXFP4 A4W4 and
  MXFP8 A8W8), the SwiGLU activation, and MXFP4/MXFP8 row quantization.

Both are ports of the technique in amd-kernels'
moe/mxfp4_h6144_i768_e128_top4/{routing_ids.py,gemm1_a4w4_id_rows.py,
shared_gemm1_a8w8.py,shared_quant.py} (Apache-2.0, "Copyright contributors
to the amd-kernels project") -- same algorithm, reimplemented against
aiter's own aiter.ops.flydsl.kernels.buffer_ops instead of amd-kernels'
private copy of the same buffer-op wrappers. Neither file imports
amd_kernels; each file's docstring credits the specific amd-kernels source
module it is ported from.

mega_moe_tp already carries the epoch-flag / XCD-affinity / loader-wave
LDS-DMA primitives a fused decode GEMM1->GEMM2 kernel needs, but only at
128/256-row prefill tile shapes; this adds the small-M (8-128 row)
in-kernel routing and tile primitives it is missing for a decode-shape
fusion, generalized over the pair/row count (no model-specific constant
beyond the E128/top4/16-row-block shape a call site fixes).

This is a primitives-only PR: the tile loop, prefetch ring and LDS layout
that assemble these into a full fused kernel currently live in a
model-side integration (MiniMax-M3.1 decode MoE) that is not yet upstream
in ATOM, so no aiter op_test exercises the full assembled kernel here.
Correctness was verified through that integration instead: 72/72
adversarial-input bit-identical results against the original
amd_kernels-based kernel, and 12/12 matches against an independent
production reference, on real MI355X hardware (node 035, gpurun lease).
Perf (200 iters, same hardware): the assembled kernel using these
primitives measured -21.3/-12.1/-13.4 us vs production at n=16/24/32 rows,
within +0.2..+1.7 us (noise) of the pre-port amd_kernels version -- no
regression from the port itself.

Follow-up: land the model-side integration (currently
atom/models/minimax_m3/moe_one_launch_aiter.py in a private tree) as its
own ATOM-side PR once the file it extends is upstream, and add a native
aiter op_test once there is a complete in-aiter kernel to test against.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@ganyi1996ppo
ganyi1996ppo requested review from a team and a balanced review from Copilot November 24, 2026 07:44
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

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

Extended tests (opt-in via labels):

Label Tests
ci:mi300x Run Aiter standard tests on MI300X in PRs; main branch always runs them
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
ci:windows Windows JIT op smoke test on the Radeon R9700 ROCm runner
ci:multi-gpu 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: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
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 8548 --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.

Reviews:
A reviewer is usually assigned within one working day after the PR is ready for review (see Code Review Process). If nobody has responded for about a week, mention the area contact listed in CONTACTS.md. Want to help review? See REVIEWERS.md.

@aiter-bot

aiter-bot commented Nov 24, 2026 •

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision 037494656b6a · mode shadow

Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision.

Questions to answer in the PR description

  1. What behavior does this PR change, and why is the existing behavior insufficient?
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
  3. What permissions and untrusted-input boundary does this CI change have, and can fork PR code or text reach a privileged execution path?
  4. For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.

Edit the PR Self-Review section in the PR description. Include the current revision SHA; this comment refreshes automatically.

Missing or invalid answers

  • FAIL — validation answer must explicitly state what remains unverified (or say none with a reason)

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

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.

🟡 Changes recommended

The new helpers lack in-tree callers or CI-collected tests, leaving routing, MFMA, and quantization behavior without regression coverage.

3 open issues
What changed in this PR

Adds decode-shape MoE primitives to aiter’s mega_moe_tp family without an amd_kernels runtime dependency. This is a helpers-only addition; complete fused-kernel integration remains a follow-up.

Changes:

  • Adds in-kernel routing for E128/top-4 inputs into canonical 16-row expert blocks.
  • Adds gfx950 MXFP4/MXFP8 scaled-MFMA, SwiGLU, and quantization helpers.
  • Provides host-side routing-capacity and tile-sizing utilities.
File Description
aiter/​ops/​flydsl/​kernels/​mega_moe_tp/​decode_tile_primitives.py Adds compute, quantization, LDS-pointer, and shape-sizing helpers.
aiter/​ops/​flydsl/​kernels/​mega_moe_tp/​decode_id_routing.py Adds wave-level expert selection and packed-row routing without a separate sort launch.

Review effort: Balanced

Comment on lines +77 to +81
ir_ = buffer_ops.create_buffer_resource(ids, max_size=False, num_records_bytes=n_pairs * 4)
vals = []
for c in range_constexpr(pairs // 64):
q = lane + c * 64
v = fx.Int32(buffer_ops.buffer_load(ir_, q, vec_width=1, dtype=fx.Int32))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Acknowledged, tracked: this needs a maintainer/author decision (scope or design trade-off), so no change is made yet; decision pending.

ganyi1996ppo and others added 3 commits November 24, 2026 02:36
…tials

bf16x3 split-K router GEMM (E128 x H6144, MFMA 16x16x32) for 1-32 rows: a no-LDS
direct kernel for 1-16 rows and a line-layout two-wave kernel for 17-32 rows, plus
the tier dispatch (router_gemm_partials) and the one-time gate permutation
(router_line_layout). Ported from amd-kernels' moe/mxfp4_h6144_i768_e128_top4
(router_gemm_direct / router_gemm_nblocks_lines / router_gemm dispatch, Apache-2.0),
bodies unchanged, imports moved to aiter's buffer_ops / tensor_shim.

Verified on gfx950: partials bit-identical to amd-kernels for rows 1..32 (3 input
kinds), graph-replayed GPU time equal to +-0.01 us.

Co-Authored-By: Claude <[email protected]>
…, optional input-quant workgroups)

Adds the 33-128 row router GEMM tier (router_gemm_nblocks: split-48 to 64 rows,
split-16 above, optional MXFP4 + MXFP8 input-quant workgroups appended or
prepended to the same launch for the top-k + quant chain that follows) and extends
the router_gemm_partials dispatch to 128 rows. Ported from amd-kernels'
moe/mxfp4_h6144_i768_e128_top4/router_gemm_nblocks.py (Apache-2.0), bodies
unchanged; the quant group reuses decode_tile_primitives' _fp8 / _e8m0_fp8.

Verified on gfx950: partials bit-identical to amd-kernels for rows 1..128 (3 input
kinds, with and without the line-layout gate), graph-replayed GPU time within
+-0.03 us at 1..128 rows.

Co-Authored-By: Claude <[email protected]>
…tials

bf16x3 split-K router GEMM (E128 x H6144, MFMA 16x16x32) for 1-32 rows: a no-LDS
direct kernel for 1-16 rows and a line-layout two-wave kernel for 17-32 rows, plus
the tier dispatch (router_gemm_partials) and the one-time gate permutation
(router_line_layout). Ported from amd-kernels' moe/mxfp4_h6144_i768_e128_top4
(router_gemm_direct / router_gemm_nblocks_lines / router_gemm dispatch, Apache-2.0),
bodies unchanged, imports moved to aiter's buffer_ops / tensor_shim.

Verified on gfx950: partials bit-identical to amd-kernels for rows 1..32 (3 input
kinds), graph-replayed GPU time equal to +-0.01 us.

Co-Authored-By: Claude <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 24, 2026 08:49

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.

🟡 Changes recommended

The routing helper can silently drop tokens because its default scan capacity is too small and corrupt scratch memory by treating out-of-range expert IDs as histogram indices.

5 open issues

Review effort: Balanced

…use rocdl cvt wrappers; add routing test

Co-Authored-By: Claude <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 24, 2026 13:28
…use rocdl cvt wrappers; add routing test

Co-Authored-By: Claude <[email protected]>

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.

🟡 Changes recommended

The routing probe is not wired into CI discovery or execution, and the device compute helpers lack numerical tests for scaling, transpose handling, packing, and clamping.

3 open issues
1 previously missed issue

In code that hasn't changed since last review

Medium severity Add numerical probes for device compute helpers

aiter/​ops/​flydsl/​kernels/​mega_moe_tp/​decode_tile_primitives.py:72

The routing probe imports only id_pairs_for and max_sorted_rows, leaving this module's device compute helpers untested. Errors in MFMA scale-byte selection, transpose handling, packing, or activation clamping would go undetected by the added tests. Add small gfx950 probes with independent numerical references for A4W4/A8W8, activation, and quantization, using nonconstant scales and inputs that trigger the clamps; op_tests/flydsl_tests/test_silu_and_mul_fq.py provides a reference pattern.

3 resolved since last review

Review effort: Balanced

…fails without the id-range guard)

Co-Authored-By: Claude <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 24, 2026 13:41
@ganyi1996ppo

Copy link
Copy Markdown
Contributor Author

ROCm/aiter PR #8548 — [FlyDSL] mega_moe_tp: decode-shape (8-128 row) in-kernel routing + GEMM tile primitives

Adds two helper modules: an in-kernel canonical expert-block routing primitive for 8-128 decode rows (no sort launch) and gfx950 scaled-MFMA / SwiGLU / MXFP4-MXFP8 quant tile primitives.

Review (advisory): ⚠️ NEEDS WORK, the findings below are fixed on the branch (commits 1b1d58d, 264be23); not independently refuted
Validation (deterministic): NOT RUN — validate_pr.sh needs a built aiter worktree and the PR shipped no test target, so there was no base to compare; hand-run on node 035 GPU 0 instead (advisory): new test_decode_id_routing.py 40/40 pass; with the id-range guard removed the out-of-range case fails (padding rows 96 -> 97/99); the amd-kernels bit-identical tile test (15 tests) and the router tests (83) also pass with the converts moved to the rocdl wrappers
Perf (advisory): NOT RUN — the primitives have no standalone benchmark; the PR's quoted -21.3/-12.1/-13.4 us is for the assembled kernel in #8555 and is [unverified] here
Size: 388 lines / 2 files
Design (advisory): in-kernel per-workgroup routing (LDS-atomic histogram + DPP scan + ballot) in place of a sort launch
Human: recommend vpietila-amd review whether an in-kernel routing primitive belongs in mega_moe_tp for PR 8548 or should reuse moe_sorting

🔴 [verified] decode_id_routing.py wave_expert defaulted pairs=256 scans only 64 rows although the docstring supports 128: with m=96 and every row routed to ids 0-3, 256 of 384 pairs are scanned, 16 blocks are built instead of 24 and tokens 64-95 are dropped. Fixed: pairs is now required (callers pass id_pairs_for(m)).
🔴 [verified] decode_id_routing.py wave_expert accepted only ids >= 0: ids >= 128 index the histogram, id 256+r increments row-table slot r (corrupting padding rows, reproduced on GPU 035: padding 96 -> 97/99) and id 336 writes past the wave's 1344-byte slice. Fixed: ids outside [0,128) go to the lane's dummy slot; the new test fails without the guard.
⚠️ [verified] decode_tile_primitives.py docstring and _fp4/_fp8 said FlyDSL has no wrapper for the packed converts, but mega_moe_tp/common.py already calls rocdl.cvt_scalef32_pk_fp4_f32 / fp8_f32. Fixed: both now use the wrappers, bit-identical on the 057 amd-kernels oracle test.
⚠️ [verified] decode_id_routing.py shipped with no collectible test for the routing primitive (no test_*.py in the PR, kernel_tests.txt lists both files). Fixed: op_tests/flydsl_tests/test_decode_id_routing.py (torch oracle, 8-128 rows, partial blocks, skewed/all-one-expert, out-of-range ids). Still open: MFMA / quant primitives have no standalone test; they are covered through #8555's bit-identical test. Author should add isolated scale/clamp boundary tests or state that #8555 is the coverage.
📝 [inferred] wave_expert still loads ids with the legacy buffer_ops helper, as the rest of mega_moe_tp does; the flydsl AGENTS guidance prefers buffer tensors. Reviewer should ask whether a family-wide migration is wanted rather than a one-off here.

🤖 Generated with Claude Code

…rch/strides, per-GPU launcher, CI runs the test

Review findings on ROCm#8551:
- router_gemm_partials launched on the current device with whatever pointers it
  was given: a CPU or foreign-GPU gate / hidden state became an invalid GPU
  address, gfx942 reached an MFMA form it lacks, and one cached compiled handle
  served every GPU. It now returns None unless every tensor is CUDA storage on
  one gfx950 device, launches under that device with its stream and keeps one
  launcher per GPU (kernels/topk/topk_launch._launcher_on).
- An expanded row (stride(0) == 0) gave the kernels an empty buffer descriptor
  and silently zero partials (max error 10.46 = |logits| on 8 rows, reproduced
  on gfx950). Rows must not overlap, and m * stride * 2 must fit the 32-bit
  descriptor extent; both return None.
- _get_kernel took a hard-coded (48, 64) beside split_config; it uses the tier.
- The test had no per-split oracle (permuted split slots passed), no stride or
  rejection case, and CI runs op_tests with `python3 file` (collects nothing):
  add per-chunk reference, padded-stride and rejection cases, a gfx950 skip, and
  list the file in aiter_test.sh's pytest dispatch.

Verified on gfx950: 14 passed.

Co-Authored-By: Claude <[email protected]>
ganyi1996ppo and others added 2 commits November 24, 2026 08:16
Keeps this branch's own content; the parent's older copies of shared files are superseded by this branch's versions.

Co-Authored-By: Claude <[email protected]>

# Conflicts:
#	aiter/ops/flydsl/kernels/mega_moe_tp/decode_router_common.py
#	aiter/ops/flydsl/kernels/mega_moe_tp/decode_router_gemm.py
#	op_tests/test_decode_router_gemm.py
Copilot AI balanced review requested due to automatic review settings November 25, 2026 06:03
@ganyi1996ppo ganyi1996ppo changed the title [FlyDSL] mega_moe_tp: decode-shape (8-128 row) in-kernel routing + GEMM tile primitives [FlyDSL] mega_moe_tp: decode id routing, GEMM tile primitives and the router GEMM (1-128 rows) Nov 25, 2026
@github-actions github-actions Bot changed the title [FlyDSL] mega_moe_tp: decode id routing, GEMM tile primitives and the router GEMM (1-128 rows) [FlyDSL] [CI] mega_moe_tp: decode-shape (8-128 row) in-kernel routing + GEMM tile primitives Nov 25, 2026
@github-actions github-actions Bot added the CI label Nov 25, 2026
@ganyi1996ppo ganyi1996ppo changed the title [FlyDSL] [CI] mega_moe_tp: decode-shape (8-128 row) in-kernel routing + GEMM tile primitives [FlyDSL] mega_moe_tp: decode id routing, GEMM tile primitives and the router GEMM (1-128 rows) Nov 25, 2026

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.

🟡 Changes recommended

The routing probe is not wired into CI, and the router indexes tensor dimensions before validating rank, causing zero-dimensional inputs to raise IndexError instead of allowing fallback.

6 open issues

Review effort: Balanced


@pytest.mark.parametrize("n", ROWS)
@pytest.mark.parametrize("lines", [True, False])
def test_partials_sum_is_the_logits(n, lines):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Acknowledged, tracked: this needs a maintainer/author decision (scope or design trade-off), so no change is made yet; decision pending.

…e fp4 cvt, gfx950 gate via get_gfx_runtime, collect the id-routing probe in CI

- router_gemm_partials: reject non-2D hidden_states before reading shape[0] (a 0-D tensor raised IndexError instead of returning None for the caller fallback).
- decode_router_common._cvt_pk_fp4: use FlyDSL's rocdl.cvt_scalef32_pk_fp4_f32 wrapper (as decode_tile_primitives._fp4) instead of the raw LLVM intrinsic.
- test_decode_id_routing: gate on get_gfx_runtime() == "gfx950" instead of a gcnArchName substring probe.
- split_tests.sh / aiter_test.sh: add flydsl_tests/test_decode_id_routing.py to the nested-file list and dispatch it through pytest (it has no script entry point), so routing regressions run in CI.

Co-Authored-By: Claude <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 26, 2026 01:23
ganyi1996ppo added a commit to ganyi1996ppo/aiter that referenced this pull request Nov 26, 2026
…#8555) into moe-decode-fmoe-tuner

# Conflicts:
#	.github/scripts/aiter_test.sh
@github-actions github-actions Bot changed the title [FlyDSL] mega_moe_tp: decode id routing, GEMM tile primitives and the router GEMM (1-128 rows) [FlyDSL] [CI] mega_moe_tp: decode id routing, GEMM tile primitives and the router GEMM (1-128 rows) Nov 26, 2026

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.

A module-level pytest.skip leaves no collected tests, so the per-file pytest
run exits with code 5 on MI300X shards. Use a module-wide skipif mark.

Co-Authored-By: Claude <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 26, 2026 02:55

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.

🔵 Needs a closer look

Human review is needed to assess a test-convention deviation that bypasses the required shared numerical-comparison diagnostics.

3 open issues
2 resolved since last review

Review effort: Balanced

@ganyi1996ppo

Copy link
Copy Markdown
Contributor Author

Status for the Copilot overviews (latest on 037494656) and the aiter-bot self-review: all inline findings are answered in their threads (fixed in 6b89b92 / 0374946, or not applicable with evidence); two are tracked with a decision pending (legacy buffer_ops migration, benchmark entry point). The description now has the PR Self-Review section for revision 0374946. Open: Triton Tests (MI35X) shard failure on this run, unrelated to this PR (no Triton files), rerun pending.

@ganyi1996ppo

Copy link
Copy Markdown
Contributor Author

Closing this as part of consolidating our MiniMax-M3.1 TP4 decode-MoE work.

Rationale: this decode chain (#8548 router GEMM + id-routing + tile primitives, #8553 top-4 + MXFP4/MXFP8 input-quant, #8555 expert GEMM1/GEMM2 + shared-expert fold, #8676 fused_moe(shared_folded) integration + decode-chain tuner) is a parity port of the amd-kernels decode path — bit-identical to that reference, not a speedup over it. aiter main already serves MiniMax-M3.1 TP4 decode at the same shapes (M=8-256) through the merged mega_moe_tp backend (#8270), which is the path our production stack uses, so this standalone single-GPU chain adds no independent end-to-end gain.

The one genuinely new optimization from this effort — the one-workgroup E128 expert sort (2.5-3x vs the default sort, through the general moe_sorting interface, useful to every E128 MoE model) — landed separately in #8556 and stays.

Closing to keep the review queue focused. Thanks to everyone who reviewed.

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.

4 participants