Repository navigation
[Config] Mistral Large 4 gfx950 tuned tables (TP8 + TP4) - #7235
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
NOT READY FOR HUMAN REVIEWPR Self-ReviewRevision 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
Edit the Missing or invalid answers
Shadow mode reports what would block but keeps the status successful. Set |
There was a problem hiding this comment.
🔵 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
…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]>
f513f1d to
3afac5e
Compare
…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.
* [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]>
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 alreadymerges (
*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
mistral_large4_a8w4_tuned_fmoe.csvmistral_large4_a4w4_tuned_fmoe.csvflydsl_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.csvmistral_large4_bf16_tuned_gemm.csvlibtypeflydsl / asm / torch / opus; opus rows use the #6937 local kernel IDs)*_untuned_*files--mp 8).--mxfp4-flydsl --mxfp4-search-mode prune).(128, 6144, {768, 1536}, 4)MXFP4 aux shapes, on main since [Config] [Tuning] [gfx950] Add MiniMax-M3.1 MXFP4 MoE configs (E=128, top-4, TP2/TP4); fix A16W4 tuner checks #6942. Without themfused_moedrops the rows and logsdiscarding MXMOE config; nothing else changes.vllm/vllm-openai-rocm:mistral-large-4(aiter 0.1.26 plus these files and the aux shapes), byte-identical except the two
opuskernel IDs migrated for [HIP] [CK] [OPUS] OPUS global kid to local kid #6937.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.
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 MXMOElines 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
Documentation
Dependencies
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:
*tuned_fmoe*,*a8w8_blockscale_tuned_gemm*,*bf16_tuned_gemm*table on main (gfx, cu_num + shape key columns): 0 overlaps.
gemm_a8w8_blockscale{,_cktile}_instance.py) unchanged since the tuning runs, sokernelIdvalues still point at the kernels that were timed.opusrows resolve to the same kernels throughkid_for_nameafter [HIP] [CK] [OPUS] OPUS global kid to local kid #6937 (IDs migrated in this PR).get_flydsl_hgemm_kernel_params); fused-MoE FlyDSL names parse withthe current
mxfp4_kname/moe_kernelsparsers.main(this branch, develop install, JIT build), TP4 on MI350X x4, fp8 KV: a4w4 and a8w4 both serve withno
discarding MXMOE, missing-kernel or stale-ID message; every tuned row for the exercised shapes is picked up (with thetables removed, the same shapes show up as "not found tuned config"). Numbers in the table above; gsm8k above.
mainmatch the aiter 0.1.26 build the rows were tuned on within 1% (conc 1/4/8), so therows did not go stale across the 0.1.26 -> main kernel changes.
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 MXMOElines.Unverified:
main(TP8 rows were only served on aiter 0.1.25/0.1.26; same file format and kernel names as the TP4 rows).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 noother architecture or CU count can match:
mistral_large4_{a8w4,a4w4}_tuned_fmoe.csv->fused_moekey(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 haveq_dtype_a = fp8, a4w4 rowsq_dtype_a = fp4x2, bothq_dtype_w = fp4x2, q_type = per_1x32.tokenis 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 6144and6144 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:
against every bundled
*tuned_fmoe*,*a8w8_blockscale_tuned_gemm*,*bf16_tuned_gemm*table onmainfound 0 sharedkeys, so no existing row is shadowed or re-ordered (the merge step also raises on duplicate keys, which would have failed
the build).
not found tuned configfor exactlythe Mistral Large 4 shapes above and nothing else (serve check, TP4, current
main).Changed op tests
None.
🤖 Generated with Claude Code