Repository navigation
Raise the released torch ceiling to <2.15.0 - #12152
Conversation
Studio now installs torch 2.13 on the Linux cu130 Python 3.13 route and the Core extras pin up to torch 2.14.0. A release still capped at <2.13.0 downgrades such an install to PyPI's generic 2.12.1 on the next unsloth studio update. PyPI torch 2.12.1, 2.13 and 2.14 are all CUDA 13 builds, so the driver requirement for a fresh pip install is unchanged.
|
@codex review |
|
@codex security 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 Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 597949ed59
ℹ️ 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".
| @pytest.mark.parametrize("release", ["2.4.0", "2.11.0", "2.12.1", "2.13.0", "2.14.0"]) | ||
| def test_the_released_range_admits_every_supported_torch(release): | ||
| assert Version(release) in _base_torch().specifier |
There was a problem hiding this comment.
Add the torch ceiling guard to a CI test command
This new module is not executed by the current CI configuration: pyproject.toml:1203 restricts default discovery to tests/security, while the root-test commands in .github/workflows/consolidated-tests-ci.yml explicitly enumerate other modules and never name this file. Consequently, a later change can violate the torch ceiling or extra-pin invariants while CI remains green; add this module to an appropriate explicit pytest invocation.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This module already runs in CI: studio-backend-ci.yml's Repo tests (CPU, rest) shard walks tests/ minus the named subtrees, and collecting that selection picks up all 7 tests here (it is also the job that flagged this file's encoding earlier).
Fixes unslothai#16520 ## Problem `main` has carried the torch 2.13 and 2.14 extras since unslothai#12151, but this branch (what gets uploaded to PyPI) never got them. unslothai#12152 raised the base ceiling to `torch<2.15.0` here, and the extras themselves were left out. So on 2026.11.1: ``` $ uv pip compile <(echo "unsloth[cu130-torch2130]==2026.11.1") --extra-index-url https://download.pytorch.org/whl/cu130 --index-strategy unsafe-best-match warning: The package `unsloth==2026.11.1` does not have an extra named `cu130-torch2130` torch==2.14.1+cu130 ``` The install does not fail. It just ignores the extra and resolves a different torch than the one asked for. `cu130-torch2140` behaves the same way. ## Changes - `pyproject.toml`: adds the 12 extras from `main`, each placed after its 2.12.1 sibling: `cu126/cu130` x `onlytorch` / `-torch` / `-ampere-torch` x `2130` / `2140`. The xformers wheel URLs are written as `xformers==0.0.35` with the merged platform marker, exactly like the existing torch 2.12 extras on this branch, so there are no direct references for PyPI to reject. Nothing else changes: the base dependencies and all 167 existing extras are byte-identical. - `tests/python/test_pyproject_pypi_installable.py`: a guard that every `cu*-torch<T>` extra `_auto_install.py` can print exists here, with `cu126` and `cu130` required for torch 2.12 and newer. It fails on the current `pip` head (missing `2130`, `2140`) and passes with this change, so the next torch bump on `main` cannot silently miss the release again. ## Verification - Wheel metadata built from this branch: 179 extras (167 + 12), 0 direct URLs; the new `Requires-Dist` lines have the same shape as the published `cu130-torch2121` ones. - With that metadata, `uv pip compile` (Python 3.12, Linux x86_64 and Windows x86_64) resolves each new extra with no warnings: | extra | resolved torch | |-------|----------------| | `cu126-torch2130`, `cu126-ampere-torch2130` | `2.13.0+cu126` | | `cu130-torch2130`, `cu130-ampere-torch2130` | `2.13.0+cu130` | | `cu126-torch2140`, `cu126-ampere-torch2140` | `2.14.0+cu126` | | `cu130-torch2140`, `cu130-ampere-torch2140` | `2.14.0+cu130` | | `cu126-torch2121`, `cu130-torch2121` (control) | unchanged, `2.12.1+cu126` / `2.12.1+cu130` | - `python -m pytest tests/python/test_pyproject_pypi_installable.py`: 9 passed (the new test fails on the current `pip` head). ## Effect on users This only adds extra names. Plain `pip install unsloth`, every existing extra, Studio, Desktop and the notebooks resolve exactly as before. People who ask for `unsloth[cu126-torch2130]` / `unsloth[cu130-torch2140]` and so on now get the torch build they asked for instead of a warning.
Raises the released torch ceiling from
<2.13.0to<2.15.0.Why
<2.13.0, that route stays off.unsloth studio updatere-resolves unsloth under the installed release's torch cap. On a torch 2.13 install, 2026.9.11 swapped torch for PyPI's generic 2.12.1 and lost the matching prebuilt kernels (measured in Studio: torch 2.13 for new Linux cu130 Python 3.13 installs, existing installs keep their torch #12150).<2.13.0base cannot resolve. The comment above the line already ties the ceiling to the newest torch an extra pins.Effect on existing Core users
pip install --upgrade unslothkeeps an installed torch that still satisfies the range, since pip's defaultonly-if-neededstrategy leaves satisfied dependencies alone, and every torch from 2.4 up to 2.14 does.uv pip install -U unsloth(uv's--upgradeapplies to every package, not only the named one) andpip install -U --upgrade-strategy eager unslothpick the newest torch the range allows. With this cap that is 2.14; with today's<2.13.0cap the same commands already move 2.11 to 2.12.1. To upgrade only unsloth with uv, useuv pip install --upgrade-package unsloth unsloth.unsloth studio updatekeeps the resident torch unless a dependency conflict forces the resolver to re-solve it. Studio: torch 2.13 for new Linux cu130 Python 3.13 installs, existing installs keep their torch #12150 freezes torch 2.13 and newer through the core update; on 2.11 or 2.12 a forced re-solve could move torch within this range.pip install unslothcan resolve torch 2.14 from PyPI instead of 2.12.1. PyPI's 2.12.1, 2.13.0 and 2.14.0 Linux wheels all depend on the CUDA 13 packages (cuda-toolkit,nvidia-cudnn-cu13,nvidia-nccl-cu13), so the driver requirement is unchanged.torch<2.15.0(2026.9.7).Merge timing
This should be merged at release time, alongside or after #12150 and #12151.