Skip to content

[Triton/Gluon] Seed gfx1150 (RDNA3.5) configs from gfx1151 - #5997

Merged
azaidy merged 3 commits into
ROCm:mainfrom
Ragua1:users/Ragua1/seed-gfx1150-from-gfx1151
Oct 9, 2026
Merged

azaidy merged 3 commits into
ROCm:mainfrom
Ragua1:users/Ragua1/seed-gfx1150-from-gfx1151

Conversation

@Ragua1

@Ragua1 Ragua1 commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Motivation

On gfx1150 (RDNA3.5), flash_attn_func (forward and backward), gemm_a8w8, gemm_a8w8_blockscale, gemm_a16w16 and gemm_afp4wfp4 fail before any kernel is compiled:

FileNotFoundError: Required config file doesn't exist: .../configs/gfx1150/triton/attention/mha/DEFAULT.json
AssertionError: Required config file doesn't exist: .../configs/gfx1150/triton/gemm/gemm_a8w8/DEFAULT.json
AssertionError: Required config file doesn't exist: .../configs/gfx1150/triton/gemm/gemm_a8w8_blockscale/DEFAULT.json
AssertionError: Required config file doesn't exist: .../configs/gfx1150/triton/gemm/gemm_a16w16/DEFAULT.json
AssertionError: MXFP4 is not available on your device

The first four have no gfx1150 table on main. gemm_afp4wfp4 is stopped earlier, by the arch check that admits gfx1151 but not gfx1150.

This PR seeds gfx1150 from gfx1151 as configs/CLAUDE.md ("Seeding a new architecture") describes: byte-identical copies from the closest measured arch. gfx1150 and gfx1151 are both RDNA3.5 with the same LDS and wave size; gfx1150 has 16 CUs, gfx1151 has 40. The seed is a placeholder, not tuning, and no performance is claimed.

Technical Details

16 files under configs/gfx1150/triton/, each byte-identical to the same path under gfx1151/triton/:

Family Files Read by
attention/mha 1 flash_attn_func forward, onekernel and fused backward
attention/unified_attention 1 unified_attention
conv/conv_3x3_nchw 1 the conv2d router, exact shapes only (route_exact_only)
gemm/gemm_a8w8 1 gemm_a8w8
gemm/gemm_a8w8_blockscale 10 gemm_a8w8_blockscale, and fused_gemm_a8w8_blockscale_mul_add as its fallback
gemm/gemm_a16w16 1 gemm_a16w16, fused_gemm_a16w16_quant_x
gemm/gemm_afp4wfp4 1 gemm_afp4wfp4 (unshuffled weights)

Three further changes:

  • unified_attention_utils.py: the "gfx1150": "gfx1151" entry leaves _ARCH_ALIAS, since gfx1150 now has its own file. The file is identical, so the served config does not change.
  • gemm_afp4wfp4.py: the triton-backend exception to is_fp4_avail() names gfx1150 beside gfx1151, get_arch() in ("gfx1150", "gfx1151"). Both are RDNA3.5, and dot_scaled lowers without native FP4 instructions on gfx1150 as on gfx1151. The other FP4 entry points keep is_fp4_avail() alone.
  • configs/CLAUDE.md: the list of seeding rules gains gfx1151 → gfx1150, triton only, next to gfx950 → gfx1250.

The gemm_a16w16 file is the gfx1151 table proposed in #4814 by @tangzzycc, not yet on main; its commit carries a Co-authored-by trailer. If #4814 changes the values before it merges, this copy should follow.

conv_3x3_nchw is the one seed that changes a path that already worked. Its four exact shapes move from the cblocked 3x3 kernel to the direct NCHW kernel; every other conv shape routes as before.

Test Plan

One process per arm: main @ 80a3b0b0 without the change, and this branch (0f922e65 + the two commits). The one main commit in between touches only gfx942 CK tuning CSVs. Each output is compared against an fp32 torch reference built from the same (already quantized) inputs. unified_attention runs upstream's own test_triton_unified_attn on 12 cases of its grid.

Test Result

