Skip to content

[Config] Mistral Large 4 gfx950 tuned tables (TP8 + TP4) - #7235

Merged
demonsan merged 2 commits into
ROCm:mainfrom
hongxiayang:ml4-tuned-configs-gfx950
Nov 6, 2026
Merged

demonsan merged 2 commits into
ROCm:mainfrom
hongxiayang:ml4-tuned-configs-gfx950

Conversation

@hongxiayang

@hongxiayang hongxiayang commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Tuned kernel tables for Mistral Large 4 (hidden 6144, 128 experts top-4, MLA ranks 512/64/128, vocab 204800) on MI350X
(gfx950, 256 CUs) at TP8 and TP4: FlyDSL fused MoE (a8w4 and a4w4), 128x128 block-scale fp8 GEMMs and bf16 GEMMs, with the
untuned shape lists next to them for re-tuning. Files live in aiter/configs/model_configs/ under the globs aiter already
merges (*tuned_fmoe*, *a8w8_blockscale_tuned_gemm*, *bf16_tuned_gemm*), so no env var is needed.

Motivation

None of the bundled tables cover the Mistral Large 4 shapes: MoE inter_dim 768 (TP8) / 1536 (TP4) with 128 experts top-4,
and the MLA projection GEMMs with N or K in {512, 576, 768, 1024, 1536}. Without rows, every one of them runs on the
heuristic configs; the measured cost is 8-22% output throughput depending on TP and concurrency (table below).

Changes

file rows content
mistral_large4_a8w4_tuned_fmoe.csv 28 2-stage FlyDSL fused MoE, fp8 activations x MXFP4 weights (per_1x32), SiLU; inter_dim 768 and 1536, M = 1..8192
mistral_large4_a4w4_tuned_fmoe.csv 23 1-stage flydsl_mxmoe_g1_* + stage 2, MXFP4 activations; inter_dim 768 (M = 32..8192; the port has no candidates below 32) and 1536 (M = 1..8192)
a8w8_blockscale_tuned_gemm_mistral_large4.csv 122 N x K = {1024, 1536, 2048, 4096, 12288} x 6144 and 6144 x {768, 1024}, M = 1..16384; 6144 x {3072, 6144}, M = 128..16384; 6144 x 2048 at M = 16384. 38 split-K rows for M <= 256 (K = 6144 small-M shapes: ~19.6 us -> 6-10 us). Shapes/M already in the bundled ds_v3 / qwen3_next / glm5.2 tables are left out
mistral_large4_bf16_tuned_gemm.csv 44 512 x 6144, 576 x 6144, 25600 x 6144, M = 1..16384 (libtype flydsl / asm / torch / opus; opus rows use the #6937 local kernel IDs)
4 *_untuned_* files - shape lists covering every tuned row, for re-tuning

Performance (if applicable)

Tuned tables vs heuristic configs on the same build, vLLM serving, 8k in / 1k out, median TPOT and output token throughput.
"Before" = this branch with the new tables removed (heuristics), "After" = this branch. TP4 rows measured on current main
(this branch's base) with fp8 KV cache; TP8 rows on aiter 0.1.25.

Hardware Workload/configuration Before After Change
MI350X x8 (gfx950) TP8, a8w4 experts, bf16 KV, conc 1 heuristic tuned output throughput +22%
MI350X x8 (gfx950) TP8, a8w4 experts, bf16 KV, conc 64 heuristic tuned output throughput +14%
MI350X x4 (gfx950) TP4, a4w4 experts, fp8 KV, conc 1 TPOT 12.61 ms, 76.8 tok/s TPOT 10.92 ms, 88.5 tok/s TPOT -13.4%, +15.3%
MI350X x4 (gfx950) TP4, a4w4 experts, fp8 KV, conc 4 TPOT 15.36 ms, 242.5 tok/s TPOT 13.13 ms, 282.2 tok/s TPOT -14.5%, +16.4%
MI350X x4 (gfx950) TP4, a4w4 experts, fp8 KV, conc 8 TPOT 18.64 ms, 398.3 tok/s TPOT 16.30 ms, 453.9 tok/s TPOT -12.6%, +14.0%

Accuracy with the tables active on current main, TP4, gsm8k (lm-eval, 5-shot chat): a4w4 full test set 0.967 flexible /
0.960 strict; a8w4 first 300 questions 0.977 / 0.973. The same tables on aiter 0.1.26 gave 0.9257 with and without the
tables (bf16 KV, full set), so the rows change speed only. 0 discarding MXMOE lines in every run; the only remaining
"not found tuned config" lines with the tables active are the TP4 lm_head bf16 shapes (N = 51200), which this PR does not tune.

Testing

  • Unit tests added or updated (config-only change; no op test covers tuned CSV content)
  • Performance benchmarks run (table above)
  • Tested on MI250X
  • Tested on MI300X (gfx950-only rows; tested on MI350X)

Documentation

  • No documentation change is needed: tables are picked up by the existing merge globs, no new option or env var.

Dependencies

  • No new third-party dependencies added

Breaking Changes

None.

PR Self-Review

Reviewed revision

f513f1d

Behavior and intent

Adds tuned rows for shapes that today fall through to the heuristics. Lookup behavior is unchanged: the same CSV globs,
the same key columns, no code touched. Rows for shapes already in other bundled tables were deliberately left out so
no lookup key is defined twice.

Validation and unverified scope

Verified:

  • Row-key duplicate check against every bundled *tuned_fmoe*, *a8w8_blockscale_tuned_gemm*, *bf16_tuned_gemm*
    table on main (gfx, cu_num + shape key columns): 0 overlaps.
  • Every tuned row has its shape in the matching untuned list.
  • CK a8w8 block-scale instance lists (gemm_a8w8_blockscale{,_cktile}_instance.py) unchanged since the tuning runs, so
    kernelId values still point at the kernels that were timed.
  • The two opus rows resolve to the same kernels through kid_for_name after [HIP] [CK] [OPUS] OPUS global kid to local kid #6937 (IDs migrated in this PR).
  • bf16 FlyDSL rows resolve by kernel name (get_flydsl_hgemm_kernel_params); fused-MoE FlyDSL names parse with
    the current mxfp4_kname / moe_kernels parsers.
  • Serve on current main (this branch, develop install, JIT build), TP4 on MI350X x4, fp8 KV: a4w4 and a8w4 both serve with
    no discarding MXMOE, missing-kernel or stale-ID message; every tuned row for the exercised shapes is picked up (with the
    tables removed, the same shapes show up as "not found tuned config"). Numbers in the table above; gsm8k above.
  • TPOT / throughput on current main match the aiter 0.1.26 build the rows were tuned on within 1% (conc 1/4/8), so the
    rows did not go stale across the 0.1.26 -> main kernel changes.
  • Serve + gsm8k at TP8 on aiter 0.1.25: table above.
  • Release gate of vllm/vllm-openai-rocm:mistral-large-4 (same files on aiter 0.1.26): TP4 a4w4 fp8-KV serve, gsm8k 0.97
    (lm-eval 5-shot chat, full set), 32k needle 12/12, 0 discarding MXMOE lines.

Unverified:

  • TP8 on current main (TP8 rows were only served on aiter 0.1.25/0.1.26; same file format and kernel names as the TP4 rows).
  • TP4 bf16 GEMM shapes (e.g. lm_head N = 51200) are not tuned; TP8 bf16 only.

PR-specific question

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

The tables are consumed through the existing exact-key lookups; every row carries gfx = gfx950, cu_num = 256, so no
other architecture or CU count can match:

  • mistral_large4_{a8w4,a4w4}_tuned_fmoe.csv -> fused_moe key
    (gfx, cu_num, token, model_dim, inter_dim, expert, topk, act_type, dtype, q_dtype_a, q_dtype_w, q_type, use_g1u1, doweight_stage1)
    with model_dim = 6144, expert = 128, topk = 4, act_type = Silu, dtype = bf16, inter_dim in {768, 1536}; a8w4 rows have
    q_dtype_a = fp8, a4w4 rows q_dtype_a = fp4x2, both q_dtype_w = fp4x2, q_type = per_1x32. token is the padded M
    (1..8192, powers of two). Example key seen at serve time: ('gfx950', 256, 8192, 6144, 1536, 128, 4, Silu, bf16, fp4x2, fp4x2, per_1x32, ...).
  • a8w8_blockscale_tuned_gemm_mistral_large4.csv -> block-scale fp8 GEMM key (gfx, cu_num, M, N, K) with
    (N, K) in {1024, 1536, 2048, 4096, 12288} x 6144 and 6144 x {768, 1024, 2048, 3072, 6144}, M as listed in Changes.
  • mistral_large4_bf16_tuned_gemm.csv -> bf16 GEMM key (gfx, cu_num, M, N, K, bias, dtype, outdtype, scaleAB, bpreshuffle)
    with (N, K) in {512, 576, 25600} x 6144, dtype = outdtype = bf16, no bias / scale / preshuffle.

Evidence that unrelated shapes are untouched:

  • Lookups are exact-key; a row can only be selected by a workload whose full key equals the row's key. The duplicate check
    against every bundled *tuned_fmoe*, *a8w8_blockscale_tuned_gemm*, *bf16_tuned_gemm* table on main found 0 shared
    keys, so no existing row is shadowed or re-ordered (the merge step also raises on duplicate keys, which would have failed
    the build).
  • No code or heuristic path changed; with the new files removed, the same build logs not found tuned config for exactly
    the Mistral Large 4 shapes above and nothing else (serve check, TP4, current main).

Changed op tests

None.

🤖 Generated with Claude Code

@hongxiayang
hongxiayang requested review from a team and a balanced review from Copilot October 30, 2026 20:15
@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 7235 --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 30, 2026 •

Copy link
Copy Markdown

NOT READY FOR HUMAN REVIEW

PR Self-Review

Revision 3afac5ee67c5 · 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.

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 tables change production kernel selection for 217 gfx950 shapes, but current-revision correctness and latency require MI350X validation unavailable in this source-only review.

No open issues 🎉

What changed in this PR

Adds Mistral Large 4 tuning tables for MI350X (gfx950, 256 CUs) at TP8 and TP4, using aiter’s existing automatic configuration loading without changing runtime code.

Changes:

  • Adds 28 A8W4 and 23 A4W4 FlyDSL fused MoE configurations.
  • Adds 122 block-scale FP8 GEMM and 44 BF16 GEMM configurations, including migrated OPUS local kernel IDs.
  • Includes companion untuned shape lists for re-tuning all four kernel groups.
File Description
aiter/​configs/​model_configs/​mistral_large4_bf16_untuned_gemm.csv BF16 projection and vocabulary GEMM shapes for re-tuning.
aiter/​configs/​model_configs/​mistral_large4_bf16_tuned_gemm.csv Tuned BF16 backend, kernel, and split-K selections.
aiter/​configs/​model_configs/​mistral_large4_a8w4_untuned_fmoe.csv A8W4 MoE shapes for TP8 and TP4 re-tuning.
aiter/​configs/​model_configs/​mistral_large4_a8w4_tuned_fmoe.csv Two-stage FlyDSL A8W4 MoE configurations.
aiter/​configs/​model_configs/​mistral_large4_a4w4_untuned_fmoe.csv A4W4 MoE shapes for TP8 and TP4 re-tuning.
aiter/​configs/​model_configs/​mistral_large4_a4w4_tuned_fmoe.csv FlyDSL MXFP4 MoE kernel selections.
aiter/​configs/​model_configs/​a8w8_blockscale_untuned_gemm_mistral_large4.csv Block-scale FP8 GEMM shapes for re-tuning.
aiter/​configs/​model_configs/​a8w8_blockscale_tuned_gemm_mistral_large4.csv Tuned CK and CK Tile FP8 GEMM selections, including split-K.

Review effort: Balanced

hongxiayang and others added 2 commits November 2, 2026 15:27
…4, a8w8 block-scale, bf16 GEMM)

Tuned on MI350X (gfx950, 256 CUs) for Mistral Large 4 (hidden 6144, 128 experts
top-4, MLA ranks 512/64/128, vocab 204800) served at TP8, with the in-tree tuners
(--mp 8, default errRatio). Files go under aiter/configs/model_configs/ and are
named so the existing *tuned_fmoe* / *a8w8_blockscale_tuned_gemm* /
*bf16_tuned_gemm* globs merge them with the bundled tables; no shape overlaps
the bundled rows.

- mistral_large4_a8w4_tuned_fmoe.csv (14 rows) and mistral_large4_a4w4_tuned_fmoe.csv
  (9 rows): 2-stage fused MoE, 128 experts, top-4, inter_dim 768, SiLU, per_1x32
  MXFP4 weights; fp8 activations (a8w4) for M = 1..8192 and MXFP4 activations
  (a4w4, --mxfp4-flydsl prune search) for M = 32..8192 (no candidates below M=32
  in that port).
- a8w8_blockscale_tuned_gemm_mistral_large4.csv (91 rows): 128x128 block-scale fp8
  GEMMs, N x K = 1024x6144, 1536x6144, 4096x6144, 6144x768/1024/3072/6144,
  M = 1..16384, --libtype all, plus a split-K pass for M <= 256 that takes the
  K=6144 small-M shapes from ~19.6 us to 6-10 us.
- mistral_large4_bf16_tuned_gemm.csv (45 rows): bf16 GEMMs 512x6144, 576x6144,
  25600x6144, M = 1..16384. The two opus rows use the local kernel IDs introduced
  by ROCm#6937 (resolved with kid_for_name; same kernels as tuned).

The untuned inputs are added next to each tuned file for retuning.

Measured end to end (vLLM, TP8, 8k in / 1k out): +14-22% output throughput over
the heuristic configs across concurrency 1-64, accuracy unchanged.

Signed-off-by: Hongxia Yang <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
…6 a4w4/a8w4, a8w8 block-scale TP4 shapes incl. split-K)

