unsloth/studio/backend/requirements
Daniel Han f5f9e217c1
studio: select torchao version from the installed torch (#6400)
* studio: select torchao version from the installed torch

The Studio installer pins CUDA torch to torch>=2.4,<2.11 and its driver
ladder selects the cu130 wheel index on recent NVIDIA drivers, so pip
resolves torch 2.10.0. overrides.txt hard-pinned torchao==0.14.0, whose
C++ extensions are built against torch 2.9.0, so torchao skipped its cpp
kernels ("Skipping import of cpp extensions due to incompatible torch
version 2.10.0+cu130 for torchao version 0.14.0") and fell back to the
slow Python path. Every CUDA index now tops out at torch 2.10.0, so this
hit most modern installs, not just cu130.

Pick the torchao version matching the torch actually installed in the
venv (table: pytorch/ao#2919): torch 2.10.x -> torchao 0.16.0, 2.11.x ->
torchao 0.17.0, otherwise the previous 0.14.0 (so torch <=2.9 is
unchanged). The installer reads torch.__version__ from the venv via a
cross-platform sys.executable probe (probe_torch_wheel_env is Linux-only)
and passes the computed spec positionally to the existing force-reinstall
override step; overrides.txt becomes a pointer to that logic. torchao's
Python API (Float8Tensor, used by unsloth/kernels/utils.py) imports
cleanly on 0.16.0/0.17.0, verified against torch 2.9.1.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* studio: address review on torchao selection

- Clean the torch minor of pre-release/dev suffixes before parsing
  (e.g. '2.10rc1' -> minor 10), matching wheel_utils.probe_torch_wheel_env.
- Pass _windows_hidden_subprocess_kwargs() to the torch-version probe so
  it does not flash a console window on Windows (no-op elsewhere).
- Use _safe_print for the selection log line, consistent with the file's
  other status output (safe on non-UTF-8 consoles).

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-06-17 04:09:40 -07:00
..
single-env Studio: make code comments and docstrings more succinct (#6029) 2026-06-08 23:07:28 -07:00
__init__.py Final cleanup 2026-03-12 18:28:04 +00:00
base.txt move requirements/ to studio/backend/ and update paths in setup.sh 2026-02-17 19:02:25 +00:00
extras-no-deps.txt change torchcodec version to 0.10.0 in extra-no-deps (#5043) 2026-04-16 19:50:57 +04:00
extras.txt Update vulnerable dependencies to patched versions 2026-06-03 05:08:00 -07:00
no-torch-runtime.txt Add RAG runtime deps to no-torch-runtime.txt (#6236) 2026-06-12 02:54:26 -07:00
overrides.txt studio: select torchao version from the installed torch (#6400) 2026-06-17 04:09:40 -07:00
studio.txt feat(studio): implement S3 dataset loading (completes #5951) (#6222) 2026-06-12 14:52:04 +02:00
triton-kernels.txt move requirements/ to studio/backend/ and update paths in setup.sh 2026-02-17 19:02:25 +00:00