Repository navigation
[Config] Re-tune 136 unparseable Qwen3.5-397B a8w8 bpreshuffle rows on gfx950 - #6393
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
… rows on gfx950 136 of the 190 FlyDSL rows in a8w8_bpreshuffle_tuned_gemm_qwen3_5_397b_a17b_mxfp4_attnfp8.csv, added in ROCm#4396, carry a five-token knob field (e.g. `..._B16_2x0x1x3x0_default`). The aiter tuner emits four tokens (use_async_copy x waves_per_eu x xcd_swizzle x lds_stage) and the runtime parser accepts at most four, so none of these rows parses. gemm_a8w8_bpreshuffle_flydsl() falls back to the CK default heuristic for them, and every one of these shapes has run untuned since the rows were added. Replace the 136 rows with the output of python csrc/ck_gemm_a8w8_bpreshuffle/gemm_a8w8_bpreshuffle_tune.py --libtype all on MI355X with flydsl 0.3.4.1. Shape keys are unchanged and no other row is touched. The tuner picked FlyDSL for 134 shapes (4 of them 8-wave) and CKTile for 2. Kernel-level, over the 136 shapes against the CK default they replace: 1.85x geomean under CUDA-graph replay and 1.67x eager, maximum relative error 2.0e-5 against an fp32 reference. Signed-off-by: jiaqiang-dot-liu <[email protected]>
94bdf72 to
9c064c6
Compare
|
LGTM |
Summary
136 of the 190 FlyDSL rows in
aiter/configs/model_configs/a8w8_bpreshuffle_tuned_gemm_qwen3_5_397b_a17b_mxfp4_attnfp8.csv(Qwen3.5-397B-A17B MXFP4-AttnFP8, gfx950) never take effect. This PR re-tunes those 136 shapes on MI355X. It changes only that CSV.Measured on MI355X against
main, the 136 shapes are 1.85x faster under CUDA-graph replay and 1.67x faster eagerly (geomean), with a maximum relative error of 2.0e-5 against the fp32 reference.The bug
The 136 rows, added in #4396, carry a five-token knob field (e.g.
..._B16_2x0x1x3x0_default). The aiter tuner emits four tokens (use_async_copy x waves_per_eu x xcd_swizzle x lds_stage) and the runtime parser accepts at most four, so none of these rows parses andgemm_a8w8_bpreshuffle_flydsl()falls back to the CK default heuristic:No other tuned table has a row for these
(gfx, cu_num, M, N, K)keys, so every one of these shapes has run untuned since #4396. The affected GEMMs are N ∈ {64, 4096, 8704, 10240}, K = 4096, M from 24 to 131072 (decode and prefill): the attention and GatedDeltaNet projections of Qwen3.5-397B at attention TP = 2.Change
The 136 rows are replaced with the output of
on MI355X with the pinned
flydsl==0.3.4.1. Shape keys are unchanged and no other row is touched. The tuner picked FlyDSL for 134 shapes (4 of themflydsl_bpreshuffle_8w_*) and CKTile for 2.Rewriting the five knob tokens into the four-token spelling was measured first and rejected. It is exact only for the 70 rows with
use_cshuffle_epilog == 0(the other 66 name a variant that does not exist in the current catalog), and 11 of the 136 shapes came out slower than the CK default (worst 0.69x, M=1664 N=8704). Re-tuning has no such regression and is faster overall.Performance (MI355X)
MI355X (gfx950, 256 CU), ROCm 7.2.0, torch 2.9.1, Triton 3.7.0,
flydsl==0.3.4.1.main=882ea79d. Each tree built its CK/CKTile runtime modules from its own tuned CSV (AITER_REBUILD=1).Harness:
aiter.gemm_a8w8_bpreshuffle(the public entry point, so dispatch is exactly what callers get) on per-token FP8 activations and per-channel FP8 weights shuffled withshuffle_weight(layout=(16, 16)), for all 136 shapes. Eager =triton.testing.do_bench(median, min of 3); graph =triton.testing.do_bench_cudagraph(min of 3), which hides host launch overhead.By N (geomean, graph / eager):
Selected shapes (µs,
main→ this PR):The four shapes that are slower under graph replay are all small and the gap is under 1 µs: M=192 N=4096 (8.6 → 9.3 µs, 0.93x), M=48 N=10240 (0.96x), M=48 N=8704 (0.96x), M=65536 N=64 (0.97x). All four are faster eagerly. They are kept as the tuner chose them, since the tuner's own timing (profiler, device time) ranked them first and the difference is within what its 101-iteration measurement can resolve.
Accuracy: against an fp32 reference of the dequantized inputs, the maximum relative error over all 136 shapes is 2.0e-5, with no element outside
atol = rtol = 1e-2.Validation
kernelNamein the shipped CSVs (1889 rows) parses with the runtime parser.model_configs/) has no duplicate(M, N, K, q_dtype_w, cu_num, gfx)key.