unsloth/studio
Daniel Han 485dcaae37 Add ROCm torch reinstall support to install_python_stack.py
When a Linux host has ROCm installed but the venv received CPU-only
torch (common when pip resolves torch from PyPI without an explicit
index URL), the new _ensure_rocm_torch() function detects this and
reinstalls torch with the correct ROCm wheels.

New functions:
- _detect_rocm_version(): probes /opt/rocm version files, hipconfig,
  and ROCM_PATH to determine (major, minor) of the installed ROCm stack
- _ensure_rocm_torch(): checks whether torch is GPU-enabled; if not and
  ROCm is present, reinstalls torch from the best-matching ROCm wheel
  index and installs bitsandbytes for AMD

The ROCm version-to-wheel mapping covers ROCm 6.0 through 7.1. ROCm
7.2 is excluded from the active mapping because the only torch build
on that index (2.11.0) exceeds the current upper bound (<2.11.0);
ROCm 7.2 hosts get the rocm7.1 wheels via the >= fallback.

The torch GPU probe subprocess has a 30-second timeout to prevent
hangs if torch import stalls (e.g. broken CUDA/HIP driver).

The step count is incremented on Linux (non-macOS, non-no-torch)
to account for the new "ROCm torch check" progress step.
2026-03-31 08:34:05 +00:00
..
backend fix: replace hard timeout with inactivity timeout for model loading (#4707) 2026-03-31 07:35:04 +04:00
frontend fix: skip download progress polling for exported GGUF models (#4709) 2026-03-31 07:21:23 +04:00
__init__.py Final cleanup 2026-03-12 18:28:04 +00:00
install_llama_prebuilt.py fix(studio): source-build fallback prefers Unsloth's tested tag over upstream latest (#4593) 2026-03-25 07:25:47 -07:00
install_python_stack.py Add ROCm torch reinstall support to install_python_stack.py 2026-03-31 08:34:05 +00:00
LICENSE.AGPL-3.0 Add AGPL-3.0 license to studio folder 2026-03-09 19:36:25 +00:00
setup.bat Final cleanup 2026-03-12 18:28:04 +00:00
setup.ps1 Fix/bun windows bin detection (#4703) 2026-03-30 21:58:33 +04:00
setup.sh Fix/bun windows bin detection (#4703) 2026-03-30 21:58:33 +04:00
Unsloth_Studio_Colab.ipynb Allow install_python_stack to run on Colab (#4633) 2026-03-27 00:29:27 +04:00