Skip to content

[Config] [gfx1250] Tune MiniMax-M3.1 TP4 DSpark BF16 FC and routed MXFP4 MoE - #8161

Merged
zufayu merged 3 commits into
ROCm:mainfrom
XiaobingSuper:xiaobingsuper/m31-gfx1250-tp4-tuning-20261118
Nov 27, 2026
Merged

zufayu merged 3 commits into
ROCm:mainfrom
XiaobingSuper:xiaobingsuper/m31-gfx1250-tp4-tuning-20261118

Conversation

@XiaobingSuper

@XiaobingSuper XiaobingSuper commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

gfx1250 (256 CU) tuning rows for MiniMax-M3.1 TP4. Config only; no kernel, dispatch or API change.

PR Self-Review

Reviewed revision

3943c4f

Behavior and intent

  • minimax_m3_eagle_bf16_tuned_gemm.csv: 17 rows for the DSpark draft FC, (N, K) = (6144, 30720), M = 1, 2, 4, ... 32768 and M = 48 (8 rows x 6 requests, a captured decode size) (FlyDSL hgemm, Triton and OPUS kids 527 / 561 / 593 / 598 / 716; each kid's kernel name matches main's OPUS registry). Every other M takes one of these rows through getPaddedM: a decode verify of 8 rows a request lands on 8 / 16 / 32 / 48 / 64 / 128 / ..., a prefill length on the next power of two.
  • minimax_m3_gfx1250_tuned_grouped_fmoe.csv: 16 routed-MXFP4 grouped-MoE rows for E128 / top-4, H6144 / I768, tokens 1-32768 (powers of two; the MoE lookup takes the next power of two). 16384 and 32768 use 256x256x256 tiles, 2x2 waves, 3 + 3 buffers, clusters 2x2 (GEMM1) / 4x4 (GEMM2), next-stage prefetch and LDS SoA interleave, no activation preshuffle.

Neither shape had a gfx1250 row, so both ran untuned defaults. The FC is replicated (the full K = 30720 on every rank), as ATOM main runs it.

Validation and unverified scope

4x MI455X, MiniMax-M3.1 TP4 + DSpark K7:

  • DSpark FC, production-operator A/B of the tuned rows against the untuned default: model-hit shapes M8 -7.98%, M4096 -33.88%.
  • Routed MoE: geomean 1.2366x over the standard set (worst 1.0034x), 1.1661x over the boundary set of non-power-of-two token counts (worst 0.9985x); max logits difference against an FP32 reference 3.83e-6; sparse / empty routing and changed-input graph replay pass.
  • 16384 / 32768 MoE rows: output bitwise identical to the previous config; greedy outputs identical on 3 long prompts in the model.

Unverified: measured on an earlier aiter base (576d3f0), not re-run on main. On main the rows apply unchanged and every OPUS kid resolves to the same kernel name. The FC rows' timing at padded M (for example M 40 -> the 48 row, M 72-120 -> the 128 row) was not measured against a per-M choice.

PR-specific question

Keys consumed: BF16 GEMM (gfx1250, 256, M, 6144, 30720, bias False, bf16, bf16) for M = 2^0 ... 2^15 and 48; grouped MoE (gfx1250, 256, token, 6144, 768, 128, 4, Swiglu, bf16, fp4x2, fp4x2, per_1x32) for tokens 2^0 ... 2^15. Rows are appended only; no existing row changes, and no key duplicates one in any other *bf16_tuned_gemm* / *tuned_grouped_fmoe* CSV on main, so every other shape keeps its selection.

Changed op tests

None.

🤖 Generated with Claude Code

@XiaobingSuper
XiaobingSuper requested review from a team and a balanced review from Copilot November 18, 2026 05:18

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 was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@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 8161 --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.

@github-actions github-actions Bot changed the title [Config][gfx1250] Tune MiniMax-M3.1 TP4 shared MXFP8 GEMMs [Config] [gfx1250] Tune MiniMax-M3.1 TP4 shared MXFP8 GEMMs Nov 18, 2026
@aiter-bot

