Skip to content

Tests: baseline the torchao import probe from #15850, gate the PrefixGrouper CUDA test on a real card - #15948

Merged
danielhanchen merged 1 commit into
mainfrom
tests-main-reds-loader-baseline-skip-guard
Oct 29, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
tests-main-reds-loader-baseline-skip-guard

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Two more checks are red on main itself, so every PR based on it today inherits them (seen on staging for #15859 and #15936, neither of which touches these files):

  1. tests/security/test_lint_risky_loaders.py::test_the_tree_matches_the_baseline (workflow-trigger lint):

    1 risky loader call site(s) not in the baseline:
      unsloth/import_fixes.py:1040  [dynamic-import] import_module
    

    Import fixes: disable a torchao too new for the installed torch instead of failing import unsloth #15850 added a fourth importlib.import_module(module_name) in unsloth/import_fixes.py (the torchao import-time probe). The baseline keys a call on its source text, so the existing entry for that text (count 3) now sees 4 and reports the overflow at the first site. The new call iterates the fixed _TORCHAO_IMPORT_TIME_MODULES tuple, so it is the same trusted shape as the other three. The product is fine; the baseline needed the count and the reason updated.

  2. tests/python/test_accelerator_skip_guards.py::test_no_skip_guard_reads_a_spoofable_accelerator_probe (Repo tests, CPU):

    test_prefix_grouper_layout.py:199: torch.cuda.is_available()
    

    GRPO PrefixGrouper: build the shared-prefix layout from one host copy instead of per-token loops and per-segment device fills #15835 added test_cuda_layout_reads_the_device_once_and_copies_once gated on torch.cuda.is_available(), which tests/_zoo_aggressive_cuda_spoof.py patches to True process-wide, so on a CPU runner sharing a session with the compat suites the test un-skips and calls .cuda(). Here the guard is right and the new test was wrong: it now gates on has_real_cuda() like the other CUDA-only tests.

What changed

  • scripts/risky_loaders_baseline.json: the 59e72c01edb14c86 entry goes from count 3 to 4 (regenerated with scripts/lint_risky_loaders.py --update, only that line moved), and its reason names _TORCHAO_IMPORT_TIME_MODULES beside the other fixed tables.
  • tests/test_prefix_grouper_layout.py: skipif(not has_real_cuda(), ...) instead of skipif(not torch.cuda.is_available(), ...).

Verification

  • Base (main at a4aee21490): both tests fail as above.
  • Head: test_lint_risky_loaders.py, test_accelerator_skip_guards.py and test_prefix_grouper_layout.py give 75 passed, 1 skipped on a CPU-only run.
  • On a real GPU (torch 2.13 + CUDA 13.0) all 6 PrefixGrouper tests run, including the CUDA one, so the new gate does not skip it on real hardware.
  • Each guard still fails without its fix: putting torch.cuda.is_available() back makes the skip-guard test fail, and putting the baseline count back to 3 makes the loader lint fail.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 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-29T11:02:45.939393Z e431ccb 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 them coming!

Reviewed commit: e431ccb8ed

ℹ️ 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 754fc0e into main Oct 29, 2026
0 of 16 checks passed
@danielhanchen
danielhanchen deleted the tests-main-reds-loader-baseline-skip-guard branch October 29, 2026 11:18
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