Skip to content

[Triton/Gluon] [Config] gfx1151: tune gemm_a8w8_preshuffled configs - #7270

Merged
azaidy merged 3 commits into
mainfrom
amd/dev/klin/triton-gfx1151-gemm-a8w8-preshuffled-config
Nov 23, 2026
Merged

azaidy merged 3 commits into
mainfrom
amd/dev/klin/triton-gfx1151-gemm-a8w8-preshuffled-config

Conversation

@klin-amd

@klin-amd klin-amd commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR replaces the single any config of gemm_a8w8_preshuffled on gfx1151 with per-M configs, and adds a specialized file for N=2112 K=7168. It changes no kernel code.

Motivation

On gfx1151 a single any config serves every M. A per-M search gives a higher measured int8 throughput at every M reported below.

Changes

  • aiter/ops/triton/configs/gfx1151/triton/gemm/gemm_a8w8_preshuffled/DEFAULT.json: nine M_LEQ_* buckets, M_LEQ_8 through M_LEQ_2048, plus any. Every bucket differs from the single any config of the base tree, so every gfx1151 shape changes selection.
  • aiter/ops/triton/configs/gfx1151/triton/gemm/gemm_a8w8_preshuffled/GEMM-A8W8_PRESHUFFLED-N=2112-K=7168.json: new file with the same ten keys. It replaces DEFAULT.json for that shape; it does not merge with it. Four buckets differ: M_LEQ_64, M_LEQ_128, M_LEQ_256 and M_LEQ_512.
  • gfx1151 has no fp8 WMMA. The config search used int8 only. No other architecture reads these files.

Performance (if applicable)

  • Hardware: Radeon 8060S (gfx1151). The inputs are int8 and the output is bf16.
  • Before is the base tree 0dd2716, the parent of this commit; After is this PR at ea778ab. the two trees differ only in the two config files.
  • The nine (N, K) shapes are 6144x4096 , 4096x4096 , 28672x4096 , 4096x14336 , 4608x3584 , 3584x3584 , 37888x3584 , 3584x18944 and 2112x7168.
  • Before and After are the geomean over those nine shapes, in milliseconds; lower is faster. Change is the geomean gain over the nine shapes, and Worst shape is the smallest gain among them.
M Before After Change Worst shape
1 0.2077 ms 0.1559 ms 1.33x 1.13x
8 0.2062 ms 0.1528 ms 1.35x 1.19x
16 0.2070 ms 0.1545 ms 1.34x 1.14x
32 0.2121 ms 0.1580 ms 1.34x 1.12x
64 0.2050 ms 0.1667 ms 1.23x 1.07x
128 0.2808 ms 0.2448 ms 1.15x 1.11x
256 0.5383 ms 0.4532 ms 1.19x 1.04x
512 1.0603 ms 0.8677 ms 1.22x 1.12x
1024 2.1104 ms 1.6818 ms 1.25x 1.18x
2048 4.2185 ms 3.3276 ms 1.27x 1.21x
4096 8.4953 ms 6.6582 ms 1.28x 1.21x

Over all 99 shape/M pairs the geomean gain is 1.27x.

Method: torch 2.13.0+rocm7.15.0a20260728, Triton 3.8.0. The weight rotates over at least 128 MiB of copies, so each call reads the weight from memory. Each trial runs 50 iterations, and each round takes the median of 7 trials. The eleven M values come from two benchmark sessions on the same machine and environment, with the same harness: M = 1, 16, 128, 1024 and 4096 in one, and M = 8, 32, 64, 256, 512 and 2048 in the other. Each session ran head, base, base, head, and each figure is the mean of that session's two rounds. Head and base for any one M therefore come from the same session, but the 99-pair figure pools the two sessions. Taken alone the sessions give 1.268x over 45 pairs and 1.265x over 54 pairs.

No pair is slower than the base. The first round of each session alone gives 1.27x overall, and the second round 1.26x. Round-to-round spread is larger on head (median 2.0%, maximum 29.2% at M=1, 3584x3584) than on base (median 0.8%, maximum 3.3%). The slowest head round against the fastest base round still leaves no pair slower than the base, at a minimum of 1.02x.

Testing

  • Unit tests added or updated
  • Performance benchmarks run
  • Tested on MI250X
  • Tested on MI300X

op_tests/triton_tests/gemm/basic/test_gemm_a8w8.py on gfx1151, both trees on the same machine and environment:

Tree Result
base 0dd2716 1465 passed, 380 skipped
this PR ea778ab 1465 passed, 380 skipped

The PR changes no test outcome. The 380 skips are the gluon cases, which need gfx950, and the preshuffle cases that the test skips on its own shape rules. Tested on gfx1151 (Radeon 8060S), which this PR targets; MI250X and MI300X read their own config directories and are unaffected. No unit test changed, because this PR adds no code path.

Documentation

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

The PR adds tuning data only. No API, behavior or guide text changes.

Dependencies

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

Breaking Changes

None.

PR Self-Review

Reviewed revision

ea778ab

Behavior and intent

One config serves all M values on gfx1151 today. The per-M configs give a higher measured int8 throughput at every M that this PR reports.

Validation and unverified scope

pytest op_tests/triton_tests/gemm/basic/test_gemm_a8w8.py gives 1465 passed, 380 skipped on this PR and on the base tree. The table above gives the int8 latency, and the eleven M values time all ten buckets of both files, so no bucket ships without a measurement.
Unverified: fp8 latency against the base; correctness of the N=2112 K=7168 file, because no pytest shape is 2112x7168; all shapes outside the nine listed above.

PR-specific question

Only gfx1151 reads these files, so other architectures keep their previous selection. The specialized file replaces DEFAULT.json for N=2112 K=7168. Every other gfx1151 (N, K) reads DEFAULT.json, and every bucket differs from the single any config of the base tree.

Changed op tests

None. This PR changes no file under op_tests/.

Replace the single 'any' config of gfx1151 with per-M configs from a
search on gfx1151 (Radeon 8060S), and add the N=2112 K=7168 specialized
file (as on gfx950). int8 W8A8; 1.24x faster than main (geomean over 99
shape/M pairs, no pair slower).

Co-Authored-By: Claude <[email protected]>
Signed-off-by: Lin, KuanTing <[email protected]>
@github-actions

github-actions Bot commented Nov 1, 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 7270 --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.

@aiter-bot

aiter-bot commented Nov 1, 2026 •

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision a0f3ea7862a3 · 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 — Reviewed revision must contain at least the first 7 characters of the current head SHA

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.

🟡 Changes recommended

The new N=2112, K=7168 configuration and automatic split-K bucket lack output correctness coverage, requiring gfx1151 int8/bf16 reference checks across M buckets, including M=257 and M=512, without a config override.

1 open issue
What changed in this PR

This PR tunes gfx1151 configurations for gemm_a8w8_preshuffled to improve int8 GEMM performance. It changes tuning data only; kernel code and public APIs stay unchanged.

Changes:

  • Replaces the single default config with nine M buckets and an any fallback.
  • Adds a specialized N=2112, K=7168 config with four shape-specific bucket overrides, including split-K for 256 < M ≤ 512.
File Description
aiter/​ops/​triton/​configs/​gfx1151/​triton/​gemm/​gemm_a8w8_preshuffled/​GEMM-A8W8_PRESHUFFLED-N=2112-K=7168.json Adds shape-specific tuning across ten M ranges.
aiter/​ops/​triton/​configs/​gfx1151/​triton/​gemm/​gemm_a8w8_preshuffled/​DEFAULT.json Introduces per-M defaults for gfx1151.

Review effort: Balanced

@menglcai-amd
menglcai-amd marked this pull request as ready for review November 5, 2026 00:37
@menglcai-amd
menglcai-amd requested a review from a team November 5, 2026 00:37
@github-actions github-actions Bot changed the title [Triton] gfx1151: tune gemm_a8w8_preshuffled configs (int8, 1.24x vs main) [Triton/Gluon] [Config] gfx1151: tune gemm_a8w8_preshuffled configs (int8, 1.24x vs main) Nov 5, 2026
@menglcai-amd menglcai-amd changed the title [Triton/Gluon] [Config] gfx1151: tune gemm_a8w8_preshuffled configs (int8, 1.24x vs main) [Triton/Gluon] [Config] gfx1151: tune gemm_a8w8_preshuffled configs Nov 5, 2026
@azaidy
azaidy self-requested a review November 5, 2026 14:10
@azaidy azaidy self-assigned this Nov 5, 2026
Copilot AI balanced review requested due to automatic review settings November 5, 2026 14:51

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 gfx1151 GEMM retune affects all M sizes and FP8 inputs, but target-GPU correctness and latency cannot be verified in this source-only review, and FP8 latency remains explicitly unverified.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@menglcai-amd

Copy link
Copy Markdown
Contributor

Hi @farlukas, since #6951 was merged, this PR has a conflict with main: its commit 06dd27b ("Removed unsupported arch configs") removed gfx1151/.../gemm_a8w8_preshuffled/DEFAULT.json, which this PR updates.

Would you mind sharing the reasoning behind treating gfx1151 and gfx1201 as unsupported? I want to make sure I understand the context before resolving the conflict, so this PR doesn't go against anything you intended.

For context: on gfx1151 with current main, gemm_a8w8_preshuffle now raises "Required config file doesn't exist", and with this PR's configs added, test_gemm_a8w8.py passes (1465 passed, 380 skipped).

If there's no blocking reason for gfx1151, I'll resolve the conflict by keeping this PR's DEFAULT.json; otherwise I'm happy to adjust this PR accordingly. Thanks!

@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 643393b into main Nov 23, 2026
64 checks passed
@azaidy
azaidy deleted the amd/dev/klin/triton-gfx1151-gemm-a8w8-preshuffled-config branch November 23, 2026 16:27
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