aiter-bot commented Nov 18, 2026 •

Copy link
Copy Markdown

READY FOR HUMAN REVIEW

PR Self-Review

Revision 3943c4ff29a1 · mode shadow

Author self-review accepted. Readiness report:

Author answers

  • PASS — current-SHA answers are present and structurally specific
Show the author's self-review answers

Behavior and intent

- `minimax_m3_eagle_bf16_tuned_gemm.csv`: 17 rows for the DSpark draft FC, (N, K) = (6144, 30720), M = 1, 2, 4, ... 32768 and M = 48 (8 rows x 6 requests, a captured decode size) (FlyDSL hgemm, Triton and OPUS kids 527 / 561 / 593 / 598 / 716; each kid's kernel name matches main's OPUS registry). Every other M takes one of these rows through `getPaddedM`: a decode verify of 8 rows a request lands on 8 / 16 / 32 / 48 / 64 / 128 / ..., a prefill length on the next power of two.
- `minimax_m3_gfx1250_tuned_grouped_fmoe.csv`: 16 routed-MXFP4 grouped-MoE rows for E128 / top-4, H6144 / I768, tokens 1-32768 (powers of two; the MoE lookup takes the next power of two). 16384 and 32768 use 256x256x256 tiles, 2x2 waves, 3 + 3 buffers, clusters 2x2 (GEMM1) / 4x4 (GEMM2), next-stage prefetch and LDS SoA interleave, no activation preshuffle.

Neither shape had a gfx1250 row, so both ran untuned defaults. The FC is replicated (the full K = 30720 on every rank), as ATOM main runs it.

Validation and unverified scope

4x MI455X, MiniMax-M3.1 TP4 + DSpark K7:
- DSpark FC, production-operator A/B of the tuned rows against the untuned default: model-hit shapes M8 -7.98%, M4096 -33.88%.
- Routed MoE: geomean 1.2366x over the standard set (worst 1.0034x), 1.1661x over the boundary set of non-power-of-two token counts (worst 0.9985x); max logits difference against an FP32 reference 3.83e-6; sparse / empty routing and changed-input graph replay pass.
- 16384 / 32768 MoE rows: output bitwise identical to the previous config; greedy outputs identical on 3 long prompts in the model.

Unverified: measured on an earlier aiter base (`576d3f0`), not re-run on main. On main the rows apply unchanged and every OPUS kid resolves to the same kernel name. The FC rows' timing at padded M (for example M 40 -> the 48 row, M 72-120 -> the 128 row) was not measured against a per-M choice.

PR-specific question

Keys consumed: BF16 GEMM `(gfx1250, 256, M, 6144, 30720, bias False, bf16, bf16)` for M = 2^0 ... 2^15 and 48; grouped MoE `(gfx1250, 256, token, 6144, 768, 128, 4, Swiglu, bf16, fp4x2, fp4x2, per_1x32)` for tokens 2^0 ... 2^15. Rows are appended only; no existing row changes, and no key duplicates one in any other `*bf16_tuned_gemm*` / `*tuned_grouped_fmoe*` CSV on main, so every other shape keeps its selection.

Changed op tests

None.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

PR state

  • PASS — pull request is marked ready for review

Copilot findings

  • PASS — no active Copilot finding lacks a substantive author reply
  • ADVISORY — Copilot could not review the current head (for example, quota or service failure)

Code and op-test hygiene

  • PASS — no committed artifact or conflict marker detected

Required CI

  • PASS — Black: passed
  • PASS — Ruff: passed
  • PASS — Repository dependency: passed
  • PASS — Aiter Test Gate: passed

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

