Skip to content

Add cu128/cu126/cu130 torch 2.11.0 extras (torch2110) with xformers 0.0.35 - #6955

Merged
danielhanchen merged 30 commits into
mainfrom
add-cu128-torch2110-extra
Sep 4, 2026
Merged

danielhanchen merged 30 commits into
mainfrom
add-cu128-torch2110-extra

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Adds a torch2110 CUDA extra family (torch 2.11.0 + xformers 0.0.35) mirroring the existing torch2100 layout, so packages that want torch 2.11.0 can select a matching unsloth extra.

Today the newest CUDA training extras are cu*-ampere-torch2100 / cu*-torch2100, which cap the stack at torch 2.10.0: their xformers 0.0.34 wheel hard-requires torch==2.10.0. There is no torch 2.11.0 counterpart for the CUDA indexes, so torch==2.11.0 together with unsloth[cu128-ampere-torch2100] is unsatisfiable (xformers 0.0.34 pulls torch 2.10.0). torch 2.11.0 is already used elsewhere in the tree (the xpu extra, torchao 0.17.0, the rocm7.2 studio path), so the CUDA gap is the odd one out.

What this adds

Mirrors the torch2100 layout for cu126 / cu128 / cu130:

  • cu{126,128,130}onlytorch2110: the xformers 0.0.35 wheels (linux + win32) plus an explicit torch>=2.11.0,<2.12.0 / torchvision>=0.26.0,<0.27.0 / torchaudio>=2.11.0,<2.12.0 trio. Unlike xformers 0.0.34 (which hard-pinned torch==2.10.0), xformers 0.0.35 does not pin torch, so a bare resolve floats torch up to 2.12.x. The trio keeps the torch2110 name faithful and matches the torch>=2.11.0,<2.12.0 convention already used in studio/install_python_stack.py and the xpu torch2110 extra.
  • cu{126,128,130}-torch2110 and cu{126,128,130}-ampere-torch2110: unsloth[huggingface] + bitsandbytes + the matching onlytorch2110, identical in shape to the torch2100 wrappers.

Validation

unsloth[cu128-ampere-torch2110] resolves cleanly, standalone and with explicit torch pins:

torch==2.11.0+cu128
torchvision==0.26.0+cu128
torchaudio==2.11.0+cu128
xformers 0.0.35 (cu128)

No change to any existing extra; this is purely additive.

….0.35

The cu*-ampere-torch2100 / cu*-torch2100 extras cap the CUDA training stack at
torch 2.10.0 because their xformers 0.0.34 wheel hard-requires torch==2.10.0.
There was no torch 2.11.0 counterpart for the CUDA indexes, so anything that
wants torch 2.11.0 (the Docker image, torchao 0.17.0, the rocm7.2 studio path)
could not select a matching unsloth extra: torch==2.11.0 plus
unsloth[cu128-ampere-torch2100] is unsatisfiable (xformers 0.0.34 -> torch 2.10.0).

Add the torch2110 family mirroring the torch2100 layout for cu126/cu128/cu130:
- cu{126,128,130}onlytorch2110: xformers 0.0.35 (linux + win32) plus an explicit
  torch>=2.11.0,<2.12.0 trio. xformers 0.0.35 does not hard-pin torch the way
  0.0.34 pinned 2.10.0, so without the trio a bare resolve floats torch to 2.12.x;
  the pin keeps the "torch2110" name faithful and matches studio's
  torch>=2.11.0,<2.12.0 convention and the existing xpu torch2110 extra.
- cu{126,128,130}-torch2110 and cu{126,128,130}-ampere-torch2110: huggingface +
  bitsandbytes + the matching onlytorch2110, same shape as the torch2100 wrappers.

Resolves cleanly: unsloth[cu128-ampere-torch2110] -> torch 2.11.0+cu128 /
torchvision 0.26.0 / torchaudio 2.11.0 / xformers 0.0.35.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds new dependency extras to pyproject.toml supporting PyTorch 2.11.0 with CUDA 12.6, 12.8, and 13.0 environments. Specifically, it introduces cu126onlytorch2110, cu128onlytorch2110, and cu130onlytorch2110 extras with explicit pins for torch, torchvision, torchaudio, and xformers, along with their corresponding high-level and ampere-specific configurations. There are no review comments, so I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Jul 8, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Jul 8, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@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: ae319b11b0

ℹ️ 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 thread pyproject.toml Resolved
Comment thread pyproject.toml Resolved
…ctor

unsloth/_auto_install.py fell through to RuntimeError("Torch = {v} too
new!") for any installed torch >= 2.10.1, so an environment running torch
2.11.x could not resolve the new cu{cuda}-torch2110 extras. Add a 2.11.x
branch right after the 2.10.1 case. The existing CUDA guard already permits
12.6/12.8/13.0 for torch >= 2.10, matching the cu126/cu128/cu130 torch2110
extras.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@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: bf9bca08e0

ℹ️ 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 thread pyproject.toml Resolved
torch 2.11's default PyPI wheel is CUDA 13.0 (torch 2.10 defaulted to CUDA
12.x), so the bare torch>=2.11 constraints in cu126onlytorch2110 /
cu128onlytorch2110 would resolve a cu130 torch from PyPI alongside the cu126/
cu128 xformers wheel and break at import. Pin the torch/torchvision/torchaudio
trio to the +cu126 / +cu128 local build so it only resolves from the matching
download.pytorch.org index the installer configures (or fails loudly if that
index is absent) instead of silently mismatching. cu130onlytorch2110 stays bare
because torch 2.11's PyPI default already lands on cu130.

Adds tests/test_torch2110_cuda_extras.py to guard the pins.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@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: f757e68dac

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread tests/test_torch2110_cuda_extras.py Resolved
Comment thread unsloth/_auto_install.py Resolved
The cu126/cu128 torch2110 extras pin torch==2.11.0+cuNNN, which only resolves
from the matching PyTorch CUDA index (torch 2.11's default PyPI wheel is CUDA
13.0). _auto_install.py now appends --extra-index-url download.pytorch.org/whl/
cuNNN for exactly the CUDA-12 torch 2.11 selections so the printed install
command resolves; cu130 and non-torch2110 selections are unchanged.

tests/test_torch2110_cuda_extras.py falls back to the tomli backport when
tomllib is unavailable (Python 3.9 / 3.10).
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

2 similar comments
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: c216d27ac4

ℹ️ 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

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: ea33734214

ℹ️ 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".

…se drift

The security audit's hf-stack shard fails on one CRITICAL finding: the
reverse-shell regex matches os.dup2 in sentencepiece/__init__.py. This is
the package's well-known _redirect_wrapper stdout/stderr suppression
helper, verified verbatim against google/sentencepiece's official python
wrapper (python/src/sentencepiece/__init__.py L772/L777). The baseline
already carries this same benign finding for an earlier release; the new
release's matched-code window differs, producing a new evidence_hash, so
the old entry no longer suppresses it. Add the refreshed entry alongside
the old one (older resolves can still occur from cache). One entry added;
no scanner or code changes.
@danielhanchen
danielhanchen force-pushed the add-cu128-torch2110-extra branch from ace4c6d to dacbf89 Compare July 12, 2026 10:26
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@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: dacbf893ba

ℹ️ 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 thread pyproject.toml Resolved
…12 locals

PEP 440 ranks a local build above the unlabelled release of the same
version, so cu130onlytorch2110's range specs let a configured CUDA-12
extra index win: pip verified that torch>=2.11.0,<2.12.0 with
--extra-index-url .../cu126 installs torch 2.11.0+cu126, silently pairing
a CUDA-12 trio with the cu130 xformers wheel. Arbitrary equality
(torch===2.11.0) matches only the unlabelled PyPI default, which is the
CUDA 13.0 build: pip resolves it correctly next to a CUDA-12 extra index,
and uv's first-index strategy fails loudly instead of mismatching.
Regression test updated to lock in the === pins.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Jul 27, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@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: cfc93b7ecf

ℹ️ 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 thread unsloth/_auto_install.py Resolved
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@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: cfc93b7ecf

ℹ️ 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 thread pyproject.toml Resolved
Comment thread unsloth/_auto_install.py Resolved
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: cfc93b7ecf

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Both source reads in tests/test_torch2110_cuda_extras.py called
Path.read_text() with no encoding, so they decode with the platform
default (cp1252 on a stock Windows runner) and break the moment
unsloth/_auto_install.py gains a non-ASCII byte.

tests/test_source_read_encoding.py flags exactly this and was failing
Backend CI on both call sites. Pass encoding = "utf-8", matching the
rest of the test tree.
TORCH_RELEASES_WITHOUT_XFORMERS_WHEELS listed "2110", so the new
cu126/cu128/cu130-torch2110 extras tripped
test_no_extras_invented_for_torch_without_xformers_wheels.

The constant's premise no longer holds. xFormers 0.0.35 is published on
all three indexes, and unlike the cp39-abi3 0.0.34 wheels it is a
stable-ABI build (py39-none) declaring torch>=2.10 with no exact pin, so
it loads under 2.11 rather than only under the 2.10 it was compiled
against. Verified by installing torch 2.11.0+cu128 beside the cu128
0.0.35 wheel: the extension loads, _cpp_library_load_exception is None
and memory_efficient_attention is available, so the silently-degraded
install this test family guards against does not occur.

wheel_utils.py and install.ps1 already map 2.11 onward to 0.0.35, so the
tuple was also the odd one out among the three consumers it is meant to
agree with. Empty it and record what would put a release back in.

XFORMERS_WHEEL_MATRIX is deliberately left alone: its URL assertion
hardcodes cp39-abi3, which 0.0.35 does not use.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 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-04T05:13:01.248668Z 3abcbc4 New commits
ℹ️ 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.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 4, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 4, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: ad12f86b7b

ℹ️ 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".

Collapse the multi-line rationale blocks to one or two lines each and drop the
repeated "same pin as ..." notes on the per-CUDA leaves, which the identical
requirement rows already make obvious. Comments only, no behaviour change.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@danielhanchen
danielhanchen merged commit cc33ff2 into main Sep 4, 2026
84 checks passed
@danielhanchen
danielhanchen deleted the add-cu128-torch2110-extra branch September 4, 2026 07:11
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.

1 participant