Repository navigation
[Config] Add MI350P FP8 blockscale B-preshuffle GEMM tuning for Qwen38-27B-FP8 - #6939
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
|
Hi @yifehuan! May I ask you to review this PR please? Thank you in advance! |
There was a problem hiding this comment.
🟡 Changes recommended
The new ASM selections route supported FP16-output requests to a BF16-only backend.
2 open issues
What changed in this PR
Adds MI350P-specific tuning to AITER’s Qwen38-27B FP8 B-preshuffle GEMM configuration, targeting gfx950 GPUs with 128 compute units.
Changes:
- Adds 121 tuned shape entries using ASM, CK, and CKTile backends.
- Preserves the existing 119 MI355X entries.
- Records kernel selections, timing measurements, and accuracy metrics.
| File | Description |
|---|---|
aiter/configs/model_configs/a8w8_blockscale_bpreshuffle_tuned_gemm_qwen38_27b.csv |
Adds 128-CU MI350P tuning entries for Qwen38-27B GEMMs. |
Review effort: Balanced
8d5e164 to
717641b
Compare
717641b to
154d186
Compare
|
sry please rebase onto main to solve merge conflict, then it's ok to lgtm and merge |
154d186 to
287fd82
Compare
….8-27B a8w8_blockscale_bpreshuffle_tuned_gemm_qwen38_27b.csv had only gfx950 rows for 256 CUs (MI355X). On MI350P (gfx950, 128 CUs) no row matches, so every Qwen3.8-27B-FP8 GEMM uses the default B-preshuffle kernel. For M <= 16 the default kernel is slower than the plain blockscale GEMM (geomean 0.86x, down to 0.74x). Add 121 gfx950/128-CU rows, tuned over ck, cktile and asm with the shapes in a8w8_blockscale_bpreshuffle_untuned_gemm_qwen38_27b.csv (asm 51, ck 42, cktile 28). Four shapes are not added because the tuned kernel was not faster than the default kernel: M=24 N=16384 K=5120 and M=48/56/64 N=34816 K=5120. For all 125 shapes, measured with gemm_a8w8_blockscale_tune.py --run_config on MI350P: - vs default B-preshuffle: geomean 1.46x, total time 1.65x - vs plain blockscale GEMM: geomean 1.90x, total time 2.14x
287fd82 to
5038613
Compare
….8-27B (#6939) a8w8_blockscale_bpreshuffle_tuned_gemm_qwen38_27b.csv had only gfx950 rows for 256 CUs (MI355X). On MI350P (gfx950, 128 CUs) no row matches, so every Qwen3.8-27B-FP8 GEMM uses the default B-preshuffle kernel. For M <= 16 the default kernel is slower than the plain blockscale GEMM (geomean 0.86x, down to 0.74x). Add 121 gfx950/128-CU rows, tuned over ck, cktile and asm with the shapes in a8w8_blockscale_bpreshuffle_untuned_gemm_qwen38_27b.csv (asm 51, ck 42, cktile 28). Four shapes are not added because the tuned kernel was not faster than the default kernel: M=24 N=16384 K=5120 and M=48/56/64 N=34816 K=5120. For all 125 shapes, measured with gemm_a8w8_blockscale_tune.py --run_config on MI350P: - vs default B-preshuffle: geomean 1.46x, total time 1.65x - vs plain blockscale GEMM: geomean 1.90x, total time 2.14x
….8-27B (#6939) a8w8_blockscale_bpreshuffle_tuned_gemm_qwen38_27b.csv had only gfx950 rows for 256 CUs (MI355X). On MI350P (gfx950, 128 CUs) no row matches, so every Qwen3.8-27B-FP8 GEMM uses the default B-preshuffle kernel. For M <= 16 the default kernel is slower than the plain blockscale GEMM (geomean 0.86x, down to 0.74x). Add 121 gfx950/128-CU rows, tuned over ck, cktile and asm with the shapes in a8w8_blockscale_bpreshuffle_untuned_gemm_qwen38_27b.csv (asm 51, ck 42, cktile 28). Four shapes are not added because the tuned kernel was not faster than the default kernel: M=24 N=16384 K=5120 and M=48/56/64 N=34816 K=5120. For all 125 shapes, measured with gemm_a8w8_blockscale_tune.py --run_config on MI350P: - vs default B-preshuffle: geomean 1.46x, total time 1.65x - vs plain blockscale GEMM: geomean 1.90x, total time 2.14x


Motivation
aiter/configs/model_configs/a8w8_blockscale_bpreshuffle_tuned_gemm_qwen38_27b.csvhas gfx950 rows only for 256 CUs (MI355X). On MI350P (gfx950, 128 CUs) no row matches. The PR adds tuned bpreshuffle blockwise FP8 kernels for Qwen3.8-27B-FP8 for MI350P TP=1.Technical Details
gfx950/cu_num=128rows toa8w8_blockscale_bpreshuffle_tuned_gemm_qwen38_27b.csv. The 119 MI355X rows do not change.a8w8_blockscale_bpreshuffle_untuned_gemm_qwen38_27b.csv: 5 (N, K) pairs, each with 25 values of M from 1 to 16384.ck,cktileandasmbackends, and the fastest kernel was kept. Winners: asm 51, ck 42, cktile 28.errRatio0.0025).Test Result
Time per GEMM call on MI350P, measured with
gemm_a8w8_blockscale_tune.py --run_config. Each speedup is shown as "geomean over shapes / ratio of total time". Total time is the sum over the shapes in the row.gemm_a8w8_blockscalewith default kernels.gemm_a8w8_blockscale_bpreshufflebefore this PR (no 128-CU rows in the tuned config).By (N, K)
By M
Test environment
How to reproduce
Run inside the container, from the AITER root:
Tuning (one backend per run):
Submission Checklist