@XiaobingSuper
XiaobingSuper requested a review from zufayu November 18, 2026 05:21
@XiaobingSuper
XiaobingSuper marked this pull request as draft November 18, 2026 06:02
@XiaobingSuper XiaobingSuper changed the title [Config] [gfx1250] Tune MiniMax-M3.1 TP4 shared MXFP8 GEMMs [Config] [gfx1250] Tune MiniMax-M3.1 TP4 native MXFP8 GEMMs Nov 18, 2026
@XiaobingSuper XiaobingSuper changed the title [Config] [gfx1250] Tune MiniMax-M3.1 TP4 native MXFP8 GEMMs [Config][gfx1250] Tune MiniMax-M3.1 TP4 MXFP8 linears and MXFP4 MoE Nov 18, 2026
@XiaobingSuper
XiaobingSuper marked this pull request as ready for review November 18, 2026 06:35
Copilot AI balanced review requested due to automatic review settings November 18, 2026 06:35

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 was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions github-actions Bot changed the title [Config][gfx1250] Tune MiniMax-M3.1 TP4 MXFP8 linears and MXFP4 MoE [Config] [gfx1250] Tune MiniMax-M3.1 TP4 MXFP8 linears and MXFP4 MoE Nov 18, 2026
@XiaobingSuper
XiaobingSuper force-pushed the xiaobingsuper/m31-gfx1250-tp4-tuning-20261118 branch from 45b461e to 9351b79 Compare November 18, 2026 06:55
Copilot AI balanced review requested due to automatic review settings November 18, 2026 06: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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@XiaobingSuper XiaobingSuper changed the title [Config] [gfx1250] Tune MiniMax-M3.1 TP4 MXFP8 linears and MXFP4 MoE [Config][gfx1250] Tune MiniMax-M3.1 TP4 routed MXFP4 MoE Nov 18, 2026
@XiaobingSuper
XiaobingSuper marked this pull request as draft November 18, 2026 06:59
@XiaobingSuper XiaobingSuper changed the title [Config][gfx1250] Tune MiniMax-M3.1 TP4 routed MXFP4 MoE [Config][gfx1250] Tune MiniMax-M3.1 TP4 native MXFP8 linears and routed MXFP4 MoE Nov 18, 2026
@XiaobingSuper
XiaobingSuper marked this pull request as ready for review November 18, 2026 07:09
Copilot AI balanced review requested due to automatic review settings November 18, 2026 07:09

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 was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions github-actions Bot changed the title [Config][gfx1250] Tune MiniMax-M3.1 TP4 native MXFP8 linears and routed MXFP4 MoE [Config] [gfx1250] Tune MiniMax-M3.1 TP4 native MXFP8 linears and routed MXFP4 MoE Nov 18, 2026
@XiaobingSuper
XiaobingSuper marked this pull request as draft November 18, 2026 07:38
@XiaobingSuper XiaobingSuper changed the title [Config] [gfx1250] Tune MiniMax-M3.1 TP4 native MXFP8 linears and routed MXFP4 MoE [Config] [gfx1250] Tune MiniMax-M3.1 TP4 native MXFP8, DSpark BF16 FC and routed MXFP4 MoE Nov 18, 2026
@XiaobingSuper XiaobingSuper changed the title [Config] [gfx1250] Tune MiniMax-M3.1 TP4 native MXFP8, DSpark BF16 FC and routed MXFP4 MoE [gfx1250] Optimize MiniMax-M3.1 TP4 native MXFP8, DSpark BF16 FC and routed MXFP4 MoE Nov 18, 2026
@XiaobingSuper XiaobingSuper changed the title [gfx1250] Optimize MiniMax-M3.1 TP4 native MXFP8, DSpark BF16 FC and routed MXFP4 MoE [Config] [gfx1250] Tune MiniMax-M3.1 TP4 native MXFP8, DSpark BF16 FC and routed MXFP4 MoE Nov 18, 2026
@XiaobingSuper
XiaobingSuper force-pushed the xiaobingsuper/m31-gfx1250-tp4-tuning-20261118 branch from 67095ac to 1435998 Compare November 19, 2026 06:47
@XiaobingSuper XiaobingSuper changed the title [Config] [gfx1250] Tune MiniMax-M3.1 TP4 native MXFP8, DSpark BF16 FC and routed MXFP4 MoE [Config][gfx1250] Tune MiniMax-M3.1 TP4 DSpark BF16 FC and routed MXFP4 MoE Nov 19, 2026
@XiaobingSuper XiaobingSuper changed the title [Config][gfx1250] Tune MiniMax-M3.1 TP4 DSpark BF16 FC and routed MXFP4 MoE [Config][gfx1250] Tune MiniMax-M3.1 TP4 native MXFP8, DSpark BF16 FC and routed MXFP4 MoE Nov 19, 2026
@XiaobingSuper XiaobingSuper changed the title [Config][gfx1250] Tune MiniMax-M3.1 TP4 native MXFP8, DSpark BF16 FC and routed MXFP4 MoE [Config][gfx1250] Tune MiniMax-M3.1 TP4 DSpark BF16 FC and routed MXFP4 MoE Nov 19, 2026
lirui927 pushed a commit to lirui927/aiter that referenced this pull request Nov 20, 2026
…mm.csv

