Skip to content

Raise the released torch ceiling to <2.15.0 - #12152

Merged
danielhanchen merged 6 commits into
pipfrom
pip-torch-ceiling-215
Oct 2, 2026
Merged

danielhanchen merged 6 commits into
pipfrom
pip-torch-ceiling-215

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Raises the released torch ceiling from <2.13.0 to <2.15.0.

Why

Effect on existing Core users

  • Existing environments: plain pip install --upgrade unsloth keeps an installed torch that still satisfies the range, since pip's default only-if-needed strategy leaves satisfied dependencies alone, and every torch from 2.4 up to 2.14 does.
  • Upgrades that re-resolve dependencies do move torch: uv pip install -U unsloth (uv's --upgrade applies to every package, not only the named one) and pip install -U --upgrade-strategy eager unsloth pick the newest torch the range allows. With this cap that is 2.14; with today's <2.13.0 cap the same commands already move 2.11 to 2.12.1. To upgrade only unsloth with uv, use uv pip install --upgrade-package unsloth unsloth.
  • Studio installs do not use either command: unsloth studio update keeps 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.
  • Fresh environments: a new pip install unsloth can 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.
  • unsloth-zoo: already allows torch<2.15.0 (2026.9.7).

Merge timing

This should be merged at release time, alongside or after #12150 and #12151.

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.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 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-09-28T09:29:14.996843Z 597949e Manual request
🔒 Security Review ✅ Completed 2026-09-28T08:45:59.139824Z 597949e 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 Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 597949ed59

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +30 to +32
@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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 28, 2026
@danielhanchen
danielhanchen merged commit 8e82cc2 into pip Oct 2, 2026
72 of 84 checks passed
@danielhanchen
danielhanchen deleted the pip-torch-ceiling-215 branch October 2, 2026 09:40
rhsCZ pushed a commit to rhsCZ/unsloth that referenced this pull request Nov 4, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants