Repository navigation
[Triton/Gluon] [ci-fix] gfx942 unified attention: fit the 3D kernel in LDS - #8400
Conversation
… head sizes 257-511 test_triton_unified_attn_prefill_head_sizes (from #5409) fails on gfx942 for BF16, head_size=320, seq_lens0: the kernel requests 131072 bytes of shared memory and the device has 65536. Head size 320 pads to 512. On a 304-CU part this case launches too few 2D programs, so it runs the 3D split-KV kernel. kv_split "any" gives it TILE_SIZE 64, so the K and V tiles need 131072 bytes with a 16-bit KV cache. The head_size >= 512 rule that keeps the 3D kernel off for large heads does not apply, because it checks the head size before padding. Add a kv_split entry for head sizes 257-511 with a 16-bit KV cache. It is the "any" entry with TILE_SIZE_MAX and SEGMENT_TILE_MAX set to 32. An fp8 KV cache already fits and keeps its config. Compiled every case of the test for gfx942 (wave64, CU_NUM=304, Triton 3.8.0): on main only this case is above 65536 bytes; with this change it uses 65536 bytes and the other 47 cases do not change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
WAITING ON AUTHORPR Self-ReviewRevision Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision. Questions to answer in the PR description
Edit the Missing or invalid answers
Shadow mode reports what would block but keeps the status successful. Set |
There was a problem hiding this comment.
🔵 Needs a closer look
The gfx942 configuration targets the exact LDS limit, but GPU compilation and execution were unavailable to verify shared-memory fit, numerical correctness, and latency for the affected 3D path.
No open issues 🎉
What changed in this PR
This PR adjusts the gfx942 unified-attention configuration to keep the 3D split-KV kernel within shared-memory limits for head sizes 257–511 with a 16-bit KV cache.
Changes:
- Adds a targeted
kv_splitentry withTILE_SIZE_MAXandSEGMENT_TILE_MAXset to 32. - Keeps the existing configuration for FP8 KV caches and other head-size ranges.
| File | Description |
|---|---|
aiter/ops/triton/configs/gfx942/triton/attention/unified_attention/DEFAULT.json |
Adds smaller tile limits for head sizes 257–511 with a 16-bit KV cache on gfx942. |
Review effort: Balanced
|
The current Aiter Test gate is blocked by infrastructure: MI35X Standard Tests shard 6 completed the Tests step successfully, then Upload test logs failed with getaddrinfo EAI_AGAIN for productionresultssa0.blob.core.windows.net (job: https://github.com/ROCm/aiter/actions/runs/44792885064/job/136566818109). Please rerun the failed job now that the workflow has finished; the gate failure is downstream of this upload failure. |
|
@zufayu re-ran CI, could I get approval on the PR if it looks good so I can merge once CI passes? |
for head sizes 257-511
test_triton_unified_attn_prefill_head_sizes (from #5409) fails on gfx942 for BF16, head_size=320, seq_lens0: the kernel requests 131072 bytes of shared memory and the device has 65536.
Head size 320 pads to 512. On a 304-CU part this case launches too few 2D programs, so it runs the 3D split-KV kernel. kv_split "any" gives it TILE_SIZE 64, so the K and V tiles need 131072 bytes with a 16-bit KV cache. The head_size >= 512 rule that keeps the 3D kernel off for large heads does not apply, because it checks the head size before padding.
Add a kv_split entry for head sizes 257-511 with a 16-bit KV cache. It is the "any" entry with TILE_SIZE_MAX and SEGMENT_TILE_MAX set to 32. An fp8 KV cache already fits and keeps its config.
Compiled every case of the test for gfx942 (wave64, CU_NUM=304, Triton 3.8.0): on main only this case is above 65536 bytes; with this change it uses 65536 bytes and the other 47 cases do not change