Skip to content

[Config] MiniMax-M3 MXFP8: tune N=1280 K=6144 (DSpark context KV projection) - #7411

Merged
Fangzhou-Ai merged 1 commit into
mainfrom
m31-mxfp8-n1280-tuned
Nov 4, 2026
Merged

Fangzhou-Ai merged 1 commit into
mainfrom
m31-mxfp8-n1280-tuned

Conversation

@micah-wil

@micah-wil micah-wil commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds 19 tuned rows for the MXFP8 bpreshuffle GEMM at N=1280, K=6144 (M = 1 … 65536) on gfx950 / 256 CUs to
configs/model_configs/minimax_m3_a8w8_blockscale_mxscale_bpreshuffle_tuned_gemm.csv.
This is a CSV-only change: 19 rows added, none modified or removed.

Motivation

N=1280, K=6144 is the context KV projection used by MiniMax-M3.1-Flash DSpark speculative decoding.
The shape has no row in the current table, so get_mxscale_bpreshuffle_config returns None.
That has two effects:

  1. AITER runs the FlyDSL batched GEMM under its heuristic and logs
    "mxscale bpreshuffle ... is untuned on gfx950" once per (N, K).
  2. Downstream callers that claim a shape only if it is tuned (vLLM's AiterMxfp8LinearKernel, via
    is_mxfp8_bpreshuffle_gemm_tuned) reject it and fall back to a Triton tl.dot_scaled kernel.

The other MiniMax-M3 TP4 projections (QKV 2560x6144, out 6144x2048, shared gate/up 1536x6144,
shared down 6144x768) are already tuned. This was the remaining shape in the decode path.

Changes

  • minimax_m3_a8w8_blockscale_mxscale_bpreshuffle_tuned_gemm.csv: 19 rows, 1x32 block scale,
    libtype=flydsl, kernelId=bmm. M = 1, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192 plus
    the larger buckets up to 65536, matching the M grid of the other shapes in the file.
  • split-K is chosen per bucket (for example sk4 at M=1, sk2 at M=128, sk1 from M=8192 up).
  • Tuner errRatio is at most 0.0016 on every row.

Performance

MI355X (gfx950, 256 CU), N=1280, K=6144, MXFP8 weights (bpreshuffle) and activations.
Method:

  • CUDA-graph replay of the full apply_weights path (activation MXFP8 quantize + GEMM), so the numbers include quantization.
  • Weights rotate through ~512 MiB of distinct copies so the weight is not served from L2/MALL.
  • Median of 7 rounds x 40 replays.
  • Times are µs per GEMM.
M AITER untuned (heuristic) AITER tuned (this PR) tuned vs untuned Triton dot_scaled (vLLM fallback) tuned vs Triton
1 7.27 6.89 1.05x 9.78 1.42x
4 7.35 6.87 1.07x 9.79 1.42x
8 7.39 6.88 1.07x 9.78 1.42x
16 7.41 7.06 1.05x 9.83 1.39x
32 8.66 7.54 1.15x 9.92 1.31x
64 8.95 8.79 1.02x 12.00 1.37x
128 13.46 11.22 1.20x 19.05 1.70x
256 20.27 14.85 1.37x 25.83 1.74x
512 25.38 18.26 1.39x 34.79 1.90x
1024 37.09 28.25 1.31x 36.02 1.28x
2048 55.11 36.68 1.50x 44.47 1.21x
4096 106.22 59.09 1.80x 90.21 1.53x
8192 121.23 100.14 1.21x 141.53 1.41x

The tuner-reported kernel time, which excludes activation quantization, is 5.82 µs at M=1,
9.06 µs at M=128 and 79.12 µs at M=8192. That is 1628 TFLOPS at M=8192.

Decode-relevant buckets are M <= 128. The tuned rows give 1.0-1.2x over AITER's own heuristic and
1.3-1.7x over the Triton fallback there. The gains over the heuristic grow at prefill-sized M (up to 1.8x at M=4096).

In a profile of MiniMax-M3.1-Flash decode on MI355X, the M=128 row's kernel
(bmm_a8w8_mxscale_t48x32x256_w1x2_nb6_sk2_bd2_b1_s32_1x32, about 10 µs) launches once per step.

Testing

  • Benchmark above, run once per configuration on MI355X in the vLLM ROCm nightly image with AITER overlaid.
    "Untuned" is the table on main. "Tuned" is main + these 19 rows. Both use the same script and process setup.
  • Tuner correctness: errRatio <= 0.0016 for all 19 rows.
  • Confirmed with the PR table that get_mxscale_bpreshuffle_config(M, 1280, 6144, "1x32") returns a config for M=1 and M=8192.
    On main it returns None and logs the "untuned" warning.
  • TODO: end-to-end MiniMax-M3.1-Flash accuracy (GSM8K) and DSpark throughput with these rows.

Documentation

N/A

Dependencies

None for AITER. The speedup over Triton is only reached in vLLM once the MXFP8 FlyDSL linear kernel lands
(micah/m31-mxfp8-flydsl, vLLM PR TODO: link). Without it, vLLM does not use this table for this shape.

Breaking Changes

None. The lookup is keyed by (N, K), so no other shape changes selection.

PR Self-Review

  • Reviewed revision: 68fbedf
  • Behavior and intent: Adds tuned FlyDSL bmm configs for the MXFP8 bpreshuffle GEMM at N=1280, K=6144, gfx950 / 256 CU, for 19 M values.
    Before, this shape was untuned (heuristic kernel selection plus a warning). After, it selects a per-M kernel and split-K from the table.
    The intent is to make this shape tuned, like the other MiniMax-M3 projections.
  • Validation and unverified scope: The 19 tuner errRatio values are <= 0.0016, and the performance table is a CUDA-graph micro-benchmark on MI355X.
    Unverified: end-to-end accuracy and throughput. Only M=1..8192 were re-benchmarked outside the tuner. The M=16384..65536 rows come from the tuner only.
    Single run per configuration, with the tuned and untuned runs on different GPUs, so differences of about 5% (M=1-16 and M=64) are within noise.
  • PR-specific question (workload keys and evidence that other shapes are unchanged):
    The only key affected is (gfx950, cu_num=256, N=1280, K=6144, w_scale 1x32).
    It is consumed by MiniMax-M3.1-Flash DSpark context KV projection (TP4) through
    gemm_a8w8_blockscale_bpreshuffle -> get_mxscale_bpreshuffle_config.
    The diff only adds rows, and the lookup matches on (N, K, M, w_scale), so rows for other shapes are untouched.
    The existing table has 18 (N, K) pairs and none has N=1280.
  • Changed op tests: None

@micah-wil
micah-wil requested a review from a team November 3, 2026 15:34
@github-actions

github-actions Bot commented Nov 3, 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
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 7411 --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.

@github-actions github-actions Bot changed the title [FlyDSL] MiniMax-M3 MXFP8: tune N=1280 K=6144 (DSpark context KV projection) [Config] MiniMax-M3 MXFP8: tune N=1280 K=6144 (DSpark context KV projection) Nov 3, 2026
@github-actions github-actions Bot added the Config label Nov 3, 2026
@aiter-bot

aiter-bot commented Nov 3, 2026 •

Copy link
Copy Markdown

NOT READY FOR HUMAN REVIEW

PR Self-Review

Revision 68fbedff35f6 · 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 — missing ### Reviewed revision in the PR description
  • FAIL — missing ### Behavior and intent in the PR description
  • FAIL — missing ### Validation and unverified scope in the PR description
  • FAIL — missing ### PR-specific question in the PR description
  • FAIL — missing ### Changed op tests in the PR description
  • FAIL — Reviewed revision must contain at least the first 7 characters of the current head SHA
  • FAIL — Behavior and intent has no substantive answer
  • FAIL — Validation and unverified scope has no substantive answer
  • FAIL — PR-specific question has no substantive answer

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

@micah-wil
micah-wil marked this pull request as draft November 3, 2026 15:37
@micah-wil
micah-wil marked this pull request as ready for review November 3, 2026 16:40

@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

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