Skip to content

[Triton/Gluon] [Config] Add gfx950 preshuffled AFP4WFP4 GEMM configs for DeepSeek MXFP4 TP8 dense shapes - #6683

Closed
afriedri-amd wants to merge 1 commit into
ROCm:mainfrom
afriedri-amd:triton/gfx950-afp4wfp4-preshuffled-deepseek-tp8
Closed

afriedri-amd wants to merge 1 commit into
ROCm:mainfrom
afriedri-amd:triton/gfx950-afp4wfp4-preshuffled-deepseek-tp8

Conversation

@afriedri-amd

Copy link
Copy Markdown
Contributor

Motivation

vLLM (vllm-project/vllm#61278) puts an MXFP4 linear on the preshuffled layout (ASM gemm_a4w4 for prefill, gemm_afp4wfp4_preshuffle for M ≤ 64) only when aiter has tuned configs for both. The DeepSeek-architecture MXFP4 checkpoints (DeepSeek-R1-0528, DeepSeek-V3.2, Kimi-K2.6) share the same dense TP8 shapes, which have tuned a4w4 rows but no preshuffled Triton configs, so they stay on the plain Triton GEMM. Forcing the preshuffled layout without these configs speeds up prefill but costs ~10% decode.

Technical Details

Adds configs for 4608×7168 (dense gate_up) and 7168×2304 (dense down) in configs/gfx950/triton/gemm/gemm_afp4wfp4_preshuffled/. No code changes.

  • Every bucket was tuned with a cold cache (HIP graph replay over ~512 MB of rotating weight copies), including split-K, keeping only configs whose output is bit-identical to gemm_a4w4. Each bucket's pick was re-timed against the plain Triton config for the same bucket.
  • 512×7168 (shared-expert gate_up) is left out on purpose: ASM is 1.7x slower than plain Triton for it at M 65–512 and only 2–9% faster at prefill sizes, so it is better off on the plain layout. 7168×256 has no tuned a4w4 rows.

Test Result

MI350X, vllm/vllm-openai-rocm:nightly (Triton 3.8.0+git669b31ac, aiter 0.1.24.post1). The preshuffle kernel there matches this branch's base.

Kernel

µs per call, including activation quant: this config / plain Triton / ASM gemm_a4w4 (geomean over the listed M). The output is bit-identical to gemm_a4w4 at every point.

Bucket (M) 4608×7168 7168×2304
M_LEQ_8 (1,4,8) 9.6 / 13.0 / 26.0 8.4 / 9.5 / 11.4
M_LEQ_16 (12,16) 9.6 / 13.5 / 25.7 9.0 / 10.3 / 11.6
M_LEQ_31 (17,24,31) 11.3 / 14.7 / 25.6 9.6 / 11.4 / 11.7
M_LEQ_32 (32) 10.6 / 14.9 / 25.7 9.8 / 11.7 / 11.6
M_LEQ_64 (48,64) 12.7 / 20.2 / 26.3 10.1 / 12.3 / 11.9
M_LEQ_128 (96,128) 16.4 / 45.4 / 26.8 10.4 / 23.7 / 12.1
M_LEQ_256 (192,256) 20.3 / 36.1 / 27.2 11.3 / 19.1 / 12.5
M_LEQ_512 (384,512) 26.0 / 82.6 / 31.5 13.7 / 42.3 / 15.4

End to end

vLLM + vllm-project/vllm#61278, TP8, --load-format dummy, random 1024/1024, 2 restarts per arm. Change vs. plain Triton:

Model conc TTFT TPOT E2EL tok/s
DeepSeek-R1-0528-MXFP4 1 −2.3% −0.5% −0.5% +0.5%
8 −0.8% +0.3% +0.2% −0.2%
32 +0.2% +0.2% +0.2% −0.2%
128 −0.0% −0.1% −0.1% +0.1%
Kimi-K2.6-MXFP4 1 −0.5% −0.0% −0.0% +0.0%
8 +0.8% +0.1% +0.1% −0.1%
32 −0.5% −0.6% −0.6% +0.6%
128 +0.4% −0.4% −0.3% +0.3%

With these configs vLLM moves 2 of the 4 dense shapes to the preshuffled layout; before, forcing that layout cost ~10% decode on these models. Prefill improves slightly, and decode is within ±0.6% at every concurrency. Including 512×7168 would have regressed Kimi c128 decode by ~3%.

GSM8K (DeepSeek-R1-0528-MXFP4, 5-shot, 250 problems, flexible-extract): 0.972 → 0.960 (±0.012).


AI assistance (Claude) was used for tuning, benchmarking and drafting. All changes reviewed.

…shapes

N=4608 K=7168 (dense gate_up) and N=7168 K=2304 (dense down), tuned per
bucket with a cold cache and checked bit-identical to gemm_a4w4.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UEcwArwDyBnrmqvBEoK583
Signed-off-by: Andy Friedrich <[email protected]>
@afriedri-amd
afriedri-amd requested a review from a team October 19, 2026 18:44
@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 6683 --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.

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

The reported GPU correctness and latency results need human confirmation because they were not independently validated on gfx950.

No open issues 🎉

What changed in this PR

Adds gfx950 tuning configs for two DeepSeek-family MXFP4 dense TP8 shapes, supporting preshuffled GEMM selection in vLLM without kernel code changes.

Changes:

  • Adds configs for gate_up (4608×7168) and down (7168×2304).
  • Provides eight M buckets and an any fallback for each shape.
File Description
aiter/​ops/​triton/​configs/​gfx950/​triton/​gemm/​gemm_afp4wfp4_preshuffled/​GEMM-AFP4WFP4_PRESHUFFLED-N=7168-K=2304.json Adds dense down tuning configs.
aiter/​ops/​triton/​configs/​gfx950/​triton/​gemm/​gemm_afp4wfp4_preshuffled/​GEMM-AFP4WFP4_PRESHUFFLED-N=4608-K=7168.json Adds dense gate_up tuning configs.

Review effort: Balanced

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