Commit graph

10 commits

Author SHA1 Message Date
Daniel Han
9b7eaf8f0c studio: make uv optional + fix --system for Colab
Three fixes based on review:

1. Make uv truly optional: _bootstrap_uv() now only checks if uv is
   already on PATH. It no longer tries to pip install uv. If uv is
   not present, pip is used with zero changes to behavior.

2. Add --system flag for Colab: on Colab there is no venv (packages
   install into system Python). uv requires --system in this case,
   otherwise it errors with "No virtual environment found". Added
   _in_virtualenv() check that detects VIRTUAL_ENV, sys.real_prefix,
   or sys.base_prefix != sys.prefix.

3. Fix label printed twice on uv fallback: when uv fails and falls
   back to pip, the label now says "(pip)" to distinguish from the
   initial uv attempt, instead of printing the same label twice.

Tested:
  - venv path: no --system flag, uv installs correctly
  - no-venv path (Colab sim): --system flag added automatically
  - full unsloth studio setup + training run (Llama-3.2-1B, 10 steps)
2026-03-14 00:54:09 -07:00
Daniel Han
a7a66a66b9 studio: address review feedback
install_python_stack.py:
- Print uv error output on failure for debuggability
- Refactor pip_install() to use early return after uv success,
  removing duplicated pip command path

setup.sh:
- Guard nvidia-smi command substitution with || true so it does
  not abort the script under set -euo pipefail when nvidia-smi
  fails (e.g., containerized environments, driver quirks)
- Read all GPU compute capabilities and deduplicate, so
  mixed-GPU hosts get kernels built for all present architectures
  instead of only the first GPU
2026-03-14 00:54:09 -07:00
pre-commit-ci[bot]
174d61e0f5 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-03-14 00:54:09 -07:00
Daniel Han
a537ece7eb studio: use uv for Python package installs (8x faster)
Replace pip with uv in install_python_stack.py to speed up the Python
dependency installation phase of `unsloth studio setup`.

- Add _bootstrap_uv() that checks for uv on PATH, and if not found,
  installs it via pip. Falls back to pip if uv is unavailable.
- Translate pip flags to uv equivalents (--no-cache-dir dropped since
  uv caching is fast, --force-reinstall becomes --reinstall).
- Add --torch-backend=auto so uv auto-detects CUDA version for
  PyTorch ecosystem packages.
- Per-install fallback: if any uv install step fails, it retries that
  step with pip before exiting.

Measured on clean venv setup:
  Python packages (pip):  2m 28s
  Python packages (uv):  18s
  Speedup:               ~8x

Total setup time goes from ~4m 35s to ~2m 30s (llama.cpp build is
now the bottleneck at 1m 40s).
2026-03-14 00:54:09 -07:00
LeoBorcherding
3ab282fd40 fix: install data-designer plugin non-editable for Colab compatibility
Editable installs (-e) work via a .pth file that is only processed at
Python startup. In Colab the kernel is already running when setup.sh
installs the plugin, so the .pth file never gets picked up and
data_designer_unstructured_seed is not importable.

Remove -e so pip copies the package files directly into site-packages,
which the live kernel can find immediately. Local venv installs are
unaffected since the venv is always created fresh before install.
2026-03-13 13:44:08 -07:00
Roland Tannous
47654cb91c Final cleanup 2026-03-12 18:28:04 +00:00
Roland Tannous
a2baf80511 Update license headers 2026-03-12 17:23:10 +00:00
Manan17
fbccac8cee shifting setup & co inside studio 2026-03-11 20:19:52 +00:00
Roland Tannous
daa50d0756 Revert "Merge pull request #347 from unslothai/feature/studio-storage-roots"
This reverts commit 6b43e33ff1, reversing
changes made to 9edadaf21f.
2026-03-10 01:52:47 +00:00
Manan17
32569fc8a8 shifting setup & co inside studio 2026-03-09 23:48:31 +00:00
Renamed from install_python_stack.py (Browse further)