Skip to content

SDPA packed-segment test: gate the CUDA memory test on a real GPU - #12761

Merged
danielhanchen merged 1 commit into
mainfrom
ci-sdpa-real-cuda-guard
Oct 5, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci-sdpa-real-cuda-guard

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Repo tests (CPU, studio) has a third failure on main, alongside the ones #12747 and #12751 address:

FAILED tests/python/test_accelerator_skip_guards.py::test_no_skip_guard_reads_a_spoofable_accelerator_probe
  utils/test_sdpa_packed_segments.py:98: torch.cuda.is_available()

Cause

#12740 (SDPA per-segment packed attention) added test_peak_memory_is_linear_in_tokens gated on skipif(not torch.cuda.is_available()). tests/_zoo_aggressive_cuda_spoof.py patches that probe to True for the whole process, so on a CPU runner that shares a session with tests/version_compat or tests/vllm_compat the test un-skips and calls .cuda(). The guard test exists to catch this, so it is right and the new test is what needs changing. The product change in #12740 is unaffected.

Change

Gate on has_real_cuda() from tests/_shared/real_accelerator.py, which records the answer before any spoof runs. This is the same narrow probe the sibling tests/utils/test_attn_mask_compat.py uses for a body that allocates on cuda.

Verification

tests/python/test_accelerator_skip_guards.py: 1 failed, 23 passed on main (36255a18bd), 24 passed on this branch.

#12740 added test_peak_memory_is_linear_in_tokens behind
skipif(not torch.cuda.is_available()). tests/_zoo_aggressive_cuda_spoof.py patches that
probe to True process-wide, so on a CPU runner sharing a session with the compat
suites the test un-skips and allocates on cuda. test_accelerator_skip_guards catches
exactly this and is red on main. Use has_real_cuda() like the sibling utils tests.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-05T18:03:56.504461Z c631fa1 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: c631fa149e

ℹ️ 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".

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 5, 2026
@danielhanchen
danielhanchen merged commit 268f88e into main Oct 5, 2026
@danielhanchen
danielhanchen deleted the ci-sdpa-real-cuda-guard branch October 5, 2026 18:37
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