Skip to content

[Triton/Gluon] [Config] Add gemm_a8w8 Triton config for gfx1101 - #5960

Merged
azaidy merged 2 commits into
ROCm:mainfrom
Ragua1:gfx1101-gemm-a8w8-config
Oct 13, 2026
Merged

azaidy merged 2 commits into
ROCm:mainfrom
Ragua1:gfx1101-gemm-a8w8-config

Conversation

@Ragua1

@Ragua1 Ragua1 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

gemm_a8w8 cannot run on gfx1101 (RDNA3, RX 7800 XT): configs/gfx1101/triton/gemm/gemm_a8w8/DEFAULT.json does not exist, so get_gemm_config raises AssertionError: Required config file doesn't exist (aiter/ops/triton/utils/gemm_config_utils.py:64-67). This PR adds that file, tuned on the card. Data only; no kernel, loader or test code is changed.

Technical Details

One new file, aiter/ops/triton/configs/gfx1101/triton/gemm/gemm_a8w8/DEFAULT.json, in the nested layout, with the same keys per entry as gfx1151's table. Every entry is tuned on gfx1101, and the bins form an M_LEQ_* ladder that ends in any:

bin tuned on
M_LEQ_64, M_LEQ_128 M = 1, 16, 32, 64, 65, 77, 80, 96, 112, 128 at N × K = 1280 × 2048 and 10240 × 8192
M_LEQ_512 M = 256 and 512
M_LEQ_1024 M = 1024
any M = 4096 and 4608

The small-M bins are needed because the loader walks M_LEQ_* upward (gemm_config_utils.py:99-104): without them, M ≤ 128 is served the M_LEQ_512 entry (BLOCK_SIZE_M 128). That entry was slower on 29 of 31 small-M shapes, by 1.08× to 3.29×, and faster on two with M = 128 and N ≥ 3072. Against gfx1151's any entry, which the first version of this PR carried in M_LEQ_128, the small-M bins are faster on 26 of 31 small-M shapes and slower on 5 with M ≤ 64, by up to 1.38× with a warm cache. Both comparisons are GPU time over 10 fresh processes, as described below.

For gfx1100, #4778 proposes an A8W8 table as configs/gemm/gfx1100-GEMM-A8W8.json.

Test Plan

Correctness uses the body of test_gemm_int8 (op_tests/triton_tests/gemm/basic/test_gemm_a8w8.py) with impl="triton", layout TN, bf16 and fp16 output: upstream's inputs, run_torch reference and assert_close(atol=0.03, rtol=1e-2) (line 266). Shapes:

  • get_x_vals() and the 14 shapes of the timing table below;
  • 32 small-M shapes: M = 1 to 128 at N × K = 1280 × 2048 and 10240 × 8192, and M = 16, 64, 96, 128 at N × K = 1280 × 1280, 9216 × 3072 and 3072 × 12288;
  • 7 stress shapes for any: 8192 × 8192 × 8192, 16384 × 16384 × 8192, 32768 × 8192 × 16384, 65536 × 4096 × 4096, and three whose N and K no BLOCK_SIZE divides: 1025 × 1000 × 1000, 3001 × 4097 × 1031 and 5000 × 129 × 72, where K = 72 is below every BLOCK_SIZE_K.

pytest cannot run on this Windows host, so the test module was loaded with its aiter.ops.shuffle import stubbed, which is used only by the gfx950 preshuffle path and needs the CK build, and the body was called directly. The table was served through get_gemm_config, and the served entry was checked for every shape.

Test Result

132/132 correctness rows (66 shapes, bf16 and fp16) pass under this file, with no launch failure and no out-of-memory.

Timing through the loader, against gfx1151's table copied to gfx1101 (main has no gfx1101 table to compare with), GPU time only. Ten fresh processes, ten rounds each, arm order rotated from round to round. ratio is gfx1151-table time over this PR's time, taken from each process's median; the table gives min, median and max over the processes after dropping the best and the worst. vs torch is the median over processes of torch bf16 F.linear time over this PR's time.

M × N × K bin ratio min ratio median ratio max vs torch
4096 × 9216 × 3072 any 1.36 1.38 1.38 1.26
4096 × 12288 × 3072 any 1.37 1.37 1.37 1.00
4096 × 3072 × 12288 any 1.36 1.36 1.36 1.08
4608 × 21504 × 3072 any 1.39 1.39 1.39 1.01
4608 × 3072 × 15360 any 1.37 1.37 1.37 1.01
4096 × 10240 × 8192 any 1.39 1.39 1.39 1.04
4096 × 5120 × 640 any 1.36 1.38 1.40 0.96
4096 × 640 × 640 any 1.30 1.30 1.31 1.19
1024 × 10240 × 1280 M_LEQ_1024 1.26 1.27 1.28 0.95
1024 × 1280 × 5120 M_LEQ_1024 1.21 1.21 1.21 0.95
1024 × 1280 × 1280 M_LEQ_1024 1.20 1.21 1.21 1.01
512 × 9216 × 3072 M_LEQ_512 1.30 1.30 1.30 1.00
256 × 10240 × 8192 M_LEQ_512 1.26 1.26 1.26 1.21
77 × 1280 × 2048 M_LEQ_128 1.09 1.09 1.10 1.78

Every row has a minimum above 1.00 and a median − 1 above half the min–max range. A control with a flushed cache (256 MiB read before a one-call window, five further processes) keeps every win over gfx1151's table; 77 × 1280 × 2048 is below the timing floor with one call. Against torch bf16 the int8 kernel is 0.95–1.78× (median over processes); torch is ahead on four rows (0.95–1.00×) with a warm cache, and on two with a flushed cache. No claim over bf16 is made.

The first version of this description timed one call between two events. That window also held about 0.15 ms of host time in the Python wrapper, which compressed the ratios on short kernels and put the torch column below 1.00 there. The numbers above replace it.

Stack: gfx1101, Windows 11 native ROCm, display driver 32.0.32015.2008, torch 2.15.0a0+rocm10.2.0a20260926, HIP 7.17.26384, triton 3.8.0, AITER dd23adad with the table under test; only this file differs from 93b26ac0. The loader, kernel and test are byte-identical between f32a197d and main at 4eecc650.

Measurement protocol
  • Each table is served through gemm_a8w8(..., config=None); every loader cache is cleared on a table switch, and the served entry is compared with the expected one.
  • Timing (measured 2026-10-10): CUDA events around a window of ten back-to-back calls, with a GPU-side spin (torch.cuda._sleep) queued before the window so the host finishes enqueuing before the GPU reaches it; this was checked for every window. Time per call is the window over ten. Hot cache, median per process and shape. Shared Usage at start 0.09 GiB.
  • Flushed control: a 256 MiB read before the window and one call per window; windows under 0.02 ms are not evaluated.
  • Correctness was run separately in one process under this exact file.
  • Tuning: the M_LEQ_512, M_LEQ_1024 and any entries come from a 288-candidate sweep over BLOCK_SIZE_M/N/K, GROUP_SIZE_M, num_warps and waves_per_eu on AITER 12620102 with torch 2.15.0a0+rocm10.1.0a20260909, screened on four shapes and verified on all 14. The small-M entries come from a sweep over the same parameters plus num_stages 1–2 and NUM_KSPLIT 1–16 on the 20 small-M shapes at 1280 × 2048 and 10240 × 8192, followed by the fresh-process timing above. For M > 1024 the entry is 64×128×128, GROUP_SIZE_M 1, 4 warps, waves_per_eu 2.

@Ragua1
Ragua1 requested a review from a team September 29, 2026 20:43
@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
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 5960 --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 Add gemm_a8w8 Triton config for gfx1101 [Triton/Gluon] [Config] Add gemm_a8w8 Triton config for gfx1101 Sep 29, 2026
@Ragua1

Ragua1 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor Author

@carlushuang, as offered, this adds the gfx1101 table for review. Measurements and the test method are in the description.

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.

Copilot review overview

🔵 Needs a closer look

The table is hardware-specific, and its reported correctness and performance need final review on gfx1101.

Review effort: Balanced
Findings: None

What changed in this PR

Adds a gfx1101 tuning table so the Triton gemm_a8w8 config loader can find a default configuration on that GPU.

Changes:

  • Adds configurations for four M-size bands, plus an any fallback.
  • Reuses the gfx1151 entry for the smallest band and fallback.
File Description
aiter/​ops/​triton/​configs/​gfx1101/​triton/​gemm/​gemm_a8w8/​DEFAULT.json Supplies gfx1101 A8W8 GEMM tuning entries.

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

@Ragua1
Ragua1 force-pushed the gfx1101-gemm-a8w8-config branch from 72d94ee to dd23ada Compare October 6, 2026 18:23

@lucas-santos-amd lucas-santos-amd 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.

See comments

Address review on ROCm#5960:
- Drop M_GEQ_1024 and move its entry to "any", so "any" is reachable
  and every M > 1024 is served the same entry as before.
- Replace the gfx1151 entries (M_LEQ_128 and "any") with entries tuned
  on gfx1101: M_LEQ_64 and M_LEQ_128.
- M_LEQ_512 and M_LEQ_1024 are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Martin Domanský <[email protected]>

@lucas-santos-amd lucas-santos-amd 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 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 7d95657 into ROCm:main Oct 13, 2026
azaidy pushed a commit that referenced this pull request Dec 1, 2026
…8216)

The gfx1101 entries from #5960 and #5961 were tuned with Triton 3.8 and
run slower with Triton 3.9. Five entries retuned with Triton 3.9 pass a
check on shapes the search did not use (10 fresh processes, decision
rule written before the run):

- gemm_a8w8/DEFAULT.json: M_LEQ_512, any
- gemm_a16w16 N=12288-K=3072: M_LEQ_4096
- gemm_a16w16 N=21504-K=3072: M_LEQ_8192
- gemm_a16w16 N=3072-K=12288: M_LEQ_4096

No other entry, file, kernel or loader changes.
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.

4 participants