Repository navigation
Studio: torch 2.13 for new Linux aarch64 cu130 Python 3.13 installs, existing installs keep their torch - #13380
Conversation
|
@codex review |
|
@codex security review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7cfbf277d1
ℹ️ 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".
| machine = platform.machine().lower() | ||
| if sys.platform.startswith("linux"): | ||
| return True | ||
| return machine in ("x86_64", "amd64", "aarch64", "arm64") |
There was a problem hiding this comment.
Exclude ARM torch 2.9 from the preservation route
On a Linux aarch64 Python 3.13 environment with resident torch 2.9, this newly enables _cuda_repair_torch_specs, which returns torchaudio==2.9.*; both CUDA repair call sites install the complete trio, but the cu130 index publishes torch 2.9 for aarch64 and no matching torchaudio 2.9 aarch64 wheel (torch index, torchaudio index). Consequently, a repair that previously used the default range now becomes unresolvable, so the ARM route needs an architecture-aware lower bound or companion-package handling.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 22a760b. The cu130 index has aarch64 torch 2.9 but no torchvision 0.24 / torchaudio 2.9 for it, so on Linux aarch64 the repair only keeps a resident 2.10 or newer; 2.9 there falls back to the default range as before. x86_64 still keeps 2.9. Tests cover both.
| # aarch64 too: prebuilt-wheels-cu13 carries linux_aarch64 builds (Grace, GB10), and upstream's stop at torch 2.10. | ||
| case "$_ARCH" in x86_64|amd64|aarch64|arm64) ;; *) echo "no"; return ;; esac |
There was a problem hiding this comment.
Publish ARM kernel assets before selecting torch 2.13
For every fresh aarch64 cu130 install this branch now selects torch 2.13 on the premise that the custom ARM kernels exist, but the referenced release currently describes only Linux x86_64 builds and exposes no linux_aarch64 assets (prebuilt-wheels-cu13 release); the workflow also keeps ARM opt-in rather than producing it in a normal dispatch. Setup therefore skips the missing flash-attn wheel, and SSM models fall through to source packages whose torch-2.13 C++20 patch exists only in the wheel-building workflow, making those models fail to initialize. Publish the ARM assets atomically with this route or keep the route closed until their URLs are available.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The release already carries all six linux_aarch64 wheels (flash_attn 2.8.4, causal_conv1d 1.7.0, mamba_ssm 2.3.2.post1 for torch 2.13 and 2.14, cp313), each with a Sigstore bundle and a SHA256SUMS entry, and the notes list a Linux aarch64 section. They were published before this PR was opened; ARM being opt-in in the workflow only affects future dispatches. A fresh aarch64 install on this branch was run end to end and resolves torch 2.13 plus the release flash-attn and causal-conv1d, both importing.
| case "$OS" in linux|wsl) ;; *) echo "no"; return ;; esac | ||
| case "$_ARCH" in x86_64|amd64) ;; *) echo "no"; return ;; esac | ||
| # aarch64 too: prebuilt-wheels-cu13 carries linux_aarch64 builds (Grace, GB10), and upstream's stop at torch 2.10. | ||
| case "$_ARCH" in x86_64|amd64|aarch64|arm64) ;; *) echo "no"; return ;; esac |
There was a problem hiding this comment.
Gate the ARM torch 2.13 route on glibc 2.35
On supported aarch64 hosts with glibc 2.28–2.34, this enables torch 2.13 even though the linux_aarch64 kernel wheels are built on Ubuntu 22.04 with a documented practical glibc 2.35 floor (.github/scripts/prebuilt_wheels.py:84-89) and are tagged generically enough for pip to accept them. Their import verification then rejects them; for a Mamba model the fallback source build lacks the workflow-only C++20 patch required by torch 2.13 and ensure_ssm_runtime raises, whereas the former torch 2.11 route could build that source. Either retain the old route below glibc 2.35 or publish wheels carrying a compatible manylinux floor.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 22a760b. The new-install choice now also needs glibc 2.35 or newer (read the same way as the uv installer check; musl or an unreadable libc answers no), on x86_64 and aarch64 alike since both builds share that floor. Below it a fresh install stays on the default range. The preservation window is unchanged, so an existing 2.13/2.14 is still kept.
| case "$OS" in linux|wsl) ;; *) echo "no"; return ;; esac | ||
| case "$_ARCH" in x86_64|amd64) ;; *) echo "no"; return ;; esac | ||
| # aarch64 too: prebuilt-wheels-cu13 carries linux_aarch64 builds (Grace, GB10), and upstream's stop at torch 2.10. | ||
| case "$_ARCH" in x86_64|amd64|aarch64|arm64) ;; *) echo "no"; return ;; esac |
There was a problem hiding this comment.
Exclude free-threaded Python 3.13 from the ARM route
When --python points at a free-threaded aarch64 Python 3.13 interpreter, the new ARM branch accepts it because the following probe checks only sys.version_info, then requests torch 2.13; the cu130 index has cp313 aarch64 wheels but no cp313t build for torch 2.13 (official torch index), so a fresh install fails resolution. The repository's ARM kernel resolver likewise explicitly supports only GIL-enabled cp313, so this route should also inspect Py_GIL_DISABLED before opting in.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 22a760b. The new-install choice now probes Py_GIL_DISABLED and requires a GIL-enabled interpreter; torch 2.13 has no cp313t wheel on any platform, so a free-threaded 3.13 stays on the default range.
…pairs keep only 2.10+ New installs on a host whose glibc is older than the kernel wheels' floor, or on a free-threaded interpreter (no cp313t torch 2.13), stay on the default range. Existing installs keep their release as before. A repair on aarch64 no longer pins a resident torch 2.9, which has no matching torchvision / torchaudio on the cu130 index.
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
New Studio installs on Linux aarch64 (Grace / GH200 / GB200, DGX Spark) with an NVIDIA driver on the cu130 route and Python 3.13 now get torch 2.13, the same route #12150 added for x86_64. That is the torch the
linux_aarch64flash-attn 2.8.4, causal-conv1d 1.7.0 and mamba-ssm 2.3.2.post1 wheels now onprebuilt-wheels-cu13are built for (#13261, resolved by #13262).Today aarch64 stays on the torch 2.11 default and loads upstream's torch 2.10 wheels through the reuse window (flash-attn 2.8.1, causal-conv1d 1.6.1, mamba-ssm 2.3.x), which still work. This puts aarch64 on the same torch and the same kernel builds as x86_64 instead of a separate, older set.
What changes
install.sh_cu130_torch213_platformacceptsaarch64/arm64as well asx86_64/amd64. Everything else about the route is unchanged: cu130 index, Linux or WSL, a CPython 3.13 venv, the--package unslothgate, and the PyPI check that the newest unsloth admits torch 2.13.install_python_stack.pyapplies the same machine set in_is_cu130_route_machine(was_is_native_x86_64), sostudio updateand the repair paths keep a resident aarch64 2.13 / 2.14 instead of moving it back under the<2.12default. Windows is untouched: Windows x64 only, and an emulated x64 interpreter on Windows on ARM stays excluded.The new-install choice (on both architectures) also needs glibc 2.35 or newer, the floor the kernel wheels are built and checked against, and a GIL-enabled interpreter, since torch 2.13 has no cp313t wheel. Below that a fresh install stays on the default range. Neither check narrows the preservation window.
On aarch64 a repair keeps only a resident 2.10 or newer: the cu130 index has aarch64 torch 2.9 but no torchvision 0.24 / torchaudio 2.9 for it.
Existing installs keep the torch they have, exactly as on x86_64;
UNSLOTH_TORCH_UPGRADE=1opts in.Tests
tests/sh/test_cu130_torch213_route.sh: Linux aarch64 cu130 py3.13 takes the route, 32-bit ARM does not; glibc 2.28 / 2.31 / 2.34 and a free-threaded 3.13 do not take it on either architecture but keep the preservation window (104 checks).studio/backend/tests/test_cu130_repair_torch_specs.py: a resident release is kept on Linux aarch64 as on x86_64 and Windows x64; armv7l and macOS arm64 stay on the default range; aarch64 torch 2.9 repairs to the default range while x86_64 keeps it.ubuntu-24.04-arm install, no GPU, cu130 forced
install.shprebuilt-wheels-cu13, importsinstall-kernels causal_conv1dprebuilt-wheels-cu13, importsexisting install has torch 2.13.0+cu130 -- keeping it, torch unchangedNot covered