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
Stand the torch 2.13 gate down offline and on any configured package …
…index
  • Loading branch information
danielhanchen committed Sep 28, 2026
commit 04d17a4fc99a3d58e38581f2b26b7cfd128b6255
8 changes: 5 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5921,10 +5921,12 @@ _cu130_torch213_platform() {
}

# "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", as does a uv
# upload-date cutoff: "newest on PyPI" is then not what uv may pick.
# which re-resolves under its own cap and would downgrade a newer torch. Any failure answers "no", as does anything
# making public PyPI's newest release not what uv will pick: an upload cutoff, offline mode, another package index.
_pypi_unsloth_admits_torch() {
if [ -n "${UV_EXCLUDE_NEWER:-}" ] || [ -n "${UV_EXCLUDE_NEWER_PACKAGE:-}" ]; then
_pua_off=$(printf '%s' "${UV_OFFLINE:-}" | tr -d '[:space:]' | tr '[:upper:]' '[:lower:]')
case "$_pua_off" in 1|t|true|y|yes|on) echo "no"; return ;; esac
if [ -n "${UV_EXCLUDE_NEWER:-}${UV_EXCLUDE_NEWER_PACKAGE:-}" ] || _mirror_configured uv; then

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 Disable the route for find-links package sources

When UV_FIND_LINKS (or find-links in uv configuration) supplies a newer/internal unsloth distribution, this condition does not reject the gate because _mirror_configured uv checks only index-related settings. The local uv 0.12.1 help pip install describes --find-links as locations providing candidate distributions in addition to registry indexes, so uv can select a release whose torch cap differs from the public-PyPI JSON checked here. The generated override then forces torch 2.13 anyway, and the first update can run that selected release's older setup and downgrade torch—the exact failure this gate is intended to prevent. Treat find-links as an alternate package source or inspect the release uv will actually select.

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.

Not changing this: an Unsloth Studio home that pulls unsloth itself from a find-links location is not a supported setup, and indexes and mirrors, which is where custom sources actually come from, already disable the route.

echo "no"
return
fi
Expand Down
12 changes: 11 additions & 1 deletion tests/sh/test_cu130_torch213_route.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
INSTALL_SH="${1:-$SCRIPT_DIR/../../install.sh}"
_FUNC_FILE=$(mktemp)
{
for fn in _run_bounded _pypi_unsloth_admits_torch _torch_index_url_leaf _cu130_torch213_route _cu130_torch213_platform _torchaudio_for_torch_minor _torch_release_in_window _previous_torch_pin; do
for fn in _mirror_uv_project_config _mirror_configured _run_bounded _pypi_unsloth_admits_torch _torch_index_url_leaf _cu130_torch213_route _cu130_torch213_platform _torchaudio_for_torch_minor _torch_release_in_window _previous_torch_pin; do
sed -n "/^${fn}()/,/^}/p" "$INSTALL_SH"
echo ""
done
Expand Down Expand Up @@ -73,6 +73,16 @@ _pypi_fixture "torch<2.15.0,>=2.4.0"
assert_eq "UV_EXCLUDE_NEWER keeps the old window" "no" "$(UV_EXCLUDE_NEWER=2026-06-01T00:00:00Z _cu130_torch213_route "$CU130")"
assert_eq "UV_EXCLUDE_NEWER_PACKAGE keeps the old window" "no" "$(UV_EXCLUDE_NEWER_PACKAGE=unsloth=2026-06-01T00:00:00Z _cu130_torch213_route "$CU130")"
assert_eq "empty cutoff is no cutoff" "yes" "$(UV_EXCLUDE_NEWER= _cu130_torch213_route "$CU130")"
for off in 1 true TRUE yes on " 1 "; do
assert_eq "UV_OFFLINE='$off' keeps the old window" "no" "$(UV_OFFLINE="$off" _cu130_torch213_route "$CU130")"
done
for off in 0 false no ""; do
assert_eq "UV_OFFLINE='$off' is online" "yes" "$(UV_OFFLINE="$off" _cu130_torch213_route "$CU130")"
done
assert_eq "UV_DEFAULT_INDEX keeps the old window" "no" "$(UV_DEFAULT_INDEX=https://mirror.example/simple _cu130_torch213_route "$CU130")"
assert_eq "UV_INDEX_URL keeps the old window" "no" "$(UV_INDEX_URL=https://mirror.example/simple _cu130_torch213_route "$CU130")"
_UVCFG="$VENV_DIR/uv.toml"; printf '[[index]]\nurl = "https://mirror.example/simple"\ndefault = true\n' > "$_UVCFG"
assert_eq "uv.toml index keeps the old window" "no" "$(UV_CONFIG_FILE="$_UVCFG" _cu130_torch213_route "$CU130")"

echo "=== preservation never waits on PyPI ==="
# Runs install.sh's own block: an existing 2.13 install re-run while PyPI is unreachable or
Expand Down
Loading