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
install.sh: an upgrade with the 2.13 route closed keeps a resident to…
…rch above the default range
  • Loading branch information
danielhanchen committed Oct 2, 2026
commit bf1cd08d1394e7a8f9a4866a9d6cb5abc38cdb85
10 changes: 9 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6042,7 +6042,8 @@ _previous_torch_pin() {
_ptp_ver="$1"
_ptp_con="$2"
[ -n "$_ptp_ver" ] || { echo ""; return; }
[ "${UNSLOTH_TORCH_UPGRADE:-0}" = "1" ] && { echo ""; return; }
# $3 = keep: an upgrade with no newer release to move to still keeps the resident one.
[ "${UNSLOTH_TORCH_UPGRADE:-0}" = "1" ] && [ "${3:-}" != "keep" ] && { echo ""; return; }
_ptp_base="${_ptp_ver%%+*}"
# Base must be a plain numeric release; nightly/dev builds never become a pin.
case "$_ptp_base" in
Expand Down Expand Up @@ -7078,6 +7079,13 @@ _PREV_TORCH_PIN=""
_PREV_FALLBACK_CONSTRAINT="$TORCH_CONSTRAINT"
if [ "$SKIP_TORCH" = false ]; then
_prev_pin=$(_previous_torch_pin "$_PREV_TORCH_VER" "$_PRESERVE_TORCH_CONSTRAINT")
# UNSLOTH_TORCH_UPGRADE=1 (Settings > Repair) with the 2.13 route closed (PyPI unreachable, a
# mirror, an older release) must not move a resident release above the default range down.
if [ -z "$_prev_pin" ] && [ "${UNSLOTH_TORCH_UPGRADE:-0}" = "1" ] \
&& [ "$_CU130_NEW_INSTALL_ROUTE" = false ] && [ -n "$_PREV_TORCH_VER" ] \
&& [ "$(_torch_release_in_window "${_PREV_TORCH_VER%%+*}" "$TORCH_CONSTRAINT")" != "yes" ]; then
_prev_pin=$(_previous_torch_pin "$_PREV_TORCH_VER" "$_PRESERVE_TORCH_CONSTRAINT" keep)
fi
if [ -n "$_prev_pin" ]; then
_PREV_TORCH_PIN="$_prev_pin"
TORCH_CONSTRAINT="$_prev_pin"
Expand Down
13 changes: 13 additions & 0 deletions tests/sh/test_cu130_torch213_route.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,19 @@ for gate in unreachable capped open; do
done
UNSLOTH_TORCH_UPGRADE=1; _run_block true "2.11.0+cu130"; unset UNSLOTH_TORCH_UPGRADE
assert_eq "UNSLOTH_TORCH_UPGRADE=1 moves an existing home to 2.13" "torch>=2.13.0,<2.14.0" "$TORCH_CONSTRAINT"
for gate in unreachable capped; do
case "$gate" in
unreachable) export UNSLOTH_PYPI_JSON_URL="http://127.0.0.1:9/unreachable" ;;
capped) _pypi_fixture "torch<2.13.0,>=2.4.0" ;;
esac
UNSLOTH_TORCH_UPGRADE=1
_run_block true "2.13.0+cu130"
assert_eq "upgrade with PyPI $gate keeps a resident 2.13" "torch==2.13.0" "$TORCH_CONSTRAINT"
_run_block true "2.10.0+cu128"
assert_eq "upgrade with PyPI $gate still moves 2.10 to the default" "torch>=2.4,<2.12.0" "$TORCH_CONSTRAINT"
unset UNSLOTH_TORCH_UPGRADE
done
_pypi_fixture "torch<2.15.0,>=2.4.0"
_stub_python 3.12
_run_block false ""
assert_eq "Python 3.12 keeps the old window" "torch>=2.4,<2.12.0" "$_PRESERVE_TORCH_CONSTRAINT"
Expand Down