Skip to content

[TRITON][GLUON][GFX950] Add Unified Attention Gluon Kernel - #4614

Open
cagrikymk wants to merge 10 commits into
mainfrom
cagri/unif_2d_gfx950_clean
Open

[TRITON][GLUON][GFX950] Add Unified Attention Gluon Kernel#4614
cagrikymk wants to merge 10 commits into
mainfrom
cagri/unif_2d_gfx950_clean

Conversation

@cagrikymk

@cagrikymk cagrikymk commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Motivation

This PR adds gfx950 gluon kernel for unified attention. It uses single kernel that supports both 2d and 3d grid.

Performance is tuned for head sizes [64, 128, 256], dtype fp8 x fp8 and bf16 x bf16.

Remaining Steps

  • Test e2e performance, at least for GPT-OSS-120b
  • Extend the gluon routing to make it more bullet-proof

Technical Details

Performance numbers are collected using Triton 3.7.1.

Geomean speedup by head_size against Triton

This is the geomean speedup of various run configs with varrying concurrency, kv/seq. length, number of KV/Q heads,

head_size decode bf16 decode fp8 prefill bf16 prefill fp8 mixed bf16 mixed fp8
256 1.58x 1.02x 2.17x 2.22x 1.90x 1.81x
128 1.10x 1.08x 1.19x 1.38x 1.23x 1.41x
64 1.11x 1.24x 1.51x 1.55x 1.54x 1.62x

Detailed performance report:
gluon_gfx950_perf_report.md

Test Plan

Existing tests are routed to the gluon kernel if conditions are met

Test Result

Tests pass

@github-actions

github-actions Bot commented Aug 6, 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:triton-300x Run an additional Triton test job on MI300X in PRs; main branch always runs both MI35X and MI300X
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 4614 --add-label <label>

@cagrikymk

Copy link
Copy Markdown
Contributor Author

GPT-OSS 120b benchmark, bf16 kv cache:

ISL/OSL 1024/1024

C gluon tok/s triton tok/s delta
8 1979 1958 +1.1%
16 3937 3921 +0.4%
32 7014 6941 +1.1%
64 12090 11960 +1.1%
128 19208 19003 +1.1%

ISL/OSL 8192/1024

C gluon tok/s triton tok/s delta
8 1836 1816 +1.1%
16 3419 3384 +1.0%
32 5528 5434 +1.7%
64 8306 8144 +2.0%
128 11189 10945 +2.2%

@cagrikymk
cagrikymk marked this pull request as ready for review August 7, 2026 15:57
@cagrikymk
cagrikymk requested a review from a team August 7, 2026 15:57
vgokhale
vgokhale previously approved these changes Aug 7, 2026
@cagrikymk

Copy link
Copy Markdown
Contributor Author

@vgokhale Due to triton version difference between CI and my local setup (both are 3.7 but at different commits), I was getting LLVM compilation error when using waves_per_eu=3 with sliding window in CI:

llvm/ADT/Sequence.h:275  llvm::iota_range<unsigned>::iota_range(T, T, bool):
  Assertion `Begin <= End && "Begin must be less or equal to End."' failed.
 (anonymous namespace)::SIInsertWaitcnts::run()
translateLLVMIRToASM   (python/src/llvm.cc:399)

I changed occupancy to 0 for that case, and it compiles to a kernel with occupancy 3 without any error in CI triton now.

@cagrikymk
cagrikymk requested a review from vgokhale August 7, 2026 19:20
vgokhale
vgokhale previously approved these changes Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants