Skip to content

Tests: keep the ROCm packed attention tests passing now that torch varlen runs there - #18362

Merged
danielhanchen merged 3 commits into
mainfrom
rocm-varlen-test-fixes
Nov 18, 2026
Merged

danielhanchen merged 3 commits into
mainfrom
rocm-varlen-test-fixes

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Follow-up to #18313. Two tests in tests/test_hf_packed_attention.py fail on ROCm since #18313 turned torch's flash varlen on there (seen on gfx1151 Linux and Windows 11). Test-only change, no library code touched.

  • test_rocm_keeps_windowed_rows_off_flash_attn fakes torch.version.hip to test the flash-attn window gate. On a card where ROCm: use flash varlen for packed rows so hybrid packing is faster than padding #18313's self-check now passes, packed rows take torch varlen instead and never reach the flash-attn backend the test checks, so both window cases failed (B200 with ROCm faked, and gfx1151 Linux). The test now pins torch varlen off (_TORCH_VARLEN = [None]), the case it was written for. Removing the window gate still makes it fail, so it keeps guarding that gate.
  • test_int32_guard_splits_documents_instead_of_the_dense_fallback[torch-*] now runs on ROCm and asserts bit equality between the split and whole-row results. AOTriton rounds one bf16 step (0.0078) differently per launch shape on Windows. CUDA keeps the exact comparison; ROCm uses the same tolerance as ROCm: use flash varlen for packed rows so hybrid packing is faster than padding #18313's self-check.

AMD CI (oobabooga/unsloth) Windows rerun 44340636929 with both changes: 117 passed, 0 failed in this file; without them it fails 4.

test_rocm_keeps_windowed_rows_off_flash_attn fakes torch.version.hip on a CUDA card. Now that ROCm
can use torch's varlen once it passes the self-check, that check passes on the real card and torch
varlen takes the rows before the flash-attn backend the test is about, so both cases failed. Pin
torch's varlen off in the test, as on a ROCm build whose self-check failed.
On ROCm the int32 split test now runs torch's flash varlen (the self-check turns it on), and on
Windows gfx1151 AOTriton rounds a bf16 ulp differently between the grouped and the whole-row launch
(max abs diff 0.0078). CUDA keeps the exact comparison; ROCm compares within the self-check's
0.02 x max + 1e-3.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T17:05:21.996825Z 73bde8a Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 73bde8abdb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 8f50636 into main Nov 18, 2026
@danielhanchen
danielhanchen deleted the rocm-varlen-test-fixes branch November 18, 2026 17:26
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.

1 participant