Skip to content

[Triton/Gluon] [Config] Tune gfx950 gemm_a8w8 for Llama 3.1 8B FP8 decode. - #7347

Merged
cagrikymk merged 2 commits into
mainfrom
jrosas-gfx950-gemm-a8w8-8b
Nov 3, 2026
Merged

cagrikymk merged 2 commits into
mainfrom
jrosas-gfx950-gemm-a8w8-8b

Conversation

@amd-jrosas

@amd-jrosas amd-jrosas commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add gfx950 Triton GEMM-A8W8 shape configs for the four Llama 3.1 8B FP8 decode GEMMs. Each file covers M=8, 16, 32, 64, 128, and 256. For those buckets, gemm_a8w8 loads the shape file instead of DEFAULT.json.

Motivation

These four shapes were using the family DEFAULT.json tile. On gfx950 that tile is slower than a shape-specific tile for gate+up, down, and output across these M values, and for QKV at M=8, 128, and 256. QKV at M=16, 32, and 64 already matched DEFAULT.json, so those three buckets are the same tile.

Changes

  • Add four files under aiter/ops/triton/configs/gfx950/triton/gemm/gemm_a8w8/, each with M=8, 16, 32, 64, 128, 256:
    • GEMM-A8W8-N=6144-K=4096.json (QKV)
    • GEMM-A8W8-N=4096-K=4096.json (output)
    • GEMM-A8W8-N=28672-K=4096.json (gate+up)
    • GEMM-A8W8-N=4096-K=14336.json (down)
  • Each file sets DEFAULT_FALLBACK and copies DEFAULT.json's any entry. M below 8 and M above 256 still use DEFAULT.json.
  • No kernel or Python change. get_gemm_config("GEMM-A8W8", M, N, K) already selects GEMM-A8W8-N=<N>-K=<K>.json.

Performance (if applicable)

gfx950. Llama 3.1 8B FP8 E4M3, per-tensor scales, one run. gemm_a8w8, Triton backend, timed against torch._scaled_mm (hipBLASLt). Triton default is the DEFAULT.json tile. Triton tuned is the tile in the new file. A ratio above 1 means that Triton is faster than hipBLASLt.

Tuned Triton is faster than hipBLASLt on every row except gate+up at M=128, which is even (0.995x). The default tile loses to hipBLASLt on the larger gate+up and down shapes, and on QKV and output at M=256.

GEMM M hipBLASLt (us) Triton default (us) Triton tuned (us) Default vs hipBLASLt Tuned vs hipBLASLt
QKV 8 8.531 7.102 6.955 1.201x 1.226x
QKV 16 8.851 7.378 7.332 1.200x 1.207x
QKV 32 9.887 8.094 8.076 1.221x 1.224x
QKV 64 11.476 9.609 9.597 1.194x 1.196x
QKV 128 13.926 12.759 12.214 1.091x 1.140x
QKV 256 16.173 18.563 15.114 0.871x 1.070x
Output 8 7.100 6.445 5.513 1.102x 1.288x
Output 16 7.196 6.695 5.797 1.075x 1.241x
Output 32 8.166 7.462 6.831 1.094x 1.196x
Output 64 9.067 8.796 8.428 1.031x 1.076x
Output 128 10.796 11.918 8.947 0.906x 1.207x
Output 256 13.224 17.712 11.738 0.747x 1.127x
Gate+up 8 23.252 25.302 21.312 0.919x 1.091x
Gate+up 16 26.824 22.935 21.720 1.170x 1.235x
Gate+up 32 25.310 27.734 22.469 0.913x 1.126x
Gate+up 64 27.405 32.994 25.614 0.831x 1.070x
Gate+up 128 30.110 47.976 30.254 0.628x 0.995x
Gate+up 256 41.900 68.406 38.399 0.613x 1.091x
Down 8 16.900 16.460 13.355 1.027x 1.265x
Down 16 15.282 20.205 14.125 0.756x 1.082x
Down 32 19.629 19.934 15.365 0.985x 1.277x
Down 64 21.905 23.457 18.545 0.934x 1.181x
Down 128 32.887 35.055 22.729 0.938x 1.447x
Down 256 34.225 53.547 30.699 0.639x 1.115x

Testing

  • Performance benchmarks run

No new unit test. This PR only adds JSON configs for an existing kernel. The sweep that produced the files ran on gfx950, so MI250X and MI300X were not used.

Documentation

  • Docstrings updated
  • User guide updated
  • Performance guide updated
  • No documentation change is needed, with the reason stated below

The loader already finds GEMM-A8W8-N=<N>-K=<K>.json next to DEFAULT.json. There is no new API.

Dependencies

  • No new third-party dependencies added
  • New dependencies are listed and justified below

Breaking Changes

None. Shapes other than these four N,K pairs still resolve to DEFAULT.json. For these four shapes, M below 8 and M above 256 still resolve to DEFAULT.json.

@amd-jrosas
amd-jrosas requested review from a team and a balanced review from Copilot November 2, 2026 18:57
@github-actions

github-actions Bot commented Nov 2, 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
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 7347 --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 changed the title [Triton] [Config] Tune gfx950 gemm_a8w8 for Llama 3.1 8B FP8 decode. [Triton/Gluon] [Config] Tune gfx950 gemm_a8w8 for Llama 3.1 8B FP8 decode. Nov 2, 2026
@aiter-bot

aiter-bot commented Nov 2, 2026 •

Copy link
Copy Markdown

NOT READY FOR HUMAN REVIEW

PR Self-Review

Revision abb9104c94eb · mode shadow

Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision.

Questions to answer in the PR description

  1. What behavior does this PR change, and why is the existing behavior insufficient?
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
  3. Which exact workload keys consume these configuration changes, and what evidence shows that unrelated shapes keep their previous selection?
  4. For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.

Edit the PR Self-Review section in the PR description. Include the current revision SHA; this comment refreshes automatically.

Missing or invalid answers

  • FAIL — missing ### Reviewed revision in the PR description
  • FAIL — missing ### Behavior and intent in the PR description
  • FAIL — missing ### Validation and unverified scope in the PR description
  • FAIL — missing ### PR-specific question in the PR description
  • FAIL — missing ### Changed op tests in the PR description
  • FAIL — Reviewed revision must contain at least the first 7 characters of the current head SHA
  • FAIL — Behavior and intent has no substantive answer
  • FAIL — Validation and unverified scope has no substantive answer
  • FAIL — PR-specific question has no substantive answer

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

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 gfx950 tile changes and four-way split-K down projection require GPU compilation, numerical-correctness, and base/head latency validation beyond the static checks performed.

No open issues 🎉

What changed in this PR

This PR adds gfx950 Triton GEMM-A8W8 configs for four Llama 3.1 8B FP8 decode GEMMs. The existing config loader selects these files without kernel or Python changes.

Changes:

  • Adds shape-specific tiles for QKV, output, gate+up, and down projections.
  • Sets DEFAULT_FALLBACK and copies the default any entry in each file.
  • Reports a combined 1.184× speedup for the four GEMMs at M=32.
File Description
aiter/​ops/​triton/​configs/​gfx950/​triton/​gemm/​gemm_a8w8/​GEMM-A8W8-N=6144-K=4096.json QKV configs with M bucket bounds of 8, 16, and 32.
aiter/​ops/​triton/​configs/​gfx950/​triton/​gemm/​gemm_a8w8/​GEMM-A8W8-N=4096-K=4096.json Output projection configs with M bucket bounds through 32.
aiter/​ops/​triton/​configs/​gfx950/​triton/​gemm/​gemm_a8w8/​GEMM-A8W8-N=4096-K=14336.json Down projection configs through M=64, using four-way split-K.
aiter/​ops/​triton/​configs/​gfx950/​triton/​gemm/​gemm_a8w8/​GEMM-A8W8-N=28672-K=4096.json Gate+up projection configs with six M bucket bounds through 256.

Review effort: Balanced

@cagrikymk
cagrikymk self-requested a review November 2, 2026 19:13
Copilot AI balanced review requested due to automatic review settings November 2, 2026 22:53

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.

🟡 Changes recommended

Added tuning buckets override defaults beyond the stated M ranges for down, QKV, and output GEMMs; remove those buckets or benchmark the extended ranges and update the scope.

1 open issue

Review effort: Balanced

@zufayu
zufayu requested review from a team and Boss2002n November 3, 2026 01:14
@cagrikymk

Copy link
Copy Markdown
Contributor

@amd-jrosas LGTM!

@cagrikymk
cagrikymk merged commit e8e09b6 into main Nov 3, 2026
@cagrikymk
cagrikymk deleted the jrosas-gfx950-gemm-a8w8-8b branch November 3, 2026 03:03
shantipriya-amd pushed a commit to shantipriya-amd/aiter that referenced this pull request Nov 18, 2026
…code. (ROCm#7347)

* [Triton] [Config] Tune gfx950 gemm_a8w8 for Llama 3.1 8B FP8 decode.

* Updated configs up to  M=256
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.

6 participants