Entry point main This branch: rel. L2 vs fp32
flash_attn_func fwd, bf16, B=1 S=256 H=4 D=64 FileNotFoundError 2.16e-3 (torch bf16 SDPA 1.66e-3)
flash_attn_func bwd, onekernel FileNotFoundError dq 2.41e-3, dk 1.98e-3, dv 1.96e-3
flash_attn_func bwd, fused FileNotFoundError dq 3.00e-3, dk 1.98e-3, dv 1.96e-3
unified_attention 12/12 pass 12/12 pass, now from the gfx1150 file
conv2d, the 4 conv_3x3_nchw shapes cblocked, error = torch bf16 direct NCHW, error = torch bf16
gemm_a8w8, fp8, 64×256×512 AssertionError 1.66e-3
gemm_a8w8_blockscale, fp8 AssertionError 1.57e-3
fused_gemm_a8w8_blockscale_mul_add AssertionError 1.94e-3
gemm_a16w16, bf16 AssertionError 1.66e-3
fused_gemm_a16w16_quant_x, Y only AssertionError 1.66e-3
gemm_afp4wfp4, MXFP4, scales not shuffled AssertionError 1.66e-3

torch's bf16 backward errors on the same inputs are 1.65e-3 to 1.66e-3.

Stack: gfx1150 (Radeon 890M), Windows 11 native ROCm, torch 2.15.0a0+rocm10.2.0a20260926, HIP 7.17.26384, triton 3.8.0.

Notes on the test

The branch run imports this branch's tree directly, with no config redirect and no patching. The upstream op_tests for the GEMMs and MHA could not run on this machine, because importing them builds module_aiter_core (HIP), which fails under the Triton-only Windows path; unified_attention runs its upstream test with those imports stubbed. conv2d runs under torch.no_grad(), since under torch.inference_mode() it raises in _pack_cache_key regardless of the table (#5889).

Ragua1 and others added 2 commits September 30, 2026 12:55
gfx1150 ships no table for MHA, unified_attention, conv_3x3_nchw,
gemm_a8w8, gemm_a8w8_blockscale and gemm_afp4wfp4, so flash_attn_func
and the three GEMMs fail at config resolution on that arch.

Seed them from gfx1151, as configs/CLAUDE.md describes for an arch
without tuning: 15 files, each a byte-identical copy of the same path
under gfx1151/triton/. gfx1150 and gfx1151 are both RDNA3.5; this is a
placeholder, not tuning.

- unified_attention_utils.py: drop the gfx1150 entry from _ARCH_ALIAS,
  so the new gfx1150 file is the one read. Its content is identical.
- gemm_afp4wfp4.py: the triton-backend exception to is_fp4_avail()
  admits gfx1150 beside gfx1151. Other FP4 entry points are unchanged.
- configs/CLAUDE.md: list gfx1151 -> gfx1150 among the seeding rules.

Signed-off-by: Martin Domanský <[email protected]>
gemm_a16w16 has no RDNA3.5 table on main yet. Copy the gfx1151 table
proposed in ROCm#4814 (head df9d0a8) byte-identical to gfx1150, so
gemm_a16w16 and fused_gemm_a16w16_quant_x resolve a config there.

Co-authored-by: tangzzycc <[email protected]>
Signed-off-by: Martin Domanský <[email protected]>
@Ragua1
Ragua1 requested a review from a team September 30, 2026 11:00
@github-actions github-actions Bot changed the title [Triton] [Config] Seed gfx1150 (RDNA3.5) configs from gfx1151 [Triton/Gluon] Seed gfx1150 (RDNA3.5) configs from gfx1151 Sep 30, 2026
@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 5997 --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.

Copilot review overview

🟡 Changes recommended

The gfx1150 FP4 path remains skipped by pytest, the A16W16 seed depends on an unmerged source config, and README guidance is not synchronized.

Review effort: Balanced
Findings: 2 Medium severity · 1 Low severity

Open (3)
What changed in this PR

Seeds gfx1150 Triton configurations from gfx1151 and enables unshuffled MXFP4 GEMM on RDNA3.5.

Changes:

  • Adds gfx1150 configs for attention, convolution, and GEMM families.
  • Enables gfx1150 in the Triton AFP4WFP4 architecture gate.
  • Documents gfx1151-to-gfx1150 seeding and removes the unified-attention alias.
File Description
utils/​unified_attention_utils.py Removes the obsolete gfx1150 alias.
gemm/​basic/​gemm_afp4wfp4.py Permits unshuffled Triton MXFP4 on gfx1150.
configs/​gfx1150/​triton/​attention/​mha/​DEFAULT.json Seeds MHA tuning.
configs/​gfx1150/​triton/​attention/​unified_attention/​DEFAULT.json Seeds unified-attention tuning.
configs/​gfx1150/​triton/​conv/​conv_3x3_nchw/​DEFAULT.json Adds exact-shape direct-convolution routing.
configs/​gfx1150/​triton/​gemm/​gemm_a8w8/​DEFAULT.json Seeds A8W8 tuning.
configs/​gfx1150/​triton/​gemm/​gemm_afp4wfp4/​DEFAULT.json Seeds AFP4WFP4 tuning.
configs/​gfx1150/​triton/​gemm/​gemm_a16w16/​DEFAULT.json Adds A16W16 defaults sourced from pending PR #4814.
configs/​gfx1150/​triton/​gemm/​gemm_a8w8_blockscale/​DEFAULT.json Seeds default blockscale tuning.
.../​GEMM-A8W8_BLOCKSCALE-N=8192-K=1024.json Seeds specialized blockscale tuning.
.../​GEMM-A8W8_BLOCKSCALE-N=512-K=4096.json Seeds specialized blockscale tuning.
.../​GEMM-A8W8_BLOCKSCALE-N=4096-K=4096.json Seeds specialized blockscale tuning.
.../​GEMM-A8W8_BLOCKSCALE-N=4096-K=256.json Seeds specialized blockscale tuning.
.../​GEMM-A8W8_BLOCKSCALE-N=4096-K=12288.json Seeds specialized blockscale tuning.
.../​GEMM-A8W8_BLOCKSCALE-N=4096-K=1024.json Seeds specialized blockscale tuning.
.../​GEMM-A8W8_BLOCKSCALE-N=2048-K=4096.json Seeds specialized blockscale tuning.
.../​GEMM-A8W8_BLOCKSCALE-N=16384-K=1024.json Seeds specialized blockscale tuning.
.../​GEMM-A8W8_BLOCKSCALE-N=1536-K=4096.json Seeds specialized blockscale tuning.
configs/​CLAUDE.md Documents the new architecture-seeding rule.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread aiter/ops/triton/configs/CLAUDE.md Resolved
@zufayu
zufayu requested review from a team and azaidy October 1, 2026 00:34
@azaidy
azaidy requested a review from cagrikymk October 5, 2026 22:35
@azaidy azaidy assigned cagrikymk and unassigned azaidy Oct 5, 2026
@cagrikymk

Copy link
Copy Markdown
Contributor

@Ragua1 If the software emulated fp4 path is solid for these archs, ca we get another helper function in the arch helper in the future?

something like "is_sw_emulated_fp4_avail"? This should cover archs that doesnt support fp4 in HW but can lower correctly via software emulation.

Assuming this requires some test across archs, we can leave this for another PR. Having a centralized check for it might be useful for later.

Besides that, LGTM! I started the CI.

@Ragua1

Ragua1 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

@cagrikymk

Agreed, I will add is_sw_emulated_fp4_avail() in a follow-up PR:

  • It replaces the inline gfx1151 exception in gemm_afp4wfp4_() and the UNSHUFFLED_TRITON_ONLY gate in test_gemm_afp4wfp4.py.
  • Initial list: gfx1150, gfx1151. An arch is added only with a passing run of the unshuffled Triton tests on it.

Note that Triton lowers tl.dot_scaled on these targets by upcasting FP4 to bf16, so the emulated path gives the FP4 storage format, not FP4 compute throughput.

gfx1101 already works on that path (Triton 3.8.0, gfx1151 table as a temporary donor):

  • Matches an fp32 reference: rel. L2 ≤ 1.66e-3 over 7 shapes, M = 1 to 4096, including unaligned M/N.
  • ISA uses v_wmma_f32_16x16x16_bf16.
  • It would join the list with its own tuned table and test results.

Would you be open to similar follow-up PRs for the other Triton GEMM families on RDNA3/RDNA3.5, where they compile and pass their tests? Each with arch-specific tuned tables and test gates narrowed to the supported cases, split per family or dtype group.

@cagrikymk

Copy link
Copy Markdown
Contributor

@cagrikymk

Agreed, I will add is_sw_emulated_fp4_avail() in a follow-up PR:

  • It replaces the inline gfx1151 exception in gemm_afp4wfp4_() and the UNSHUFFLED_TRITON_ONLY gate in test_gemm_afp4wfp4.py.
  • Initial list: gfx1150, gfx1151. An arch is added only with a passing run of the unshuffled Triton tests on it.

Note that Triton lowers tl.dot_scaled on these targets by upcasting FP4 to bf16, so the emulated path gives the FP4 storage format, not FP4 compute throughput.

gfx1101 already works on that path (Triton 3.8.0, gfx1151 table as a temporary donor):

  • Matches an fp32 reference: rel. L2 ≤ 1.66e-3 over 7 shapes, M = 1 to 4096, including unaligned M/N.
  • ISA uses v_wmma_f32_16x16x16_bf16.
  • It would join the list with its own tuned table and test results.

Would you be open to similar follow-up PRs for the other Triton GEMM families on RDNA3/RDNA3.5, where they compile and pass their tests? Each with arch-specific tuned tables and test gates narrowed to the supported cases, split per family or dtype group.

I think so, as long as these PRs targeting enabling performance or model support.

@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 3da9a8d into ROCm:main Oct 9, 2026
@Ragua1
Ragua1 deleted the users/Ragua1/seed-gfx1150-from-gfx1151 branch October 10, 2026 17:30
azaidy pushed a commit that referenced this pull request Oct 21, 2026
* [Triton/Gluon] [Config] Add gfx1151 gemm_a16w16 DEFAULT.json

On gfx1151, gemm_a16w16 stops before it compiles a kernel, because there
is no configs/gfx1151/triton/gemm/gemm_a16w16/DEFAULT.json.

The M_LEQ_256 and M_LEQ_1024 buckets are the gfx1151 table from #4814
(@tangzzycc), the same values that #5997 seeded into gfx1150. The "any"
bucket (M > 1024) changes from 64x64x256 to 128x128x64: over 12 large-M
shapes on gfx1151 it measured 32.4 TFLOPS geomean against 25.3.

Co-authored-by: tangzzycc <[email protected]>

* [Triton/Gluon] [Config] gfx1151 gemm_a16w16: retune the M <= 1024 buckets

The M_LEQ_1024 tile from #4814 (32x32x256) is slow for large N and K on
gfx1151. For example, 666 x 9728 x 2432 ran at 7.2 TFLOPS.

- M_LEQ_64: the #4814 M_LEQ_256 tile (32x16x256, 2 warps). It is the best
  or near the best for M <= 64.
- M_LEQ_256: 64x64x128, 4 warps (new).
- M_LEQ_1024: 128x64x64, 4 warps (new).

Over 10 shapes for each bucket, which include the LLM shapes of #4814, the
geomean goes from 17.0 to 27.1 TFLOPS for 256 < M <= 1024. No shape is
slower than with the #4814 tile.

Co-authored-by: tangzzycc <[email protected]>

---------

Co-authored-by: tangzzycc <[email protected]>
menglcai-amd pushed a commit that referenced this pull request Nov 8, 2026
…fx1150

The gfx1150 file has the values that #5997 copied from gfx1151. #6671
then replaced the gfx1151 values for M > 64, but not the gfx1150 values.
This copies the current gfx1151 file to gfx1150.

On gfx1150 (Radeon 890M), bf16 + bias, 37 shapes: geomean 1.59x faster
than main; 36 of 37 shapes are the same or faster.

Co-Authored-By: Claude <[email protected]>
Boss2002n pushed a commit that referenced this pull request Nov 27, 2026
)

* [Triton/Gluon] [Config] Use the gfx1151 gemm_a16w16 DEFAULT.json on gfx1150

The gfx1150 file has the values that #5997 copied from gfx1151. #6671
then replaced the gfx1151 values for M > 64, but not the gfx1150 values.
This copies the current gfx1151 file to gfx1150.

On gfx1150 (Radeon 890M), bf16 + bias, 37 shapes: geomean 1.59x faster
than main; 36 of 37 shapes are the same or faster.

* [Triton/Gluon] [Config] gfx1150 gemm_a16w16: use values from a gfx1150 search

A tile search on gfx1150 (Radeon 890M) replaced the copied gfx1151 values:
- M_LEQ_256: 64x64x64, 2 warps (was 64x64x128, 4 warps).
- Split M_LEQ_1024 at 512: M_LEQ_512 keeps 128x64x64; 512 < M <= 1024
  uses the any tile, 128x128x64.

Against main, 45 shapes: geomean 1.62x; 2 shapes are slower
(768x1536x1536 0.88x, 640x3072x768 0.98x).

Co-authored-by: menglcai <[email protected]>
klin-amd added a commit that referenced this pull request Nov 30, 2026
The gfx1150 unified_attention table was seeded from gfx1151 (#5997) and
not measured on gfx1150.

Retune the attn_2d, attn_3d and kv_split entries that the search's
shapes reach, from a search on gfx1150; each changed entry is >= 2%
faster than main's value. reduce is unchanged.

Signed-off-by: Lin, KuanTing <[email protected]>
klin-amd added a commit that referenced this pull request Nov 30, 2026
The gfx1150 gemm_a8w8 DEFAULT.json is a single "any" entry seeded from
gfx1151 (#5997), not measured on gfx1150.

Replace it with M buckets (M_LEQ_8 ... M_LEQ_2048, any) from a search
on gfx1150 (int8, plain layout).

Signed-off-by: Lin, KuanTing <[email protected]>
klin-amd added a commit that referenced this pull request Nov 30, 2026
The gfx1150 conv2d tables were seeded from gfx1151 (#5997) and not
measured on gfx1150.

Add or change per-shape pins in all nine gfx1150 conv files (1x1,
general, 3x3 direct NCHW / cblocked / NHWC, prepack, Winograd F(4,3)
input / GEMM / output) for the conv2d model layers of conv_shapes.json,
from a search on gfx1150. A pin is kept only where a CUDA-graph timing
of the layers that use it confirms it is >= 2% faster than main.
Two shapes leave the direct NCHW 3x3 kernel for the cblocked route.
The bucket and "any" entries are unchanged.

Signed-off-by: Lin, KuanTing <[email protected]>
klin-amd added a commit that referenced this pull request Nov 30, 2026
The gfx1150 gemm_afp4wfp4 DEFAULT.json was seeded from gfx1151 (#5997)
and not measured on gfx1150. Retune its three buckets (M_LEQ_16,
M_LEQ_128, any) from a search on gfx1150 (software-emulated FP4).

Signed-off-by: Lin, KuanTing <[email protected]>
klin-amd added a commit that referenced this pull request Nov 30, 2026
…MM buckets


The gfx1150 SonicMoE table was seeded from gfx1151 (#5997) and not
measured on gfx1150. Retune the medium_NK and large_NK buckets of
_grouped_gemm_kernel by forward time on gfx1150. The weight-gradient
kernel (training only) is unchanged.

Signed-off-by: Lin, KuanTing <[email protected]>
klin-amd added a commit that referenced this pull request Nov 30, 2026
The gfx1150 gemm_a8w8_blockscale files (DEFAULT.json and 9 per-shape
files) are byte copies of gfx1151's, added by #5997 as a placeholder.
Retune their buckets from a search on gfx1150; a bucket keeps main's
value unless the pick is >= 2% faster.

Signed-off-by: Lin, KuanTing <[email protected]>
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