Skip to content

[Triton/Gluon] [ci-fix] gfx942 unified attention: fit the 3D kernel in LDS - #8400

Merged
azaidy merged 1 commit into
mainfrom
omuhamma/ci-fix
Nov 21, 2026
Merged

azaidy merged 1 commit into
mainfrom
omuhamma/ci-fix

Conversation

@omuhamma

Copy link
Copy Markdown
Contributor

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

… 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]>
@omuhamma
omuhamma requested a review from a team November 20, 2026 18:27
@omuhamma omuhamma self-assigned this Nov 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter standard tests on MI35X
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:mi300x Run Aiter standard tests on MI300X in PRs; main branch always runs them
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:windows Windows JIT op smoke test on the Radeon R9700 ROCm runner
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 8400 --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.

Reviews:
A reviewer is usually assigned within one working day after the PR is ready for review (see Code Review Process). If nobody has responded for about a week, mention the area contact listed in CONTACTS.md. Want to help review? See REVIEWERS.md.

@github-actions github-actions Bot changed the title [Triton/Gluon] gfx942 unified attention: fit the 3D kernel in LDS [Triton/Gluon] [Config] gfx942 unified attention: fit the 3D kernel in LDS Nov 20, 2026
@aiter-bot

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision 225147075839 · mode shadow

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

  1. What behavior does this PR change, and why is the existing behavior insufficient?
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
  3. Which exact workload keys consume these configuration changes, and what evidence shows that unrelated shapes keep their previous selection?
  4. For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.

Edit the PR Self-Review section in the PR description. Include the current revision SHA; this comment refreshes automatically.

Missing or invalid answers

  • FAIL — missing ### Reviewed revision in the PR description
  • FAIL — missing ### Behavior and intent in the PR description
  • FAIL — missing ### Validation and unverified scope in the PR description
  • FAIL — missing ### PR-specific question in the PR description
  • FAIL — missing ### Changed op tests in the PR description
  • FAIL — Reviewed revision must contain at least the first 7 characters of the current head SHA
  • FAIL — Behavior and intent has no substantive answer
  • FAIL — Validation and unverified scope has no substantive answer
  • FAIL — PR-specific question has no substantive answer

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

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.

🔵 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_split entry with TILE_SIZE_MAX and SEGMENT_TILE_MAX set 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

@omuhamma omuhamma changed the title [Triton/Gluon] [Config] gfx942 unified attention: fit the 3D kernel in LDS [Triton/Gluon] [ci-fix] gfx942 unified attention: fit the 3D kernel in LDS Nov 20, 2026
@zufayu

zufayu commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

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.

@omuhamma

Copy link
Copy Markdown
Contributor Author

@zufayu re-ran CI, could I get approval on the PR if it looks good so I can merge once CI passes?

@zufayu
zufayu requested review from a team and brunomazzottiamd November 21, 2026 11:36

@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 e931699 into main Nov 21, 2026
120 of 127 checks passed
@azaidy
azaidy deleted the omuhamma/ci-fix branch November 21, 2026 23:37
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.

5 participants