Skip to content

Decode graph KV growth test: gate its CUDA skips on has_real_cuda() - #15270

Merged
danielhanchen merged 1 commit into
mainfrom
ci-skip-guard-assigned-markers
Oct 25, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci-skip-guard-assigned-markers

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

tests/python/test_accelerator_skip_guards.py::test_no_skip_guard_reads_a_spoofable_accelerator_probe fails on main since #15237. It shows on the studio shard of every newer PR, for example #15217:

test_decode_graphs_kv_growth_device.py:127: torch.cuda.is_available()
test_decode_graphs_kv_growth_device.py:127: torch.cuda.device_count()

Cause

The guard is right. tests/_zoo_aggressive_cuda_spoof.py patches torch.cuda.is_available() and device_count() process-wide, so these skips would un-skip on a CPU-only runner whenever they share a session with the spoofing suites. The two-GPU test would then call torch.cuda.set_device(0) there.

Fix

  • test_decode_graphs_kv_growth_device.py now gates on has_real_cuda() from tests/_shared/real_accelerator.py, the answer recorded before any spoof:
    • the two-GPU skip short-circuits on it before device_count();
    • the module-level cuda marker gates on it too.
  • The guard only scans decorator skipif calls, so it does not see that marker. It is the same spoofable read, so it is changed here as well.

Verification

  • test_accelerator_skip_guards.py: 1 failed on main; 24 passed here.
  • On CPU, the file's three CUDA tests skip with the same reasons as before.
  • On a real GPU host, has_real_cuda() returns True, so the CUDA tests still run there.

… CUDA answer

#15237's two-GPU skip read torch.cuda.is_available() and device_count(),
which the zoo CUDA spoof patches process-wide, so
test_no_skip_guard_reads_a_spoofable_accelerator_probe fails on main. Both
skips, the module-level cuda marker included, now short-circuit on
has_real_cuda() first.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 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-25T14:15:07.800241Z 637fa54 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. Keep it up!

Reviewed commit: 637fa549c9

ℹ️ 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 9d3f406 into main Oct 25, 2026
0 of 14 checks passed
@danielhanchen
danielhanchen deleted the ci-skip-guard-assigned-markers branch October 25, 2026 14:21
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