Skip to content

[Triton/Gluon] [Config] Add Qwen3.8-27B bf16 GEMM tunings for gfx950 - #6156

Merged
vgokhale merged 1 commit into
ROCm:mainfrom
eky-amd:qwen38-gemm-tuning
Oct 12, 2026
Merged

vgokhale merged 1 commit into
ROCm:mainfrom
eky-amd:qwen38-gemm-tuning

Conversation

@eky-amd

@eky-amd eky-amd commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Qwen3.8-27B BF16 on MI355x served has no bf16 GEMM rows in aiter/configs, so serving with vLLM logs not found tuned config ... using torch for every projection and falls back to hipBLASLt's heuristic.

The affected shapes (bf16 in/out, no bias, scaleAB=0, bpreshuffle=0, gfx950 / cu_num 256):

projection N × K
in_proj_qkvz 16384 × 5120
in_proj_ba 96 × 5120
in_proj_qkvz + in_proj_ba fused (ATOM layout) 16480 × 5120
out_proj / o_proj 5120 × 6144
qkv_proj 14336 × 5120
gate_up_proj 34816 × 5120
down_proj 5120 × 17408

Technical Details

Config changes:

  • aiter/configs/model_configs/qwen3_8_27b_bf16_tuned_gemm.csv: 56 rows (the seven tuned shapes at
    M = 16, 32, 48, 64, 1024, 2048, 4096, 8192).
  • aiter/configs/bf16_untuned_gemm.csv: 56 new shapes
  • aiter/ops/triton/configs/gfx950/triton/gemm/gemm_a16w16/: six new per-shape Triton configs
    (with the M_LEQ_16/32/64/1024/8192 buckets from a sweep with Triton tuning harness and every other bucket copied from DEFAULT.json).

Tuned on MI355X (gfx950, cu_num 256), ROCm 7.2.3 / hipBLASLt 1.2.70203, aiter v0.1.22.post1:

python3 csrc/gemm_a16w16/gemm_tuner.py \
  --input_file aiter/configs/bf16_untuned_gemm.csv \
  --tuned_file aiter/configs/model_configs/qwen3_8_27b_bf16_tuned_gemm.csv \
  --libtype asm,triton,skinny,torch --profile_file <profile.csv>

Test Plan

  1. vLLM serving (ROCm nightly, vLLM 0961bbae28, ISL=1024, OSL=64/1024, concurrency=64, num_prompts=640)
  2. python3 -m unittest op_tests.tuning_tests.test_config_shape_collision -v
  3. python3 -m unittest op_tests.tuning_tests.test_csv_validation -v

Test Result

Mean kernel times (over all GDN/attention layers in a step):

M projection N × K µs (before) kernel (after) µs (after) Δ
16 in_proj_qkvz 16384 × 5120 29.4 Triton 16x64x256 26.4 −10%
16 qkv_proj 14336 × 5120 27.5 Triton 16x64x256 25.5 −7%
16 gate_up_proj 34816 × 5120 77.2 Triton 16x32x256 64.9 −16%
16 out_proj / o_proj 5120 × 6144 19.8 Triton 16x64x256 split-K 3 15.6 −21%
16 down_proj 5120 × 17408 37.0 Triton 16x32x128 split-K 8 34.2 −8%
32 in_proj_qkvz 16384 × 5120 37.0 Triton 32x64x256 29.5 −20%
32 gate_up_proj 34816 × 5120 82.9 Triton 32x64x256 71.7 −14%
32 out_proj / o_proj 5120 × 6144 20.9 Triton 32x64x128 split-K 3 18.0 −14%
48 out_proj / o_proj 5120 × 6144 22.9 asm bf16gemm_fp32bf16_tn_48x64_splitk_clean 20.8 −9%
2048 qkv_proj 14336 × 5120 237.7 asm bf16gemm_bf16_tn_256x256 224.2 −6%
2048 gate_up_proj 34816 × 5120 571.2 asm bf16gemm_bf16_tn_256x256 547.4 −4%
4096 qkv_proj 14336 × 5120 453.0 asm bf16gemm_bf16_tn_256x256 432.4 −5%
4096 gate_up_proj 34816 × 5120 1026.7 asm bf16gemm_bf16_tn_256x256 1004.2 −2%

The remaining shapes record torch: no asm or Triton candidate beat it.

test_config_shape_collision: 20 tests OK. test_csv_validation: 18 tests OK.

Submission Checklist

@eky-amd
eky-amd requested a review from a team October 5, 2026 18:02
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
multigpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: GPT-OSS-120B, DeepSeek-R1-0528, Kimi-K2.5
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 6156 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

@github-actions github-actions Bot added the Config label Oct 5, 2026
@eky-amd
eky-amd force-pushed the qwen38-gemm-tuning branch 2 times, most recently from 04405f8 to 03f370a Compare October 5, 2026 20:13
@eky-amd
eky-amd marked this pull request as draft October 5, 2026 20:34
@eky-amd
eky-amd force-pushed the qwen38-gemm-tuning branch from 03f370a to bbdfd91 Compare October 8, 2026 18:43
@eky-amd
eky-amd marked this pull request as ready for review October 9, 2026 18:50
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Ethan Ky <[email protected]>
@eky-amd
eky-amd force-pushed the qwen38-gemm-tuning branch from bbdfd91 to 00ff8d4 Compare October 9, 2026 18:50
@github-actions github-actions Bot changed the title [Config] Add Qwen3.8-27B bf16 GEMM tunings for gfx950 [Triton/Gluon] [Config] Add Qwen3.8-27B bf16 GEMM tunings for gfx950 Oct 9, 2026
@zufayu
zufayu requested review from a team and Dewei-Wang-sh October 10, 2026 01:39
@Boss2002n
Boss2002n requested a balanced review from Copilot October 10, 2026 04:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Hardware-specific dispatch and performance behavior requires final gfx950 validation despite no static configuration errors found.

0 open findings

What changed in this PR

Adds gfx950 BF16 GEMM dispatch and Triton tuning data for Qwen3.8-27B projection shapes.

Changes:

  • Adds 56 Qwen3.8-27B tuned dispatch rows and corresponding tuning inputs.
  • Adds six shape-specific Triton GEMM configuration tables.
  • Covers decode and prefill batch sizes from M=16 through M=8192.
File Description
aiter/​configs/​bf16_untuned_gemm.csv Adds 56 target GEMM shapes.
aiter/​configs/​model_configs/​qwen3_8_27b_bf16_tuned_gemm.csv Adds backend selections and measurements.
.../​GEMM-A16W16-N=96-K=5120.json Tunes the narrow BA projection.
.../​GEMM-A16W16-N=5120-K=6144.json Tunes output projections.
.../​GEMM-A16W16-N=5120-K=17408.json Tunes the down projection.
.../​GEMM-A16W16-N=14336-K=5120.json Tunes the QKV projection.
.../​GEMM-A16W16-N=16384-K=5120.json Tunes the QKVZ projection.
.../​GEMM-A16W16-N=34816-K=5120.json Tunes the gate/up projection.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants