Skip to content

[Config] [Perf] Add MiniMax-M3-EAGLE3.1 BF16 GEMM rows for gfx950 - #7170

Merged
demonsan merged 2 commits into
ROCm:mainfrom
amd-bishwoadhikari:config/minimax-m3-eagle-bf16-gemm
Nov 30, 2026
Merged

demonsan merged 2 commits into
ROCm:mainfrom
amd-bishwoadhikari:config/minimax-m3-eagle-bf16-gemm

Conversation

@amd-bishwoadhikari

@amd-bishwoadhikari amd-bishwoadhikari commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds 13 tuned BF16 GEMM rows for MiniMax-M3-EAGLE3.1 on gfx950 (MI355X, 256 CUs). The rows go into minimax_m3_eagle_bf16_tuned_gemm.csv. Their shapes go into minimax_m3_eagle_bf16_untuned_gemm.csv.

Motivation

Per the author's original description, the shapes are projections of the MiniMax-M3-EAGLE3.1 draft model at TP=2 and TP=4. They are gate_up_proj (N=18432 at TP=2, N=9216 at TP=4), down_proj (N=6144, K=9216 at TP=2) and qkv_proj (N=6144, K=12288 at TP=4). 11 of these 13 keys run main's default today, torch (hipBLASLt). 2 keys run a row of main that its lookup reaches by padding M. Each added row selects its own kernel and was at least 3% faster than main in each of 3 paired repeats.

Changes

  • Adds 13 rows to minimax_m3_eagle_bf16_tuned_gemm.csv. The 285 rows of main stay unchanged.
  • Adds the same 13 shapes to minimax_m3_eagle_bf16_untuned_gemm.csv. The tuner reads this file as its shape list. The last line of the file also gains the newline that main lacked.
  • Kernel types of the rows: 13 FlyDSL.
  • The first version of this PR changed 67 rows. 54 are not in this version. The details are under Rows not included.
Rows not included
Reason Rows
rows that replace rows of main; they did not beat them in a same-session A/B (best 4.3% faster with 3x the error ratio), so main's rows stay 7
rows not at least 3% faster than main's default (34 FlyDSL, 3 OPUS, 7 torch rows) 44
not at least 3% faster than main in every one of the 3 repeats of the final run 1
not at least 3% faster than main in both repeats of the hold-out run 2

Performance (if applicable)

Hardware is one MI355X (gfx950, 256 CUs) GPU, taken through gpuq on a shared node. Before is main's current lookup for the same key. After is this branch's table.
Times are device time per call in µs from gemm_a16w16_tune.py --run_config -i <shapes>: the mean of 3 paired repeats, 5 warm-up and 101 timed runs each.
Before and After are geometric means over the rows of a group. Change is 1 − After ÷ Before.

Hardware Workload/configuration Before After Change
MI355X (gfx950, 256 CUs) N=6144, K=9216, M=1…128, 8 rows 27.14 µs 23.68 µs 13% faster (rows 8–20% faster)
MI355X (gfx950, 256 CUs) N=9216, K=6144, M=480…496, 2 rows 94.20 µs 83.45 µs 11% faster (rows 11–12% faster)
MI355X (gfx950, 256 CUs) N=18432, K=6144, M=4…16, 3 rows 47.94 µs 43.93 µs 8% faster (rows 7–10% faster)

All 13 rows: geometric mean 12% faster.

All 13 rows
M N K Kernel type Before (µs) After (µs) Change
1 6144 9216 flydsl 25.15 22.02 12% faster
2 6144 9216 flydsl 24.97 21.98 12% faster
4 6144 9216 flydsl 23.95 21.81 9% faster
8 6144 9216 flydsl 24.25 22.27 8% faster
16 6144 9216 flydsl 24.76 22.40 10% faster
32 6144 9216 flydsl 28.20 23.29 17% faster
64 6144 9216 flydsl 30.81 24.71 20% faster
128 6144 9216 flydsl 37.54 32.66 13% faster
480 9216 6144 flydsl 93.46 83.17 11% faster
496 9216 6144 flydsl 94.95 83.74 12% faster
4 18432 6144 flydsl 47.74 42.98 10% faster
8 18432 6144 flydsl 47.60 43.80 8% faster
16 18432 6144 flydsl 48.48 45.05 7% faster

Testing

  • Unit tests added or updated
  • Performance benchmarks run
  • Tested on MI250X
  • Tested on MI300X

This PR changes data files only, so it adds no test. The measurements ran on MI355X only.

Documentation

  • Docstrings updated
  • User guide updated
  • Performance guide updated
  • No documentation change is needed, with the reason stated below

This is a data-only change to tuned CSV tables. It changes no code, flag or API.

Dependencies

  • No new third-party dependencies added
  • New dependencies are listed and justified below

Breaking Changes

None. Only gfx950 lookups with 256 CUs change, for these keys and for the runtime M that pad up to them.

PR Self-Review

Reviewed revision

32dca5c485f3d06f0024a9cd6d879b4ce2689615

