Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
3ee264a
Studio: install torch 2.13 on new Linux cu130 Python 3.13 installs, k…
danielhanchen Sep 28, 2026
797a7ae
Studio: only default to torch 2.13 once PyPI unsloth admits it; freez…
danielhanchen Sep 28, 2026
d5e2e36
Tighten the torch 2.13 route comments
danielhanchen Sep 28, 2026
90bc5a0
Keep only cu130-served torch on repair; never let pip or an inherited…
danielhanchen Sep 28, 2026
c28dca2
Size the preservation window from the local route alone; keep relativ…
danielhanchen Sep 28, 2026
e5df690
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 28, 2026
2590d3f
Keep the old torch window when a uv upload-date cutoff is set
danielhanchen Sep 28, 2026
af7409e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 28, 2026
5b3f79b
Repair to the default range when no resident release is keepable, lea…
danielhanchen Sep 28, 2026
04d17a4
Stand the torch 2.13 gate down offline and on any configured package …
danielhanchen Sep 28, 2026
4070fa6
Drop a duplicated torchaudio comment
danielhanchen Sep 28, 2026
3a51f0d
Give torch 2.13 only to a fresh home: record legacy-layout torch, nev…
danielhanchen Sep 28, 2026
2122d63
Merge main into r12150
danielhanchen Sep 29, 2026
cdc1933
Treat a legacy .venv with a broken interpreter as an existing install
danielhanchen Sep 30, 2026
91ddcdf
Merge main into r12150
danielhanchen Oct 1, 2026
38edbb5
Desktop: manual Repair installation moves to the newest supported PyT…
danielhanchen Oct 1, 2026
cc868cb
Merge origin/main into studio-torch-213-cu130
danielhanchen Oct 2, 2026
bf1cd08
install.sh: an upgrade with the 2.13 route closed keeps a resident to…
danielhanchen Oct 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Tighten the torch 2.13 route comments
  • Loading branch information
danielhanchen committed Sep 28, 2026
commit d5e2e36cd4814cfbddadb8630755510b8f5f7e02
10 changes: 6 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4359,7 +4359,7 @@ fi
# Companions bounded to torch's window: torchaudio 2.11 dropped its torch pin, so it can drift.
TORCHVISION_CONSTRAINT="torchvision>=0.19,<${_TORCHVISION_CEILING}"
TORCHAUDIO_CONSTRAINT="torchaudio>=2.4,<${_TORCHAUDIO_CEILING}"
# cu130 + Linux x86_64 + Python 3.13 only (see _cu130_torch213_route). torchaudio keeps its window: 2.11 is its last release, stable ABI, and vLLM pairs it with torch 2.13.
# torchaudio keeps its window: 2.11 is its last release (stable ABI) and pairs with torch 2.13.
_CU130_TORCH_CEILING="2.15.0"
_CU130_NEW_INSTALL_TORCH="torch>=2.13.0,<2.14.0"

Expand Down Expand Up @@ -5914,7 +5914,8 @@ _cu130_torch213_route() {
_pypi_unsloth_admits_torch "2.13.0"
}

# "yes" only when the newest unsloth on PyPI declares a torch range containing $1. `studio update` first runs the setup code of the INSTALLED release, which re-resolves unsloth under its own torch cap: a 2.13 install next to a release capped below it is downgraded to PyPI's generic torch on the first update. Any failure (offline, mirror without the JSON API, unparsable spec) answers "no", which keeps the pre-2.13 window. UNSLOTH_PYPI_JSON_URL points it at a mirror's JSON API.
# "yes" only when the newest unsloth on PyPI admits torch $1: `studio update` runs the INSTALLED release's setup,
# which re-resolves under its own cap and would downgrade a newer torch. Any failure answers "no".
_pypi_unsloth_admits_torch() {
_pua_url="${UNSLOTH_PYPI_JSON_URL:-https://pypi.org/pypi/unsloth/json}"
_pua_out=$(_run_bounded --secs 20 "$VENV_DIR/bin/python" - "$_pua_url" "$1" 2>/dev/null <<'PY' || true
Expand Down Expand Up @@ -5945,7 +5946,7 @@ PY
[ "$(printf '%s' "$_pua_out" | tail -n 1)" = "yes" ] && echo "yes" || echo "no"
}

# torchaudio for a kept torch minor: 2.11 is the last release (stable ABI, no torch pin), so newer minors pair with it.
# torchaudio 2.11 is the last release (stable ABI), so newer torch minors pair with it.
_torchaudio_for_torch_minor() {
if [ "$1" -ge 12 ] 2>/dev/null; then
echo "torchaudio==2.11.*"
Expand Down Expand Up @@ -6971,7 +6972,8 @@ case "$_torch_index_leaf" in
;;
esac
fi # _torch_index_pinned guard (Radeon + Strix reroute)
# Linux x86_64 on the cu130 index with Python 3.13 is the one route with Unsloth-built flash-attn / causal-conv1d / mamba-ssm wheels for torch 2.13 and 2.14 (release prebuilt-wheels-cu13, cp313 only), so new installs there get 2.13, the torch vLLM and SGLang pin. Preservation keeps its own wider window so an existing 2.4-2.14 install stays on its release; every other route keeps TORCH_CONSTRAINT for both.
# Only this route has prebuilt kernel wheels for torch 2.13/2.14 (prebuilt-wheels-cu13, cp313), so new installs get 2.13;
# preservation keeps a wider window so an existing 2.4-2.14 install stays on its release.
_PRESERVE_TORCH_CONSTRAINT="$TORCH_CONSTRAINT"
if [ "$SKIP_TORCH" = false ] && [ "$(_cu130_torch213_route "$TORCH_INDEX_URL")" = "yes" ]; then
_PRESERVE_TORCH_CONSTRAINT="torch>=2.4,<${_CU130_TORCH_CEILING}"
Expand Down
5 changes: 1 addition & 4 deletions studio/install_python_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,7 @@ def _torch_index_leaf(url: str) -> str:
"torchaudio>=2.4,<2.12.0",
)

# cu130 + Linux x86_64 + CPython 3.13 is the one route with Unsloth-built flash-attn /
# causal-conv1d / mamba-ssm wheels for torch 2.13 and 2.14 (install.sh _cu130_torch213_route).
# A repair there keeps the resident 2.4-2.14 release and only falls back to 2.13 when none
# is readable, so `studio update` never moves a working install to another torch.
# The install.sh _cu130_torch213_route: a repair keeps the resident 2.4-2.14 release, falling back to 2.13 only when unreadable.
_CU130_PRESERVE_TORCH_CEILING_MINOR = 15
_CU130_NEW_INSTALL_TORCH_PKG_SPEC: tuple[str, str, str] = (
"torch>=2.13.0,<2.14.0",
Expand Down
Loading