Repository navigation
[Config][Perf] Add tuned bf16 GEMM configs for Qwen3.8-2.4T-A95B on gfx950 - #5835
Merged
yifehuan merged 1 commit intoSep 26, 2026
Merged
Conversation
…fx950 Qwen3.8-2.4T-A95B served at TP8 executes seven bf16 GEMM families that have no tuned entry, so every one of them falls back to rocBLAS. Add 26 rows covering the five families where a portable backend is measurably faster than that fallback, tuned on gfx950 / cu_num=256. N=8192 K=256 12 rows MoE down-projection / GDN out_proj N=4608 K=8192 4 rows Gated DeltaNet in_proj_qkvz N=512 K=8192 4 rows MoE router gate N=32 K=8192 3 rows Gated DeltaNet in_proj_ba N=31040 K=8192 3 rows lm_head, vocab 248320 sharded TP8 This supersedes ROCm#5183, which shipped 75 rows of which 63 were hipBLASLt. Review asked for hipBLASLt to be dropped because its solution indices are build-specific. Re-picking from that PR's tuning data left 15 rows worth only +0.35% end to end, so ROCm#5183 was closed. Re-tuning against the gfx950 A16W16 FlyDSL kernels added in ROCm#5145 changes the answer: 26 rows, +5.1%. No row uses hipBLASLt or opus. Both dispatch on an integer index into an external library (hipblaslt solidx, opus kernelId), which is the fragility the review objected to. flydsl and asm are looked up by kernelName and the kernels live in AITER itself; flydsl additionally falls through to the default when a named kernel is absent from the build. triton is solidx=0 with kernelName=auto. Every row is required to beat the kernel AITER picks with no tuned entry, measured on the same build, so no row can be slower than today's behaviour. Shapes where nothing portable beat the fallback are deliberately left out rather than filled in. That is why 26 rows replace 75. Winners were selected as the fastest candidate within err_ratio <= 0.005 rather than on speed alone; the tuner's default 0.05 would have picked split-k kernels an order of magnitude further from the reference. 23 of the 26 rows are exactly 0.0; the three split-k rows are 0.0020-0.0048. Measured under vLLM on amd/Qwen3.8-2.4T-A95B-Quark-MXFP4, TP8, MI355X, 8k/1k at concurrency 4-256, arms differing only by this table: geometric mean output throughput +5.1%, geometric mean mean-TTFT -9.6%. Signed-off-by: Mikko Tukiainen <[email protected]> Co-authored-by: Cursor <[email protected]>
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
PR title tags & labels: |
1 task done
akii96
added a commit
to akii96/aiter
that referenced
this pull request
Sep 27, 2026
Adds `minimax_m3_bf16_tuned_gemm.csv` (78 rows) covering the bf16 GEMM families MiniMax-M3 executes that had no tuned entry, across TP8, TP4 and TP2. Tuned on gfx950, cu_num=256 (MI355X). The shipped `minimax_m3_mxfp4_bf16_tuned_gemm.csv` covers M=16..512 at TP8 only, so decode is served but every prefill M is unserved, and TP4/TP2 are largely unserved. On an 8k/1k workload prefill is the majority of the tokens, so those shapes fall back to `torch solution:0`. Following the review of ROCm#5183/ROCm#5835, no row uses hipblaslt or opus: their solution indices are library-build-specific. Backends are flydsl (75) and triton (3), both dispatched by kernelName and portable. Winners are the fastest candidate within err_ratio <= 0.005 rather than the tuner's default 0.05, which is loose enough to select split-k kernels an order of magnitude further from the reference. 75 of 78 rows are exactly 0.0; the remaining three are 0.0049, 0.0050 and 0.0050. 76 rows are splitK=1. Families covered (per-rank N,K): TP8 1536x6144 sparse qkv+index proj 1280x6144 dense qkv 6144x1024 o_proj 3072x6144 dense gate_up 6144x1536 dense down 25008x6144 lm_head TP4 2560x6144, 2304x6144, 6144x2048, 6144x6144, 6144x3072, 50016x6144 TP2 5120x6144, 4608x6144, 6144x4096, 12288x6144, 100032x6144 The matching `minimax_m3_bf16_untuned_gemm.csv` shape list is included so the table can be re-tuned without reconstructing the shapes by hand. Shapes were derived from the architecture (hidden 6144, 64 q heads, 4 kv heads, 4 index heads, head_dim 128, dense_intermediate 12288, vocab 200064) rather than captured, and validated against the existing table: the TP8 derivations land exactly on its 1280x6144 and 1536x6144 entries. Note 4 kv heads and 4 index heads are replicated rather than split at TP8. Not measured end to end.
akii96
added a commit
to akii96/aiter
that referenced
this pull request
Sep 27, 2026
Replaces the 78 tuned rows with 265 tuned against the M values the workload actually issues, covering TP8, TP4 and TP2. gfx950, cu_num=256. The previous rows were tuned at assumed prefill sizes (2048, 4096, 8192, 16384, 32768). Chunked prefill does not produce those: the real M values are 526, 746, 757, 8192, 8244, 8248, 16854, 16932, 16946, 16976, 24581, 24601, 24673, 24675, 25057, 25321, 32768, and lm_head runs at M=6..16. Only 8192 and 32768 ever coincided, and 8248 does not reach 8192 through the padded-M lookup, so an end-to-end run with the old table recorded 56 lookups and 0 hits. This table is keyed on the observed values. Every row beats the current fallback by at least 1.02x on the same build, so no shape can regress. Winners are the fastest candidate within err_ratio <= 0.005 rather than the tuner default of 0.05, which is loose enough to select split-k kernels an order of magnitude further from the reference. All 265 rows are exactly 0.0, and no row uses split-k. Following the review of ROCm#5183/ROCm#5835, no row uses hipblaslt or opus, whose solution indices are specific to a library build. Backends are flydsl (202) and triton (63), both dispatched by kernelName. Per-rank families, 17 M values each (11 for lm_head): TP8 1536x6144 sparse qkv+index proj 1280x6144 dense qkv 6144x1024 o_proj 3072x6144 dense gate_up 6144x1536 dense down 25008x6144 lm_head TP4 2560x6144, 2304x6144, 6144x2048, 6144x6144, 6144x3072, 50016x6144 TP2 5120x6144, 4608x6144, 6144x4096, 12288x6144, 100032x6144 Shapes were mined from 11 vLLM serve logs at TP8; M is a token count and does not scale with tensor parallelism, so the TP4 and TP2 rows reuse the same M values with N and K derived from the architecture. The TP8 derivations reproduce the six families seen in the logs. Note 4 kv heads and 4 index heads are replicated rather than split at TP8. Not measured end to end.
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
One tuned table,
aiter/configs/model_configs/qwen3_8_2p4t_a95b_bf16_tuned_gemm.csv, with 26 rows covering five of the bf16 GEMM families Qwen3.8-2.4T-A95B executes that AITER has no tuned entry for. Tuned on gfx950, cu_num=256 (MI355X), TP8.Learned from an earlier PR #5183, no row uses hipBLASLt or opus. #5183 added 75 rows for the same model, of which 63 were hipBLASLt. Review asked for hipBLASLt to be dropped because its solution indices are library-build-specific.
out_projin_proj_qkvz, sharded TP8in_proj_ba, sharded TP8lm_head, vocab 248320 sharded TP8The matching
qwen3_8_2p4t_a95b_bf16_untuned_gemm.csvshape list is included so the table can be re-tuned without reconstructing the shapes by hand. It lists all 81 swept shapes across seven familiesWhy these backends are safe to check in
flydslkernelNameasmkernelName+splitKtritonsolidx=0,kernelName=autohipblaslt(solidxinto hipBLASLt) andopus(kernelId=int(solidx)into opus) are both excluded.Every row beats the current fallback
Every row is required to beat, by at least 1.02x on the same build, so no shape can regress relative to today's behavior. Winners are the fastest candidate within
err_ratio <= 0.005, not the fastest overall. The tuner's default--errRatio 0.05which we felt was too loose. Shapes where nothing portable won are deliberately absent so the default path is kept.23 of the 26 rows are exactly
err_ratio0.0. The three that are not are the three split-k rows, at 0.0020, 0.0037 and 0.0048 — all inside the bound, but not bit-exact:Coverage
The lookup tries
gl in [None, 0, 1]: exact M, then the two padded buckets fromget_padded_m. Replaying that lookup against a production-shaped benchmark that logged 6,127 distinct (M, N, K) shapes (ISL/OSL of 8k/1k, 60k/1k and 128k/1k, all one key variant —torch.bfloat16in and out,bias=False,scaleAB=False,bpreshuffle=False):Tuning shapes were collected at
max_num_batched_tokens=16384andmax_num_seqs=256.End-to-end effect
Serving A/B under vLLM on
amd/Qwen3.8-2.4T-A95B-Quark-MXFP4, TP8 on MI355X, 8k input / 1k output, arms differing only by this table.Geometric mean output throughput +5.1%, geometric mean mean-TTFT −9.6%, geometric mean mean-TPOT −4.6%.