The 1119 image carries this tuned GEMM config next to the stack commit but
untracked (the stack commit drops ROCm#8161's renamed copy,
minimax_m3_draft_bf16_tuned_gemm.csv, without adding this one back). Tracked
here so a checkout of the branch matches the image's /app/aiter.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
lirui927 pushed a commit that referenced this pull request Nov 20, 2026
lirui927 pushed a commit that referenced this pull request Nov 20, 2026
… tables (#8161 at 575eb2c)

The 1119 stack carried #8161's base tables only. This adds the
PR's net change: minimax_m3_eagle_bf16_tuned_gemm.csv becomes
minimax_m3_draft_bf16_tuned_gemm.csv with 41 more rows, and
minimax_m3_gfx1250_tuned_grouped_fmoe.csv gains 16 rows.

Co-authored-by: XiaobingSuper <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
…P4 MoE

- 41 BF16 GEMM rows for the DSpark draft FC, (N, K) = (6144, 30720), M 1-32768.
- 16 routed-MXFP4 grouped-MoE rows for E128 / top-4, H6144 / I768, tokens
  1-32768; 16384 / 32768 use the 256x256x256 cluster config.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@XiaobingSuper
XiaobingSuper force-pushed the xiaobingsuper/m31-gfx1250-tp4-tuning-20261118 branch from a187017 to 2b4474a Compare November 23, 2026 07:10
@XiaobingSuper
XiaobingSuper marked this pull request as ready for review November 23, 2026 07:15
Copilot AI balanced review requested due to automatic review settings November 23, 2026 07:15
@github-actions github-actions Bot changed the title [Config][gfx1250] Tune MiniMax-M3.1 TP4 DSpark BF16 FC and routed MXFP4 MoE [Config] [gfx1250] Tune MiniMax-M3.1 TP4 DSpark BF16 FC and routed MXFP4 MoE Nov 23, 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@valarLip valarLip left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

⚠️ Action required before merge (1)

  1. Re-time the DSpark FC rows M=35, 49 and 56 against the ks5 FlyDSL kernel that the neighbouring rows use, and keep the faster kernel. aiter/configs/model_configs/minimax_m3_eagle_bf16_tuned_gemm.csv:297,300,301.
    • M=42/48/64 (:298,299,302) select flydsl_hgemm_..._t64x64x128x4_ks5_w4x2x1_..._pht_gfx1250 at 32.75 / 34.33 / 33.93 us.
    • M=35 (OPUS kid 309, 39.25 us), M=49 (t64x64x128x5_ks2, 38.45 us) and M=56 (t64x64x128x6_ks2, 38.93 us) are 13-20% slower.
    • All six fit in the same single 64-row M tile, so the ks5 kernel launches the same grid for M=35..64. The shape is weight-bandwidth bound (N=6144, K=30720).
    • The table's own noise is about 4%: the same t64x128x128x5_ks1 kernel measures 93.7 / 96.7 / 92.9 us at M=196/199/256.
    • So the gap looks like a missed or mis-timed candidate, not a real optimum. M=35/49/56 are batch x 7 DSpark K7 decode shapes, so they are on the hot path.
    • If ks5 is faster there, switch those three rows to it (splitK=5). If it really is slower, say so in the PR.

Checked clean, nothing to change:

  • No duplicate shapes. Family-wide merge against current main (414230f): bf16_tuned_gemm (canonical + 32 model files) and tuned_grouped_fmoe (canonical + 9 model files) have 0 duplicate keys. No collisions with open config PRs either (#8317 also edits this eagle file, but only gfx950 rows at :124+).
  • Files are well formed and get loaded. Headers and column counts match (18 / 48), and the loader discovers both files.
  • Every BF16 row resolves on main.
    • OPUS: all 19 (kid, kernelName) pairs match main's gfx1250 registry and pass the launch-plan and split-K checks.
    • FlyDSL: all 13 names parse, ks matches the splitK column, and the compile constraints hold.
    • Triton: the auto rows follow the existing pattern.
  • All 16 grouped-MoE rows pass on main. They pass every check grouped_gemm_mxfp4 / mxfp4_preshuffle_gfx1250_tdm run: tiles, warps, wpt, clusters, persistent workers, LDS. Blank split_k reads as 1. Each power-of-two token from 1 to 32768 hits exactly one row; larger counts cap at the 32768 row. #8157's fold does not apply to these rows (non-EP, a_preshuffle=0).
  • CI is green.

Reviewed at 2b4474a (Standard tier, config-only; hunter A + independent pass B, 2 agents). First review by valarLip.

The FC rows were every M one model run hit, including 7 x batch counts and
one-off prefill lengths. Keep the tuned rows for M = 1, 2, 4 ... 32768 and
M = 48 (8 rows x 6 requests, a captured decode size) as they are; every other
M takes one of them through getPaddedM. 24 rows removed, none changed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 25, 2026 06:53

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 was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@XiaobingSuper

Copy link
Copy Markdown
Contributor Author

The M = 35 / 49 / 56 rows, and the other non-power-of-two rows, are removed. The table now lists the power-of-two M plus M = 48 (8 rows x 6 requests, a captured decode size); any other M resolves to these rows through aiter's padded lookup (getPaddedM), so 35 / 49 / 56 run the ks5 FlyDSL kernel of the 48 / 64 rows.

@XiaobingSuper
XiaobingSuper requested review from valarLip and a balanced review from Copilot November 26, 2026 03:30

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 was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@zufayu
zufayu dismissed valarLip’s stale review November 27, 2026 02:37

Dismissed because the requested M=35/49/56 rows were removed in commit 39669a9; those shapes now resolve through the retained M=48/64 ks5 rows. Current head 3943c4f has green required CI and has been approved after the last push.

@zufayu
zufayu merged commit e59d083 into ROCm:main Nov 27, 2026
66 of 67 checks passed
samremes added a commit to samremes/aiter that referenced this pull request Dec 1, 2026
The helper had grown to ~450 lines plus ~450 lines of tests, mostly
special cases for renames, moves, multi-file groups, ambiguity and
summary counts. It is an advisory hint the reviewer checks against the
diff, so drop them: a tuned CSV pairs with the one untuned CSV in its
folder whose name has the same tokens, and the four mismatch kinds are
set differences over the rows the PR changed. Same findings on recent
tuning merges (ROCm#8016, ROCm#8161, ROCm#7109, ROCm#8566, ROCm#8490); renames and moves
are left to the reviewer.

Also drop the triage audit plumbing for tuning_coverage.txt (A5 findings
are backed through verdicts like any other rule), the .toml/tuning JSON
triggers (aiter tracks no tuning .toml files) and the unrelated
pre-commit change. Key columns are no longer dropped for the whole pair
when one untuned cell is blank, which hid real changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants