Skip to content

[Triton/Gluon] [Config] Add gfx1200 and gfx1201 Triton MHA configs - #6374

Merged
azaidy merged 2 commits into
ROCm:mainfrom
0xDELUXA:triton-mha-gfx1200-config
Oct 19, 2026
Merged

azaidy merged 2 commits into
ROCm:mainfrom
0xDELUXA:triton-mha-gfx1200-config

Conversation

@0xDELUXA

@0xDELUXA 0xDELUXA commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

aiter.ops.triton.attention.mha.flash_attn_func does not run on gfx1200 or gfx1201 (RDNA4). These archs have no configs/<arch>/triton/attention/mha/DEFAULT.json file. The default path raises FileNotFoundError before it compiles a kernel.

Technical Details

This PR copies the gfx1101 MHA config from #4493 to gfx1200/triton/attention/mha/ and gfx1201/triton/attention/mha/. The copies are byte identical. The PR also adds this seed to the allowed seeds in configs/AGENTS.md and in .github/instructions/aiter-ops-triton.instructions.md. There are no code changes.

The gfx1200 config is measured. A sweep tested 108 tiles (BLOCK_M x BLOCK_N x num_warps x num_stages) for fwd/default at head_dim 128 and fwd/small_head at head_dim 64. Then 10 interleaved repeats compared the best tiles on nine shapes. No tile was faster than the gfx1101 entries on all shapes. Each alternative won on some shapes and lost on others by 1-5%. The gfx1151 file is 62% slower at head_dim 128.

gfx1201 is not measured. Its file is a seed. Replace it with tuned values when gfx1201 hardware is available.

Test Plan

Windows 11, RX 9060 XT (gfx1200), torch 2.16.0a0+rocm10.2.0a20261007, triton-windows 3.8.0.post28.

  • op_tests/triton_tests/attention/test_mha.py without the gluon cases, in forward, varlen and backward chunks.
  • Performance on diffusion shapes (SDXL, SD3, Flux, Wan) and causal GQA prefill (head_dim 64 and 128, seqlen 4k and 16k), fp16 and bf16. Compared with the gfx1151 entries and SDPA.

Test Result

test_mha.py: 1126 passed, 146 skipped, 0 numerical failures. 41 cases ran out of memory in the reference implementation on this 16 GB card. Each needs one allocation of 3.75-37.5 GiB at batch 30/50, seqlen 2048.

Flux 1024px attention (head_dim 128) takes 6.07 ms with this config and 9.87 ms with the gfx1151 entry. Triton MHA is 1.5-2.3x faster than SDPA on causal GQA prefill. On diffusion shapes, the two are approximately equal.

Submission Checklist

@0xDELUXA
0xDELUXA requested a review from a team October 10, 2026 11:41
@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
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 6374 --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.

@0xDELUXA

0xDELUXA commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor Author

@azaidy @brunomazzottiamd could you take a look when you have a moment? Same pattern as #4493 and #5997. Data only, no code changes.

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 seeding convention must be synchronized with the repository’s Triton README and review instructions.

1 open finding
What changed in this PR

Adds seeded Triton MHA configurations so gfx1200 and gfx1201 can resolve and run the existing attention kernels.

Changes:

  • Adds gfx1200 and gfx1201 MHA defaults, byte-identical to gfx1101.
  • Documents the new architecture-seeding relationship.
File Description
configs/​gfx1200/​.../​DEFAULT.json Adds gfx1200 MHA tuning defaults.
configs/​gfx1201/​.../​DEFAULT.json Adds gfx1201 MHA tuning defaults.
configs/​CLAUDE.md Documents the new seeding rule.

🧠 Review effort: Balanced


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

Comment thread aiter/ops/triton/configs/CLAUDE.md Resolved
@0xDELUXA
0xDELUXA force-pushed the triton-mha-gfx1200-config branch from 395f60b to 2bdeb15 Compare October 10, 2026 15:43
@zufayu
zufayu requested review from a team and azaidy October 12, 2026 01:26
@0xDELUXA
0xDELUXA force-pushed the triton-mha-gfx1200-config branch from 2bdeb15 to b80594a Compare October 14, 2026 19:29
@0xDELUXA

Copy link
Copy Markdown
Contributor Author

I'm resolving conflicts and rebasing in the meantime.

@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 2197da8 into ROCm:main Oct 19, 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.

4 participants