Behavior and intent

For 13 keys the lookup now returns a row with its own kernel. Before, it returned torch (hipBLASLt) or a row of main reached by padding M. Each row was at least 3% faster than main in each of 3 paired repeats. No row of main changes.

Validation and unverified scope

  • Ran gemm_a16w16_tune.py --run_config -i <shapes> on main and on this branch: 3 paired repeats on MI355X (gfx950, 256 CUs), with the order of the pair alternating. Every kept row used its own kernel (selection line checked) and finished with status OK.
  • 2 rows of this PR were near the 3% bar. Their worst repeat took 0.95 or more of main's time. A second lease ran them again for 2 fresh paired repeats. A row stayed only if both were also at least 3% faster: 0 of 2 did.
  • The tuner compares every output with a reference. 9 of the 13 kept rows differ on 0.5–2.4% of the elements. The other rows match. The tuner accepts up to 5%. The recorded err_ratio of the added rows is at most 2.3%. Main's rows in the same file go up to 2.71%.
  • Ran these tests on this branch merged with main, and on the four MiniMax-M3 config PRs merged together:
    • test_config_shape_collision.py: 33 passed.
    • test_csv_validation.py: 19 passed.
    • test_a16w16_tuned_config_lookup.py: 14 passed, 9 failed; the same 9 gfx1250 cases fail with main's configs.
    • test_opus_a16w16_policy_parity.py: 19 passed.
    • test_arch_resolution.py: 25 passed.
  • Ran the whole op_tests/tuning_tests directory with main's configs and with the four PRs merged. Both runs give 38 failed and 370 passed, with 54 skipped. The failing and erroring tests are the same in both.
  • Its FlyDSL rows use the launcher measured in [Config] [Perf] Add MiniMax-M3 BF16 GEMM rows for gfx950 #6531. There, an A at an unaligned storage offset raises ValueError, as it does for the FlyDSL rows of main.
  • Unverified: end-to-end serving, model accuracy, MI300X, other images, and runtime M beyond the sampled neighbours.
  • The tuner times kernels with the torch profiler (get_trace_perf in aiter/test_common.py). It sums device kernel time and leaves out launch gaps. Rows that launch several kernels may gain less end to end.
  • The image was lmsysorg/sglang-rocm:v0.5.23-rocm10-mi35x-20261117 (digest sha256:09b8237296024285e6286ffb54d75c3af6d59342bbbb3558dea56bed86798814; torch 2.11.0+rocm10.0.0, hipBLASLt 1.4), FlyDSL 0.5.0. The main side used aiter code at 593945921 and the configs of main at c28a838be. These differ only in FlyDSL paged-attention decode files. Main has since moved to ce334d015, which this branch has merged. Against the code and configs of the measurements, the diff changes the gfx942 SiLU clamp check in fused_moe.py and a gfx942 test. It adds NVFP4 global-scale arguments to fused_moe and get_2stage_cfgs. It routes OPUS rows with non-K-contiguous operands to torch in tuned_gemm.py. It also touches Qwen3.8 MXFP4 aux shapes and FMOE tables and MiniMax-M3.1 MXFP8 GEMM tables. A gfx1250 Kimi K2 BF16 table, A4W4 blockscale GEMM tables, the tuner utilities and a Sage benchmark change too. It adds a persistent gfx950 A4W4 GEMM kernel and changes the per-tensor scale reduction of the quant kernel. The tuned_gemm.py change concerns OPUS rows, and this PR adds none. No row or lookup of its FlyDSL rows changed.
  • CI has not run on this revision.

PR-specific question

Which exact workload keys consume these configuration changes, and what evidence shows that unrelated shapes keep their previous selection?

