Skip to content

[Triton/Gluon] [Config] [gfx1201] Add gfx1201 GEMM A8W8 tuning configs - #6245

Merged
azaidy merged 3 commits into
ROCm:mainfrom
big-yellow-duck:gfx1201-gemm_w8a8-configs
Oct 13, 2026
Merged

azaidy merged 3 commits into
ROCm:mainfrom
big-yellow-duck:gfx1201-gemm_w8a8-configs

Conversation

@big-yellow-duck

@big-yellow-duck big-yellow-duck commented Oct 8, 2026 •

Copy link
Copy Markdown

Motivation

Add tuned gfx1201 GEMM A8W8 configurations for RedHatAI/gemma-4-12B-it-FP8-Dynamic at tensor parallel sizes 1 and 2 on AMD Radeon AI PRO R9700 GPUs.

Across all 176 explicit M/N/K cases covered by this PR, the submitted configurations achieve a 1.61× geometric-mean GEMM speedup over AITER's default untuned configuration.

Technical Details

Add 11 shape-specific JSON files under aiter/ops/triton/configs/gfx1201/triton/gemm/gemm_a8w8/, covering the model's QKV, attention output, fused gate/up, and down projections. Shapes were derived from all 48 decoder layers, including the replicated global KV head at TP2.

Projection TP1 (N, K) TP2 (N, K)
Sliding QKV (8192, 3840) (4096, 3840)
Global QKV (9216, 3840) (5120, 3840)
Sliding output (3840, 4096) (3840, 2048)
Global output (3840, 8192) (3840, 4096)
Fused gate/up (30720, 3840) (15360, 3840)
Down (3840, 15360) (3840, 7680)

Each file defines 16 M_BOUNDS / M_LEQ_* configurations for M=1–32768 in powers of two, plus an any fallback. The shared (3840, 4096) shape gives 11 unique N/K pairs and 176 explicit cases. Every submitted configuration matches its stored tuning winner.

Test Plan

  • Run AITER's existing FP8 tests in op_tests/triton_tests/gemm/basic/test_gemm_a8w8.py on gfx1201.
  • Reuse its test_gemm_fp8("fp8e4m3", M, N, K, "triton") correctness test for every submitted explicit case, and assert config lookup selects the submitted configuration.
  • Compare the same AITER gemm_a8w8 operation using the default DEFAULT.json configuration versus the tuning winner, with identical inputs and BF16 output within each pair.

Test Result

Correctness validation on ROCm 10.0.0, PyTorch 2.13.0, and Triton 3.8.0:

  • Existing AITER FP8 tests: 26 passed, 52 Gluon cases skipped because they require gfx950.
  • Submitted Gemma configurations: 176 passed, including config selection and full-output comparison against AITER's FP32 reference calculation with BF16 output and bias, using the existing tolerances (atol=0.02, rtol=0.01).
  • All 37 tuning winners retained from the previous runtime also passed full-output numerical revalidation on ROCm 10.

Tuning performance against default untuned AITER:

M range Unique cases Tuned / default AITER speedup
1–32 66 1.16×
64–512 44 1.76×
1024–32768 66 2.11×
All 176 1.61×

Speedup is default latency / tuned latency, aggregated as an unweighted geometric mean over unique cases. The shared TP1/TP2 shape is counted once. Tuned latency was lower in 176/176 measured cases, with individual speedups of 1.0007×–2.3311×.

Each case uses CUDA graph timing with hot operands, five randomized interleaved comparison rounds, and the median latency for each configuration (rep=10 ms per round). Measurements cover GEMM and scaling; input quantization, attention, and tensor-parallel communication are excluded.

The table combines 139 cases measured on ROCm 10 (PyTorch 2.13.0, Triton 3.8.0; 1.72× geometric-mean speedup) with 37 cases retained from ROCm 7.2.3 (1.26×). Default and tuned timings for each case use the same runtime. The retained winners were revalidated for correctness on ROCm 10, but their default/tuned performance comparison was not rerun there.

Submission Checklist

@github-actions

github-actions Bot commented Oct 8, 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 6245 --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.

@big-yellow-duck
big-yellow-duck marked this pull request as ready for review October 10, 2026 17:04
@big-yellow-duck
big-yellow-duck requested a review from a team October 10, 2026 17:04
@github-actions github-actions Bot changed the title [TRITON][gfx1201] Add gfx1201 GEMM A8W8 tuning configs [Triton/Gluon] [Config] [gfx1201] Add gfx1201 GEMM A8W8 tuning configs Oct 10, 2026
@big-yellow-duck

big-yellow-duck commented Oct 11, 2026 •

Copy link
Copy Markdown
Author

the performance numbers that shows improvements at vllm's side from an end2end serving perspective. vllm-project/vllm#60672.

@zufayu
zufayu requested review from a team and azaidy October 12, 2026 01:27

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 configurations are structurally consistent, but their hardware-specific correctness and performance require final gfx1201 validation.

0 open findings

What changed in this PR

Adds gfx1201 Triton FP8 GEMM tuning for Gemma-4 12B TP1/TP2 projection shapes.

Changes:

  • Adds 11 shape-specific A8W8 configurations.
  • Tunes 16 M bounds plus fallback per shape.
  • Includes split-K configurations for selected workloads.
File Description
GEMM-A8W8-N=9216-K=3840.json Global QKV TP1 tuning.
GEMM-A8W8-N=8192-K=3840.json Sliding QKV TP1 tuning.
GEMM-A8W8-N=5120-K=3840.json Global QKV TP2 tuning.
GEMM-A8W8-N=4096-K=3840.json Sliding QKV TP2 tuning.
GEMM-A8W8-N=3840-K=8192.json Global output TP1 tuning.
GEMM-A8W8-N=3840-K=7680.json Down projection TP2 tuning.
GEMM-A8W8-N=3840-K=4096.json Shared output tuning.
GEMM-A8W8-N=3840-K=2048.json Sliding output TP2 tuning.
GEMM-A8W8-N=3840-K=15360.json Down projection TP1 tuning.
GEMM-A8W8-N=30720-K=3840.json Fused gate/up TP1 tuning.
GEMM-A8W8-N=15360-K=3840.json Fused gate/up TP2 tuning.

🧠 Review effort: Balanced


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

@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!

@azaidy
azaidy merged commit a0c1f7a into ROCm:main Oct 13, 2026
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