Repository navigation
Core: pip extras and auto-install support for torch 2.13 and 2.14 #12151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
1d3b743
9cd5c1a
071747a
9539a27
eb56e24
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,12 +38,16 @@ | |
| elif v < V('2.12.0'): raise RuntimeError(f"Torch = {v} not supported!") | ||
| elif v < V('2.12.1'): x = 'cu{}{}-torch2120' | ||
| elif v < V('2.12.2'): x = 'cu{}{}-torch2121' | ||
| elif v < V('2.13.0'): raise RuntimeError(f"Torch = {v} not supported!") | ||
| elif v < V('2.13.1'): x = 'cu{}{}-torch2130' | ||
| elif v < V('2.14.0'): raise RuntimeError(f"Torch = {v} not supported!") | ||
| elif v < V('2.14.1'): x = 'cu{}{}-torch2140' | ||
|
Comment on lines
+44
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When torch 2.13/2.14 is installed from cu126 on an SM100/SM120 GPU, these branches now emit an install command even though the adjacent comment documents that cu126 stops at SM90 and Blackwell requires CUDA 13. The script already reads Useful? React with 👍 / 👎.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not changing this here: the script only prints the extra matching the torch that is already installed, and torch 2.12 on main behaves the same way. A cu126 torch on a Blackwell card is already unusable before this runs, and the extra reinstalls that same build.
Comment on lines
+44
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When an installed build reports a version such as Useful? React with 👍 / 👎.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same mapping every branch in this script uses: a 2.12.0rc1 build maps to torch2120 on main today. Prerelease handling would be a separate change across all the branches, not something these two lines introduce. |
||
| else: raise RuntimeError(f"Torch = {v} too new!") | ||
| if v > V('2.6.9') and cuda not in ("11.8", "12.6", "12.8", "13.0"): raise RuntimeError(f"CUDA = {cuda} not supported!") | ||
| if v >= V('2.10.0') and cuda not in ("12.6", "12.8", "13.0"): raise RuntimeError(f"Torch = {v} requires CUDA 12.6, 12.8, or 13.0! Got CUDA = {cuda}") | ||
| # torch 2.12 ships on cu126/cu130 only, and cu126 builds stop at sm_90, so Blackwell needs CUDA 13. | ||
| # torch 2.12+ ships on cu126/cu130 only, and cu126 builds stop at sm_90, so Blackwell needs CUDA 13. | ||
| if v >= V('2.12.0') and cuda not in ("12.6", "13.0"): raise RuntimeError(f"Torch = {v} requires CUDA 12.6 or 13.0! Got CUDA = {cuda}") | ||
| x = x.format(cuda.replace(".", ""), "-ampere" if False else "") # is_ampere is broken due to flash-attn | ||
| # torch2110+ extras pin +cuNNN builds, which resolve only from the matching index. | ||
| extra_index = f' --extra-index-url https://download.pytorch.org/whl/cu{cuda.replace(".", "")}' if (x.endswith(('-torch2110', '-torch2120', '-torch2121')) and cuda in ("12.6", "12.8", "13.0")) else '' | ||
| extra_index = f' --extra-index-url https://download.pytorch.org/whl/cu{cuda.replace(".", "")}' if (x.endswith(('-torch2110', '-torch2120', '-torch2121', '-torch2130', '-torch2140')) and cuda in ("12.6", "12.8", "13.0")) else '' | ||
| print(f'pip install --upgrade pip setuptools wheel && pip install --no-deps git+https://github.com/unslothai/unsloth-zoo.git && pip install "unsloth[{x}] @ git+https://github.com/unslothai/unsloth.git" --no-build-isolation{extra_index}') | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every new torch 2.13/2.14 leaf pins torchaudio 2.11 even though torchaudio's native extension must match the torch release line; the repository's own
install.ps1::Test-WoaWheelPairsWithTorchtherefore explicitly rejects the 2.14/2.11 pairing. Because 2.11 no longer constrains torch in its metadata, dependency resolution succeeds but leaves audio operations with an ABI-mismatched extension, so these new extras should omit torchaudio unless a matching compatible build is available.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked on real wheels: torchaudio 2.11.0+cu130 ships abi3 (stable ABI) libraries, and on torch 2.13.0+cu130 and 2.14.0+cu130 its extension loads and forced_align, rnnt_loss and lfilter run on CPU and CUDA. The install.ps1 check is for the custom Windows on ARM builds, which are not abi3.