unsloth/scripts/data
Daniel Han 4dc8bf0bd2
Notebooks CI: refresh the Colab oracle snapshots to the current GPU runtime (#14182)
## Summary

The scheduled `Notebooks CI` run on main fails `static + transitive
resolve (cron / dispatch only)`, in its `Diff Colab oracle vs committed
snapshots (--strict on cron)` step. It has failed on every scheduled run
since at least 2026-09-27, most recently 2026-10-18 (run 39104836103):

```
=== pip-freeze.gpu.txt: upstream=720 snapshot=699 diff=226 (new=54 removed=33 changed=139) ===
=== apt-list-gpu.txt: upstream=1163 snapshot=1160 diff=241 (new=60 removed=57 changed=124) ===
=== os-info-gpu.txt: upstream=4 snapshot=4 diff=1 (new=0 removed=0 changed=1) ===
##[error]A rule-bearing Colab oracle drifted from its committed snapshot; run `notebook_validator.py refresh-colab --all --snapshot-dir scripts/data` to acknowledge.
```

Colab moved to a new GPU runtime, and the step exists to make someone
acknowledge that. Nothing in Unsloth is wrong. The committed snapshots
are just behind.

## Change

`python scripts/notebook_validator.py refresh-colab --all --snapshot-dir
scripts/data`, as the step asks. The three snapshot files move to the
current runtime. The parts the rules and the smoke seed read:

| | before | after |
|---|---|---|
| torch / torchvision / torchaudio | 2.11.0 / 0.26.0 / 2.11.0 `+cu128` |
same versions, `+cu130` |
| torchcodec | 0.11.0+cu128 | 0.11.0+cu130 |
| transformers | 5.16.1 | 5.18.0 |
| huggingface_hub | 1.29.0 | 1.33.0 |
| OS | Ubuntu 24.04.1 LTS | Ubuntu 24.04.4 LTS |

### CPU skip list (`colab_to_cpu_pin.json`)

The new runtime is CUDA 13. RAPIDS wheels moved from `-cu12` to `-cu13`,
and the CUDA 13 `nvidia-*` runtime wheels dropped the `-cu` suffix
(`nvidia-cublas`, `nvidia-cufft`, ...). As a result, 28 of the old skip
entries matched nothing, and the smoke seed would have installed 53
CUDA-only wheels on the CPU runners.

- **Skip list:** re-derived for this freeze, 90 entries.
- **Closure:** rebuilt from PyPI `Requires-Dist` for every pin (Linux
x86_64, CPython 3.13, no extras). No retained pin requires a skipped
one. torch is the only retained parent, and it is rewritten to the CPU
index.

### Guards (`test_smoke_install_contract.py`)

The old checks intersected a fixed `-cu12` name list with the freeze, so
after the rotation they passed vacuously. Now:

- **CUDA-only wheels** are classified by name shape: `-cuNN`,
`cupy-cudaNNx`, `jax-cudaNN-*`, `nvidia-*` except `nvidia-ml-py`,
`cuda-*`, and `triton`. Each shape has its own parametrized test cases.
- **A skip entry missing from the freeze** fails, which is the signal
that the map was not refreshed with the snapshot.
- **The closure edge table** is the real cu13 graph, and a stale edge
fails.

The new freeze with the old map fails 3 of these. On main's old freeze
the shape check also finds 3 CUDA wheels the old map already missed:
`cuda-toolkit`, `librmm-cu12` and `libucx-cu12`.

## Testing

- **Snapshot contract tests:** `test_smoke_install_contract.py`,
`test_validator_fixtures.py` and
`test_notebook_validator_shell_parsing.py` give 290 passed, 2 skipped on
the refreshed files. After the skip-list fix,
`test_smoke_install_contract.py` alone gives 52 passed. Those include
the checks that every dev pin in the freeze is judged, the skip list is
closed under the freeze's dependencies, and the CUDA-only wheels are
skipped.
- **`notebook_validator.py lint --colab-pin`:** I ran it against
`unslothai/notebooks@main` with the old and the new freeze. Both give 86
errors and 6 warnings, on the same rules, notebooks and cells. Only
version strings inside messages differ (`peft==0.20.0` to `0.21.1`,
`+cu128` to `+cu130`). That lint step is advisory on cron
(`continue-on-error`), and its backlog is unchanged.
- **Seed resolve:** I replayed the seed step's filter on this freeze. It
produced 3 torch pins and 626 others, and none of them is a CUDA-only
name. Then `uv pip compile --python-version 3.13 --python-platform
x86_64-manylinux_2_28 --only-binary :all:` (with the map's `no_binary`
exceptions and the CPU torch index) resolved all of them to 630
packages, with `torch==2.11.0+cpu`. No CUDA wheel comes back in
transitively: the only `nvidia` name in the resolve is the pure-Python
`nvidia-ml-py`.
- **The smoke-install matrix seeds from this freeze:** `Notebooks CI`
with `include_smoke=true` on this branch: run 39194401235 was dispatched
on the first commit, before the skip list was fixed, so I cancelled it.
Run 39201002217 is running on cf2a5fbc8d, and I will add its result
here.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-10-18 22:06:18 -07:00
..
colab_apt_list.gpu.txt Notebooks CI: refresh the Colab oracle snapshots to the current GPU runtime (#14182) 2026-10-18 22:06:18 -07:00
colab_os_info.gpu.txt Notebooks CI: refresh the Colab oracle snapshots to the current GPU runtime (#14182) 2026-10-18 22:06:18 -07:00
colab_pip_freeze.gpu.txt Notebooks CI: refresh the Colab oracle snapshots to the current GPU runtime (#14182) 2026-10-18 22:06:18 -07:00
colab_to_cpu_pin.json Notebooks CI: refresh the Colab oracle snapshots to the current GPU runtime (#14182) 2026-10-18 22:06:18 -07:00