Repository navigation
[Config] configs: add tuned configs for Qwen3.8-27B MXFP4 (gfx950) - #5350
Conversation
Add gfx950 a4w4 blockscale GEMM tables for amd/Qwen3.8-27B-Quark-AWQ-MXFP4 on the getPaddedM grid, with matching untuned shapes and no hipBLASLt rows. Signed-off-by: Vorapol Assavasangthong <Vorapol.Assavasangthong@amd.com>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
PR title tags & labels: |
…P8 (gfx950)
Adds the sharded a4w4 blockscale shapes for TP2, TP4 and TP8 to the two tables
introduced by the previous commit. AITER model_configs are keyed on
(gfx, cu_num, M, N, K) with no TP component, so all tensor-parallel degrees share
one file. The 156 TP1 rows are unchanged; this is a pure addition of 572 rows.
Both tables go from 156 to 728 rows: 28 distinct (N,K) x the same 26 canonical
getPaddedM buckets (16-aligned to 256 for gl=0, then powers of two to 16384).
No raw request lengths, no new M values, no hipBLASLt rows (this tuner has no
hipBLASLt candidate and emits no libtype column). All rows gfx950 / cu_num=256
with errRatio 0.0. Winners: 704 ASM f4gemm_*, 24 CK a4w4_blockscale_*.
Shapes are derived from the checkpoint's safetensors header rather than by hand:
only linears carrying a sibling weight_scale are emitted, with the MXFP4-packed
K doubled back to logical K. That derivation also adds three TP1 GEMMs the
previous commit missed:
12288x5120 self_attn.q_proj -- gated attention emits q and a gate, so
N = 2 x 6144. Confirmed by the un-quantized twin
mtp.layers.N.self_attn.q_proj [12288, 5120].
10240x5120 linear_attn.in_proj_qkv -- GDN fused qkv (2048 q + 2048 k + 6144 v).
14336x5120 fused QKVParallelLinear (12288 + 1024 + 1024).
6144x5120 remains valid: it is linear_attn.in_proj_z at TP1 and self_attn.q_proj
at TP2. Nothing previously committed is corrected or removed.
k_proj, v_proj and the fused qkv are omitted at TP8 because num_key_value_heads=4
does not divide by 8; the 48 GDN layers shard cleanly at every TP, so TP8 still
contributes 7 shapes.
The six TP1 shapes already committed were independently re-tuned on the same node
as a reproducibility check: 141/156 selected the identical winning kernel, and the
15 that differ are near-ties (latency delta min -1.85%, max +3.54%, mean +0.80%).
Those re-tuned rows are not included; the original TP1 rows are kept as committed.
Tuned on MI355X (gfx950, 256 CU), ROCm 7.2.0, with
csrc/ck_gemm_a4w4_blockscale/gemm_a4w4_blockscale_tune.py.
TP8 linear_attn k-out (N=5120, K=256) was absent from the shared tables. Add all 26 getPaddedM buckets. No hipBLASLt rows; errRatio 0.0. Signed-off-by: Vorapol Assavasangthong <Vorapol.Assavasangthong@amd.com>
|
Checked this table against the two GEMM-config review items from #4554 that apply here (BF16 hipBLASLt count and raw-M BF16 rows do not apply; this PR is A4W4-only). 1. hipBLASLt exclusion — pass. The a4w4 tuner has no hipBLASLt candidate and these files have no 2. Runtime padded-M grid, matching untuned CSV — pass.
Not in scope from that review: BF16 tuned CSV (this model ships A4W4 only) and the 6,977/7,212 non-canonical A4W4 count (that was the other ticket’s table). |
d5bb978 to
d8d4f77
Compare
Add missing GEMM (N,K) and M buckets from TP2/TP4 coverage, and keep the lowest-us kernel on overlapping keys. Co-authored-by: Abraham Zewoudie <Abraham.Zewoudie@amd.com> Co-authored-by: Bipradip Chowdhury <Bipradip.Chowdhury@amd.com>
ff802aa to
b7fcc86
Compare
Runtime merge only loads *tuned* model_configs files.
…obal table Remove overlapping (5120,5120) keys so model_configs merge stays unique.
Motivation
Add gfx950 tuning coverage for
amd/Qwen3.8-27B-Quark-AWQ-MXFP4at TP1/TP2/TP4/TP8 on MI355X.The model is dense hybrid GDN (Qwen3.5-style), not MoE, so this PR ships A4W4 blockscale GEMM tables only. No fused-MoE CSV. No BF16 hipBLASLt GEMM rows (same exclusion as #3113, #3974, #4352, and the later #4554 follow-up).
Added tuning data
qwen38_27b_a4w4_blockscale_tuned_gemm.csv: 907 A4W4 blockscale GEMM rows, all forgfx950/ 256 CUs. Overlapping(5120,5120)keys already in the globala4w4_blockscale_tuned_gemm.csvwere omitted so merge stays unique.(N,K)across decode/prefill M buckets.This update adds missing TP-sharded GEMM coverage that was not in the previous table:
(N,K):4096x5120,8192x5120,16384x5120288–480on those TP-sharded shapes(gfx, cu_num, M, N, K)keys, keep the lowest-uskernelThe earlier TP8 GDN
linear_attnk-out GEMM(N=5120, K=256)rows remain.k_proj/v_proj/ fused QKV stay omitted at TP8 becausenum_key_value_heads=4does not divide by 8.No raw request lengths (for example M=6/24). No hipBLASLt rows.
Data validation
errRatiovalues are 0.0 — passed;libtype/kernel rows (898 ASMf4gemm_*, 24 CKa4w4_blockscale_*) — passed;End-to-end integration status
The previous SGLang TP1 uplift claims are withdrawn pending a corrected benchmark. They did not exercise this CSV:
aiter.ops.triton.gemm_afp4wfp4.aiter.ops.gemm_op_a4w4.gemm_a4w4dispatcher.gemm_op_a4w4.get_GEMM_configis disabled.GEMM-AFP4WFP4JSON(N,K)pairs matches this PR's 29 pairs; both sweep sides therefore used the same generic Triton configurations.Accordingly, the measured +0.06% mean / +0.05% geometric-mean output-throughput difference is only a same-path noise check, not evidence for or against this tuning table. A replacement e2e result using a verified CSV-consuming call path is in progress.
Notes
N/K1152/4304 is omitted: 4304 is not 128-aligned for a4w4 blockscale.(5120,256)ASM256x256tiles GPU-fault on this node; those candidates were skipped. Winners are32x128ASM witherrRatio0.0.