Skip to content

[Triton/Gluon] [Config] gfx950 a16w16 N=2880 K=4096: retune M_LEQ_4 to avoid Triton 3.8 VGPR spill (gpt-oss-20b o_proj decode) - #6680

Merged
azaidy merged 1 commit into
ROCm:mainfrom
afriedri-amd:gfx950-a16w16-gptoss-oproj-mleq4
Oct 20, 2026
Merged

azaidy merged 1 commit into
ROCm:mainfrom
afriedri-amd:gfx950-a16w16-gptoss-oproj-mleq4

Conversation

@afriedri-amd

Copy link
Copy Markdown
Contributor

Title

[Triton] [Config] gfx950 a16w16 N=2880 K=4096: retune M_LEQ_4 to avoid Triton 3.8 VGPR spill (gpt-oss-20b o_proj decode)

Purpose

configs/gfx950/triton/gemm/gemm_a16w16/GEMM-A16W16-N=2880-K=4096.json is the gpt-oss-20b TP1 o_proj shape. Its M_LEQ_4 entry (BM16 BN16 BK512, num_warps=8, num_stages=2, waves_per_eu=8) regressed 2.3x going from Triton 3.7.1 to Triton 3.8.0:

  • Under Triton 3.8.0 this config compiles to 67,520 B of LDS (3.7.1: 32,768 B) and 64 VGPR + 32 AGPR.
  • With the waves_per_eu=8 register cap that spills 20 VGPRs (84 B scratch). Triton 3.7.1 builds the same config in 60 VGPRs with no spill.

That one entry causes a −7% conc 1 serving regression for gpt-oss-20b on MI355X/MI350X between vllm/vllm-openai-rocm:v0.30.0 (Triton 3.7.1) and v0.31.0 (Triton 3.8.0).

This PR sets M_LEQ_4 to num_warps=4, waves_per_eu=0. Every other field and bucket is unchanged.

Test results

Kernel, µs per call at M=1–4:

M_LEQ_4 config Triton 3.7.1 Triton 3.8.0
current: nw8 ns2 wpe8 8.8–8.9 20.6–20.7
nw8 ns2 wpe0 9.1–9.2 8.1–8.2
this PR: nw4 ns2 wpe0 7.5–7.6 7.0
nw2 ns2 wpe0 7.8 6.7–6.8

Compiled kernel for the current entry:

Triton LDS (B) VGPR AGPR VGPR spill scratch (B)
3.7.1 32,768 60 0 0 0
3.8.0 67,520 64 32 20 84

Serving, gpt-oss-20b TP1, MI350X (output tok/s):

Arm conc 1 conc 1 TPOT (ms) conc 32 conc 128
v0.30.0 (Triton 3.7.1) 402.4 2.47 7384 17134
v0.31.0 (Triton 3.8.0) 374.5 2.65 7784 18552
v0.31.0 + this PR 421.7 2.36 7770 18207

Numerics: max abs error vs an fp32 reference is 0.0152–0.0156 at M=1–4 with this PR on both Tritons, the same as the current entry (bf16 rounding).

Who else reads this entry

  • Lookup: get_gemm_config loads GEMM-A16W16-N={N}-K={K}.json only on an exact N and K match, and otherwise falls back to DEFAULT.json. Only the M_LEQ_4 bucket changes, so only calls with M ≤ 4, N=2880 and K=4096 on gfx950 are affected. The Gluon backend reads its own config directory and is untouched.
  • Kernels: two Triton kernels read this JSON:
    • gemm_a16w16 (measured above);
    • fused_gemm_a16w16_quant_x. It is not called by vLLM 0.31 or the current vLLM nightly. On main at N=2880, K=4096 it is also faster with this PR: 21.97–22.33 → 6.58–7.92 µs at M=1–4, with the same max error.
  • Models: of 71 model configs checked (local HF caches plus downloaded config.json for common open families), only gpt-oss has any dimension equal to 2880×TP for TP 1/2/4/8. So this shape is the TP1 o_proj of gpt-oss-20b, gpt-oss-120b and amd/gpt-oss-120b-w-mxfp4-a-fp8. gpt-oss-120b TP1 uses the identical shape, so it gets the same kernel speedup. That was not measured end to end.

AI assistance (Claude) was used to triage, measure and draft this change. All changes reviewed.

…d Triton 3.8 VGPR spill

The M_LEQ_4 entry (BM16 BN16 BK512, num_warps=8, num_stages=2,
waves_per_eu=8) is the gpt-oss TP1 o_proj decode shape. Under Triton
3.8.0 it compiles with 2x the LDS and spills 20 VGPRs because of the
waves_per_eu=8 register cap, running 20.6-21.0 us instead of 8.9 us
on Triton 3.7.1. That costs gpt-oss-20b about 7% at conc 1 between the
vLLM v0.30.0 and v0.31.0 ROCm images.

Use num_warps=4, waves_per_eu=0: 7.0-8.0 us on Triton 3.8.0 and
7.6-8.3 us on 3.7.1 at M=1-4 (aiter main, MI350X), no spill, same max
error. M>4 buckets are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012XYVab4mQWCMPp2QoPkThy
@github-actions

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
ci:windows Windows JIT op smoke test on the gfx1201 ROCm runner
ci:multi-gpu 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: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
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 6680 --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.

@afriedri-amd
afriedri-amd marked this pull request as ready for review October 19, 2026 17:20
@afriedri-amd
afriedri-amd requested a review from a team October 19, 2026 17:20
@github-actions github-actions Bot changed the title [Triton] [Config] gfx950 a16w16 N=2880 K=4096: retune M_LEQ_4 to avoid Triton 3.8 VGPR spill (gpt-oss-20b o_proj decode) [Triton/Gluon] [Config] gfx950 a16w16 N=2880 K=4096: retune M_LEQ_4 to avoid Triton 3.8 VGPR spill (gpt-oss-20b o_proj decode) Oct 19, 2026
@Boss2002n
Boss2002n requested a balanced review from Copilot October 19, 2026 17:33

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

Human review must confirm the reported gfx950 correctness and performance results for both consuming kernels.

No open issues 🎉

What changed in this PR

Retunes the gfx950 Triton A16W16 GEMM configuration to address the reported Triton 3.8 register-spill regression during gpt-oss decode.

Changes:

  • Sets num_warps=4 and waves_per_eu=0 for M_LEQ_4 at N=2880, K=4096.
  • Leaves other fields, buckets, and the Gluon backend unchanged.
File Description
aiter/​ops/​triton/​configs/​gfx950/​triton/​gemm/​gemm_a16w16/​GEMM-A16W16-N=2880-K=4096.json Retunes two launch parameters for small-M GEMM.

Review effort: Balanced

@azaidy
azaidy self-requested a review October 19, 2026 22:00
@azaidy azaidy self-assigned this Oct 19, 2026

@azaidy azaidy 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.

LGTM!

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.

3 participants