Extends the TP8 tables with the TP4 shapes of Mistral Large 4 on MI350X (gfx950,
256 CUs), tuned with the in-tree tuners of aiter 0.1.26 (--mxfp4-flydsl
--mxfp4-search-mode prune for a4w4, --mp 3, default errRatio):

- mistral_large4_{a8w4,a4w4}_tuned_fmoe.csv: +14 rows each, 128 experts top-4,
  inter_dim 1536, M = 1..8192. The a4w4 winners are 1-stage flydsl_mxmoe_g1_*
  kernels and need the (128, 6144, 1536, 4) MXFP4 aux shape (on main since ROCm#6942).
- a8w8_blockscale_tuned_gemm_mistral_large4.csv: +31 rows for N x K = 2048x6144
  and 12288x6144 (M = 1..16384) and 6144x2048 (M = 16384), with a split-K pass
  for M <= 256; 4096x6144 and 6144x6144 re-tuned on 0.1.26. The other TP4 shapes
  (3072x6144, 6144x1536, 6144x2048 below M = 16384) are already covered by the
  bundled ds_v3 / qwen3_next / glm5.2 tables and are left out.
- mistral_large4_bf16_tuned_gemm.csv: one duplicate (M=4, 512x6144) row removed.
- Untuned shape lists extended accordingly.

End to end (vLLM, TP4, a4w4 experts, bf16 KV, 8k in / 1k out): TPOT -14 / -9 / -8 %
and output throughput +16 / +9 / +9 % at concurrency 1 / 4 / 8 over the heuristic
configs; gsm8k unchanged.

Signed-off-by: Hongxia Yang <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
@hongxiayang
hongxiayang force-pushed the ml4-tuned-configs-gfx950 branch from f513f1d to 3afac5e Compare November 2, 2026 15:27
Copilot AI balanced review requested due to automatic review settings November 2, 2026 15:27

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

TP8 kernel selections remain unverified on current main, and static review cannot establish their correctness or performance without MI350X hardware validation.

No open issues 🎉

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 2cc7c97 into ROCm:main Nov 6, 2026
amd-sriram added a commit to amd-sriram/aiter that referenced this pull request Nov 9, 2026
…now has

ROCm#7235 added M=16384, N=6144, K=2048 to model_configs/a8w8_blockscale_tuned_gemm_mistral_large4.csv; AITER's config load raises on a duplicate shape key across model_configs files.
demonsan pushed a commit that referenced this pull request Nov 11, 2026
* [Config] [Tune] GLM-5.3 a8w8 blockscale GEMM rows for gfx950

88 rows for the FP8 block-scaled attention projections of GLM-5.3 (amd/GLM-5.3-Quark-MXFP4-AttnFP8) at TP4 and TP8: fused q_a/kv_a (2624x6144), q_b and indexer wq_b (4096x2048, 2048x2048), kv_b (7168x512, 3584x512), o_proj (6144x4096, 6144x2048) and indexer wk (128x6144). Only the M of the standard grid (1..32768) that had no gfx950 row are added, so no row overlaps an existing one. Tuned on an MI355X with no other jobs on the GPUs, --libtype all; every row has errRatio 0.

Signed-off-by: Sriram Kumar <[email protected]>

* [Config] Drop the 16384x6144x2048 row that the Mistral Large 4 table now has

#7235 added M=16384, N=6144, K=2048 to model_configs/a8w8_blockscale_tuned_gemm_mistral_large4.csv; AITER's config load raises on a duplicate shape key across model_configs files.

* [Config] List the gfx950 GLM-5.3 shapes in the untuned CSV

Adds the 77 shapes of the new tuned rows that a8w8_blockscale_untuned_gemm_glm5_3.csv did not list, so the untuned and tuned files hold the same shapes and a retune keeps them.

---------

Signed-off-by: Sriram Kumar <[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.

4 participants