The key is (gfx950, 256 CUs, M, N, K, bias, dtype, outdtype, scaleAB, bpreshuffle). The table above lists the 13 added keys. A row serves its exact M and every M that pads up to it (getPaddedM). 3 of the 13 rows serve only their own M. The widest row, M=128, N=6144, K=9216, serves 64 values of M. We sampled 42 runtime shapes that pad onto rows of this PR. Of these, 29 were more than 3% faster than main. 13 were within 3% of main. 0 were more than 3% slower (worst 1.01x main's time). This is a sample, not a sweep. The key holds N, K and the dtypes. Other models match these rows only when they use the same shapes.

Changed op tests

None.

🤖 Generated with Claude Code

@github-actions

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
ci:windows Windows JIT op smoke test on the gfx1201 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 7170 --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.

@aiter-bot

aiter-bot commented Oct 29, 2026 •

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision d3113b46a3f9 · 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. Which exact workload keys consume these configuration changes, and what evidence shows that unrelated shapes keep their previous selection?
  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 — Reviewed revision must contain at least the first 7 characters of the current head SHA

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

@amd-bishwoadhikari amd-bishwoadhikari changed the title [Config] [Perf] [gfx950] Add MiniMax-M3-EAGLE3.1 BF16 tuned GEMMs [Config] [Perf] Add MiniMax-M3-EAGLE3.1 BF16 GEMM rows for gfx950 Nov 18, 2026
@amd-bishwoadhikari
amd-bishwoadhikari marked this pull request as ready for review November 18, 2026 22:04
@amd-bishwoadhikari
amd-bishwoadhikari requested review from a team and a balanced review from Copilot November 18, 2026 22:04

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

The runtime GEMM selection changes need human review because no head-matched gfx950 GPU validation or raw benchmarks were supplied to independently verify correctness, numerical behavior, and latency.

No open issues 🎉

What changed in this PR

This PR extends aiter’s MiniMax-M3-EAGLE3.1 BF16 GEMM configuration with 13 FlyDSL selections for gfx950 GPUs with 256 compute units, targeting faster execution of matching projection shapes.

Changes:

  • Adds 13 tuned GEMM rows while preserving all existing entries.
  • Adds the same 13 shapes to the tuner’s input list and restores its final newline.
  • Changes configuration data only; no kernel code or public APIs change.
File Description
aiter/​configs/​model_configs/​minimax_m3_eagle_bf16_untuned_gemm.csv Adds the 13 corresponding tuning shapes and a final newline.
aiter/​configs/​model_configs/​minimax_m3_eagle_bf16_tuned_gemm.csv Adds 13 gfx950 BF16 FlyDSL kernel selections with tuning metrics.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 18, 2026 22:07

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

Static checks found no collisions, but the serving-time FlyDSL selection changes could not be independently verified for GPU correctness, latency, or model accuracy in this environment.

No open issues 🎉

Review effort: Balanced

@zufayu
zufayu requested a review from demonsan November 19, 2026 01:14
Copilot AI balanced review requested due to automatic review settings November 19, 2026 01:52

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

No head-matched GPU validation is available to establish numerical accuracy and latency for the serving-time split-K and padded-M dispatch changes on MI355X.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 19, 2026 07:34

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

The serving-time BF16 dispatch changes affect padded-M ranges and split-K numerics, but correctness and latency on MI355X lack independently verified, head-matched runtime evidence.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 19, 2026 10:16

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

Serving-time FlyDSL selection changes, including split-K and padded-M cases, require human review of runtime evidence because MI355X numerical and latency results could not be reproduced despite passing static key checks.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 19, 2026 12:38

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

The gfx950 FlyDSL dispatch changes include split-K rows with reported numerical mismatches, requiring maintainer review because static checks cannot establish numerical acceptance or end-to-end latency without exact-head GPU validation.

No open issues 🎉

Review effort: Balanced

amd-bishwoadhikari added a commit to amd-bishwoadhikari/aiter that referenced this pull request Nov 25, 2026
Consolidated single commit of the PR ROCm#7170 branch content, rebuilt onto
latest main (the previous branch history interleaved merge commits, which
a plain rebase cannot linearize). The tuned table is the exact key union
of main's current rows (292, including the 7 M3.1 lm_head rows from
8ca5a41) and this PR's 13 rows -- verified disjoint by lookup key.
The companion untuned shape table matches the reviewed branch.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Bishwo Adhikari <[email protected]>
@amd-bishwoadhikari
amd-bishwoadhikari force-pushed the config/minimax-m3-eagle-bf16-gemm branch from d677639 to c46a299 Compare November 25, 2026 15:22
Copilot AI balanced review requested due to automatic review settings November 25, 2026 15:22

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 FlyDSL selection rejects contiguous BF16 inputs with unaligned storage offsets, causing GEMM calls to raise ValueError instead of computing results.

1 open issue

Review effort: Balanced

demonsan
demonsan previously approved these changes Nov 25, 2026

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

LGTM

Copilot AI balanced review requested due to automatic review settings November 26, 2026 20:28

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

Split-K BF16 changes affect padded-M dispatch and report numerical mismatches, requiring human accuracy and latency validation because no exact-head GPU evidence is available for the pinned FlyDSL 0.5.3 runtime.

1 open issue

Review effort: Balanced

Consolidated single commit of the PR ROCm#7170 branch content, rebuilt onto
latest main (the previous branch history interleaved merge commits, which
a plain rebase cannot linearize). The tuned table is the exact key union
of main's current rows (292, including the 7 M3.1 lm_head rows from
8ca5a41) and this PR's 13 rows -- verified disjoint by lookup key.
The companion untuned shape table matches the reviewed branch.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Bishwo Adhikari <[email protected]>
@amd-bishwoadhikari
amd-bishwoadhikari force-pushed the config/minimax-m3-eagle-bf16-gemm branch from 7cbe14b to 32dca5c Compare November 26, 2026 21: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.

🔵 Needs a closer look

Maintainer runtime validation is needed for split-K BF16 accuracy and padded-M performance on gfx950, given reported numerical mismatches and measurements using FlyDSL 0.5.0 rather than the pinned 0.5.3 stack.

1 open issue

Review effort: Balanced

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

LGTM

@demonsan
demonsan merged commit 67461bc into ROCm:main Nov 30, 2026
64 checks passed
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.

4 participants