Repository navigation
[Config] Add tuned GEMM and fused-MoE configs for MI350P (gfx950, 128 CUs) - #7218
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
READY FOR HUMAN REVIEWPR Self-ReviewRevision Author self-review accepted. Readiness report: Author answers
Show the author's self-review answersBehavior and intentValidation and unverified scopePR-specific questionChanged op testsPR state
Copilot findings
Code and op-test hygiene
Required CI
Shadow mode reports what would block but keeps the status successful. Set |
4ce6b7c to
c618f0e
Compare
|
Perf A/B on MI350P (gfx950, 128 CUs) for the Qwen3-235B MXFP4 tables in this PR: +8-9% prefill and +5-10% decode throughput at the concurrencies that matter, end-to-end in vLLM. Setup
Prefill, 8000 in / 50 out (input tok/s)
Decode, 50 in / 4096 out (output tok/s)
Per-round changes agree within ~2-4 points everywhere except decode c=16 (-6.8% / +14.8%; median TPOT 27.0 -> 26.0 ms). Mean TPOT at decode c=64 goes 43.7 -> 39.9 ms. Notes
|
- Adds six tuned config files for gfx950 at 128 CU, covering the a4w4, a8w8, bf16 and fused MoE families, so dispatch on that part stops falling through to an untuned default. - Places them under model_configs rather than the canonical tables, so the runtime merge adds these rows to each family instead of substituting them. The merge key includes cu_num, so the 128 CU rows and the shipped 256 CU rows coexist and each part reaches its own.
- Adds eight tuned config files for gfx950 at 128 CU, extending the a8w8 blockscale, a8w8 blockscale bpreshuffle, bf16 and fused MoE families. - Covers fused MoE at two tensor parallel splits, which key apart on inter_dim and so merge as distinct shapes rather than displacing one another.
- Adds shapes to eight existing gfx950 128 CU config files in the a4w4, a8w8 blockscale, a8w8 blockscale bpreshuffle and fused MoE families. - Leaves every previously tuned row untouched, so the additions widen coverage without changing an existing dispatch choice.
- Adds 90 bf16 rows across three gfx950 128 CU files, one of them new, so the a16w16 family covers the shapes previously left untuned, including the (M, 64640, 4096) lm_head GEMM. - Adds two a8w8 blockscale bpreshuffle rows that close five DeepSeek-V4 shapes which matched no tuned row and fell through to the heuristic. Every addition appends, so no previously tuned row is modified or reordered. Most of the new bf16 rows name flydsl kernels, which bake the die count in at AOT time, so they depend on the base tree more than the hipblaslt rows beside them.
- Removes (16, 4096, 4096) at gfx950 128 CU, which the DeepSeek-V4-Flash file also carries after the previous commit. The merge dedups on (gfx, cu_num, M, N, K) with no model in the key, so the two collided and setup.py refused to load. - Keeps the faster-measured row: the ck kernel in the DeepSeek file at 10.88 us against 15.68 us for the asm row removed here, which is also what aiter's own auto-resolution selects.
- Records the 512x384x7168 bf16 shape measured on a 128 CU gfx950 part, which the existing table covers only at 256 CUs, so the lookup found nothing there. The merged bf16 family has no other row on this key, checked against all 31 files rather than this one alone, since the runtime merges them together.
Adds 80 rows to the 512x384x7168 one already here, all tuned on a 128 CU
gfx950 part with csrc/gemm_a16w16/gemm_a16w16_tune.py. The 512x384x7168 row
came from the same sweep, so it is left as it stands rather than re-added.
Shape-collision guard passes on the whole tree:
python3 -m unittest op_tests.tuning_tests.test_config_shape_collision
Ran 27 tests ... OK
which merges this file with aiter/configs/bf16_tuned_gemm.csv and every other
bf16_tuned_gemm model file, so the check is family-wide.
Every batch reported an empty Failed shapes and the worst err_ratio is 0.0226,
which is bf16 accumulation over K=7168 rather than a kernel problem - the
K=512 shapes come out at 0.
The 44 shapes of the list still untuned are the ones GEMM lookup reaches only
at an exact M. getPaddedM(M,N,K,0) rounds M up to 16 below 257 and to 32
below 1025, and the lookup tries exact M, then gl=0, then gl=1, so the bucket
boundaries tuned here already serve every M between them.
Kernel choice splits by M: FlyDSL wins all 23 shapes at M<=64, 21 of 25 from
65 to 256, and 14 of 33 above that, where asm takes over.
- Changes the (384, 1024, 7168) row from kernel id 1221 to 73, the id the gfx950 a16w16 opus registry gives the kernel the row names. The lookup rejected id 1221 as unknown and the shape fell back to torch, so the tuned kernel was never selected.
- Appends the rows for models that already have a table in a family to that table, so each model keeps one file per family. - Gives the DeepSeek-V4-Flash and Qwen3-235B rows plain model-named files where no table existed, replacing the separate _mi350p files. - Drops the gfx and flat columns from the GPT-OSS MoE rows to match their target file; the merge infers gfx950 from cu_num 128, and every moved row had flat 0. - Keeps the Qwen3-235B FP8 MoE rows in a file of their own, since three are flat 1-stage kernels that need the xbf16 and flat columns the existing table lacks. Dispatch is unchanged: every row lands in the same merged family table with the same key and kernel.
- Removes four Qwen3-235B a4w4 blockscale rows (M 128 and 512 at N 4096, 4608 and 9216) and one GLM-5.2 a8w8 blockscale row (32, 8192, 2048). - Their tuned kernels ran slower than the default dispatch in the production operator, though the tuner's own sweep had picked them, so these shapes now keep the default. The padded-M lookup maps each removed M to itself, so no neighbouring row takes over these shapes.
c618f0e to
ccbd9d4
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The 11 new configuration rows lack explicit gfx950 tagging, so loading them uses the host GPU’s architecture and can cause incorrect cross-architecture matches.
1 open issue
What changed in this PR
Adds 829 tuned GEMM and fused-MoE configuration rows targeting MI350P (gfx950, 128 compute units), extending AITER’s model-specific dispatch tables beyond the earlier Qwen3.8-27B tuning.
Changes:
- Covers six model families across BF16, FP8, and FP4 operations.
- Appends tuning entries to existing tables and adds model-specific tables where needed.
- Adds a separate Qwen3-235B FP8 MoE table supporting
xbf16andflatsettings.
All paths below are under aiter/configs/model_configs/.
| File | Description |
|---|---|
qwen3_235b_fp8_tuned_fmoe.csv |
Adds 8 FP8 MoE configurations with layout flags. |
qwen3_235b_fp4_tuned_fmoe.csv |
Adds 43 FP4 MoE configurations. |
qwen3_235b_bf16_tuned_gemm.csv |
Adds 10 BF16 GEMM configurations. |
qwen3_235b_a4w4_blockscale_tuned_gemm.csv |
Adds 204 FP4 blockscale GEMM configurations. |
kimik2_bf16_tuned_gemm.csv |
Appends 81 Kimi-K2 BF16 GEMM configurations. |
gptoss_fp4_tuned_fmoe.csv |
Appends 11 GPT-OSS FP4 MoE configurations. |
gptoss_bf16_tuned_gemm.csv |
Appends 44 GPT-OSS BF16 GEMM configurations. |
dsv4flash_fp4_tuned_fmoe.csv |
Adds 14 DeepSeek-V4-Flash FP4 MoE configurations. |
dsv4flash_bf16_tuned_gemm.csv |
Adds 47 DeepSeek-V4-Flash BF16 GEMM configurations. |
dsv4flash_a8w8_blockscale_tuned_gemm.csv |
Adds 52 FP8 blockscale GEMM configurations. |
dsv4flash_a8w8_blockscale_bpreshuffle_tuned_gemm.csv |
Adds 213 B-preshuffled FP8 blockscale configurations. |
a8w8_bpreshuffle_tuned_gemm_minimax_m3.csv |
Appends 10 MiniMax-M3 B-preshuffled FP8 configurations. |
a8w8_blockscale_tuned_gemm_glm5.2.csv |
Appends 15 GLM-5.2 FP8 blockscale configurations. |
a8w8_blockscale_bpreshuffle_tuned_gemm_qwen3_235b.csv |
Appends 61 Qwen3-235B B-preshuffled FP8 configurations. |
a8w8_blockscale_bpreshuffle_tuned_gemm_glm5.2.csv |
Appends 16 GLM-5.2 B-preshuffled FP8 configurations. |
Review effort: Balanced
- Swaps the gfx950 128 CU hipBLASLt rows of the DeepSeek-V4-Flash and GPT-OSS bf16 tables for the fastest FlyDSL or torch kernel retuned without hipBLASLt. - Drops the four lm_head rows where no such kernel beat the default, so those sizes use F.linear. A hipBLASLt solution index belongs to one hipBLASLt build, and hipb_mm exits the process on an index the installed library does not have.
- Moves the 11 gfx950 rows at cu_num 128 from gptoss_fp4_tuned_fmoe.csv into gptoss_fp4_gfx950_tuned_fmoe.csv, keyed by gfx, with their values unchanged. - Leaves gptoss_fp4_tuned_fmoe.csv as it is on main. The old table has no gfx column, so a row's arch is inferred from cu_num, and 128 is not in that map: the wheel build fell back to gfx942, the first arch in GPU_ARCHS, and the FlyDSL AOT replay failed compiling the FP4 kernels for it.
# Conflicts: # aiter/configs/model_configs/a8w8_bpreshuffle_tuned_gemm_minimax_m3.csv

Motivation
On a 128 CU gfx950 part (MI350P), GEMM and fused-MoE lookups find no tuned row and fall back to the default dispatch. The only exception is the Qwen3.8-27B rows from #6939. This PR adds 825 rows at
gfx950,cu_num=128. They don't change dispatch on 256 CU parts, and none overlap the before mentioned merged PR.Changes
Rows are appended to the model's existing table under
model_configs/, or put in a new model file where none exists. No existing row is modified. Three Qwen3-235B FP8 MoE rows need thexbf16/flatcolumns, whicha8w8_blockscale_tuned_fmoe_qwen3_235b.csvlacks, so those rows go in a newqwen3_235b_fp8_tuned_fmoe.csv. The 11 GPT-OSS FP4 rows go in a new gptoss_fp4_gfx950_tuned_fmoe.csv, because gptoss_fp4_tuned_fmoe.csv has no gfx column and the wheel build cannot infer gfx950 from cu_num 128.The rows were tuned with the in-tree tuners and timed against the default dispatch in the production operator. No row uses hipBLASLt: a hipBLASLt solution index belongs to one hipBLASLt build, so the bf16 rows use FlyDSL, asm, opus or torch kernels. Four DeepSeek-V4-Flash lm_head shapes where none of those beat the default have no row.
Test Plan
op_tests/tuning_tests/test_config_shape_collision.py--run_configon each family's shapes:Test Result
Collision test OK. No ERROR or MISMATCH statuses in any run. Overall: 76,629 → 65,972 us over 829 shapes, geomean 1.28x, total 1.16x.
The bf16 row and the overall line were measured before de6a7fa, which replaced 15 bf16 hipBLASLt rows with the fastest FlyDSL or torch kernel and dropped the 4 lm_head rows; they will be re-measured. The other families' rows have not changed since.
Reviewed revision
190e1af
Behavior and intent
On a 128 CU gfx950 part, the shapes above dispatch to their tuned kernel instead of the default, since no row existed at cu_num 128 for them. Other archs and CU counts are unchanged.
Validation and unverified scope
python3 -m pytest op_tests/tuning_tests/test_config_shape_collision.pypasses at 190e1af (32 passed). On MI350P (gfx950, 128 CUs), before de6a7fa: every bf16 row resolved as written at gfx950/128, and--run_configagainst the default dispatch reported no ERROR or MISMATCH, with the gains in Test Result.Unverified: the bf16 lookup check and timings since de6a7fa replaced 15 bf16 rows and dropped 4; they will be re-measured.
PR-specific question
Every added row is keyed at
gfx950,cu_num=128plus its family's shape columns, so other CU counts and archs cannot reach them. No existing row is modified, and the collision test confirms no added key duplicates one already on main.Changed op tests
None.