Repository navigation
[Triton/Gluon] benchmark + config + tuning for fused_qk_concat on gfx950 - #6287
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
There was a problem hiding this comment.
🟡 Changes recommended
Import-time GPU probing, incomplete kernel representations, and uncovered 1-warp paths should be addressed.
3 open findings
What changed in this PR
Adds gfx950-specific launch tuning and benchmarking for fused Q/K concatenation kernels.
Changes:
- Selects 1- or 4-warp launches based on
B × QH. - Adds gfx950 configuration tables.
- Adds a configurable performance benchmark.
| File | Description |
|---|---|
op_tests/op_benchmarks/triton/bench_fused_qk_concat.py |
Adds benchmark and CLI. |
aiter/ops/triton/fusions/fused_qk_concat.py |
Applies resolved launch configurations. |
aiter/ops/triton/_triton_kernels/fusions/fused_qk_concat.py |
Loads and selects configuration buckets. |
aiter/ops/triton/configs/gfx950/triton/fusions/fused_qk_cat/DEFAULT.json |
Tunes concat warp counts. |
aiter/ops/triton/configs/gfx950/triton/fusions/fused_qk_rope_cat/DEFAULT.json |
Tunes RoPE-concat warp counts. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
23d2cfc to
8e03cd2
Compare
|
@aiter-bot review |
|
aiter-bot — queued behind 1 review(s); expect to start in about 50 min. The box reviews one PR at a time. |
[ROCm/aiter] PR #6287 — [Triton/Gluon] benchmark + config + tuning for fused_qk_concat on gfx950Ships gfx950-only num_warps launch-config tables for the fused q/k concat and RoPE-concat kernels (4 warps below a per-kernel M = B×QH ceiling, 1 warp above), selected per launch through the shared config machinery, plus a CLI benchmark for both ops. Review (advisory):
|
|
Where that review came from — I ran the bot on your PR to show what it does. It is not an automatic hook; nothing reviews your PR unless somebody asks. Any reviewer on the aiter allowlist can ask for one, on any PR including their own. The trigger is a comment containing the words below — shown quoted here, because quoted lines deliberately do not trigger it:
Feedback on the review itself is welcome; it is how the rules get better. |
brunomazzottiamd
left a comment
There was a problem hiding this comment.
Sharing some minor comments on the newly added benchmark script. Please internalize these design choices, and ship your next benchmark with them in place.
bace9f9 to
8154c4e
Compare
brunomazzottiamd
left a comment
There was a problem hiding this comment.
LGTM!
This PR is facing some CI issues at the moment, but as far as I can tell it's network related. Rerun failed shards and hope for the best.
|
All Triton tests passed, merging... |


Motivation
On gfx950,
fused_qk_catandfused_qk_rope_catare up to 18% slower on Triton 3.8 than on Triton 3.4, with the same aiter source: 87 of 185 measured shapes regress. Neither op had a benchmark / dedicated config fileTechnical Details
Everything is gfx950-only: other archs ship no config and launch exactly as main does
DEFAULT.jsonbucketed on M = B x QH (one program per row) withM_LEQ_<x>/anykeys, as in the GEMM tables andFUSED_CLAMP_ACT_MUL's-N=files:configs/gfx950/triton/fusions/)M_LEQ_bucketanyfused_qk_cat/DEFAULT.json_qk_cat_kernelM_LEQ_65535: num_warps 4fused_qk_rope_cat/DEFAULT.json_qk_rope_cat_kernelM_LEQ_8191: num_warps 4qk_cat, 8,192 forqk_rope_cat), so that size and everything above get 1 warp. Smaller shapes keep 4 warps, Triton's default (the same binary as passing nothing)._get_configreturns{}, which is main's launch._get_config(config_name, M)picks the bucket at each launch withselect_leq_configand the use ofresolve_config_dirBenchmark:
op_tests/op_benchmarks/triton/bench_fused_qk_concat.py.-B 4096 16384 --kh 1 --qh-per-kh 16reaches the 1-warp ones.--op,-B,--kh,--qh-per-kh,--d-nope,--d-pe,--dtype,--neox,--reuse-freqs-front-part,--max-embed-positions,--metric,--rep,-print_vgpr,-o(writes a CSV).do_bench_cudagraph, preceded by atorch.cuda.synchronize(). The timer runsfnon a new stream that does not wait for the inputs, so without the syncqk_rope_catcan index cos/sin with aposthat hasn't been written yetTest Plan
rocprofv3 --kernel-trace, trimmed-mean kernel time, on MI355X.qk_catshapes), and all four RoPE variants (GPT-J/NeoX x full/half-width cos/sin, e.g.reuse_freqs_front_part).q_nope,q_peandk_peviews, KH 1, D_pe 64, half-width cos/sin.pytest op_tests/triton_tests/fusions/test_fused_qk_concat.py -vblack,ruffTest Result
pytest:
600 passed, 60 warnings in 12.46sqk_catbf16, D_pe 64 (60)qk_catbf16, D_pe 128 (12)qk_catfp16, D_pe 64 (3)qk_rope_catGPT-J, half-width cos/sin, D_pe 64 (59)qk_rope_catGPT-J, D_pe 128 (9)qk_rope_catNeoX, D_pe 64 (16)qk_rope_catNeoX, half-width cos/sin, D_pe 128 (9)qk_rope_cat, SGLang DeepSeek MLA layout (17)Every previously regressed shape is now at least as fast as Triton 3.4 (up to 52% faster) and 9-53% faster than main. No shape is slower than main beyond the expected noise threshold
qk_cat, D_pe 64qk_cat, D_pe 64qk_cat, D_pe 64qk_cat, D_pe 128qk_rope_catGPT-J, half-widthqk_rope_catGPT-J, half-widthqk_rope_catNeoXqk_rope_catNeoXqk_rope_catNeoX, half-width, D_pe 128qk_rope_cat, SGLang layoutqk_rope_cat, SGLang layoutSubmission Checklist