Repository navigation
CUDA spoof: cover CUDA wheels on GPU-less runners, not only CPU wheels - #14056
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
## Summary Two install-cell smoke legs fail on main's scheduled `Notebooks CI` (2026-10-17 06:39, run 39010742438): - `nb/Nemotron-3-Nano-30B-A3B_A100.ipynb` - `nb/Qwen3_5_(4B)_Vision.ipynb` Both fail like this: ``` error: No virtual environment found; run `uv venv` to create an environment, or pass `--system` to install into a non-virtual environment FileNotFoundError: [Errno 2] No such file or directory: 'unsloth' ``` Their install cells use `!uv pip install`, and the next line is `!unsloth install-kernels` (unslothai/notebooks #385). On Colab the uv lines work because Colab sets `UV_SYSTEM_PYTHON=true`. I checked this on a live `release-colab-external-images_20261014` runtime, along with its `COLAB_*` keys. The smoke job installs into the runner's system interpreter as a stand-in for Colab's, but its install step set neither: - uv refused to run. - The notebooks also took their non-Colab branch, since they choose the branch on any environment key containing `COLAB_`. Setting only `UV_SYSTEM_PYTHON` is not enough, which I tried first while working on #14056. The non-Colab branch then left `transformers==4.57.6` (installed `--no-deps`) beside `huggingface_hub` 1.29, which it refuses to import with, and the gpt-oss leg lost `triton`. Colab's own branch reinstalls with dependencies, so the job has to take that branch to test what Colab users run. ## Change - **`notebooks-ci.yml`:** the `Run install cell` step sets `UV_SYSTEM_PYTHON: 'true'` and a `COLAB_SMOKE_SHAPED: '1'` marker, with a comment explaining why. - The marker is scoped to that one step, which stops before `from unsloth import`. - Its name matches none of the specific `COLAB_*` keys Unsloth reads (`COLAB_ENVIRONMENT`, `COLAB_IFRAME_HEIGHT`, ...). - `disk_utils`' generic `COLAB_` scan never runs inside that step. - **`tests/notebooks/test_smoke_install_contract.py`:** `test_the_install_cell_runs_the_way_colab_does` requires a `COLAB_*` key and `UV_SYSTEM_PYTHON` on every step that runs the converted install cell. ## Testing - **`Notebooks CI` with `include_smoke=true` on this branch (run 39017258647):** all eight smoke legs pass, including Nemotron-3-Nano and Qwen3_5 Vision, which fail on main. GRPO and gpt-oss also still pass. - **The Nemotron leg did real work rather than skipping:** - It printed no `No virtual environment found`. - uv installed and uninstalled packages. - `unsloth install-kernels` ran and chose its torch fallback for causal_conv1d and mamba_ssm on CPU torch. - `OK: imports pass under CUDA spoof`. - **Contract test:** `test_smoke_install_contract.py` gives 39 passed. With the workflow change reverted, the new test fails. The `static + transitive resolve` job is still red in that run. That is the Colab oracle snapshot drift that has failed on every scheduled run since at least 2026-09-27, and it is unrelated to this change.
Summary
The 2026-10-17 06:39 scheduled
Notebooks CIrun on main (1018ecbf, run 39010742438) failed thenb/Llama3.1_(8B)-GRPO.ipynbinstall-cell smoke leg, which passed on the previous scheduled run (2026-10-01):The notebook's non-Colab branch runs
pip install unsloth vllm, which now brings intorch 2.13.0+cu130.tests/_zoo_aggressive_cuda_spoof.pyonly supplied_cuda_getCurrentRawStreamwhen the symbol was absent, which is the CPU-wheel case from #11328. A CUDA wheel on a GPU-less runner has the symbol, but calling it raises, soimport unslothunder the spoof died at that line. The product is fine. The spoof did not cover this wheel.Change
tests/_zoo_aggressive_cuda_spoof.py:_cuda_getCurrentRawStreamis now replaced when it is absent or when calling it raises. A working handle on a real CUDA machine is still kept.tests/test_cuda_spoof_supplies_the_raw_stream.py: newtest_the_spoof_replaces_a_raw_stream_that_has_no_driver_behind_itstages a raw-stream function that raises the driver error and requires the spoof to replace it. The existingtest_the_spoof_leaves_a_real_raw_stream_alonestill passes.Testing
torch 2.13.0+cu130andCUDA_VISIBLE_DEVICES="": applying the spoof and thenimport unslothfails on main withAcceleratorError: CUDA error: no CUDA-capable device is detected, and passes with this change.test_cuda_spoof_supplies_the_raw_stream.pyandtest_cuda_spoof_reports_free_memory.pygive 6 passed. With the spoof reverted, the new test fails.Notebooks CIwithinclude_smoke=trueon the first revision of this branch (run 39015954144): the GRPO leg passes. That revision also setUV_SYSTEM_PYTHONon the install step. It turned the Nemotron and Qwen3_5 failures into different ones and broke gpt-oss, so it is not part of this PR (see below).Not in this PR
The Nemotron-3-Nano and Qwen3_5 Vision legs fail for a different reason, which this PR leaves alone. Their install cells call
!uv pip install. Colab setsUV_SYSTEM_PYTHON=true(checked on a liverelease-colab-external-images_20261014runtime), but the smoke job does not. The job also sets noCOLAB_*variable, so the notebooks take their non-Colab branch.Setting only
UV_SYSTEM_PYTHONlets the uv lines run, but without the Colab branch the result is not Colab's environment:transformers==4.57.6is installed with--no-depsnext tohuggingface_hub1.29.triton.Making the job match Colab needs both variables together, and it should be a separate change with its own smoke run.
The
static + transitive resolvered (Colab oracle drifted from its committed snapshot) is also untouched. It has failed on every scheduled run since at least 2026-09-27.