unsloth/scripts
Daniel Han c31a6e876d fix(install,studio): address Codex round-4 review (6 of 7 comments real)
- install.sh: gate the new aarch64 bitsandbytes block on SKIP_TORCH=false --
  with --no-torch/UNSLOTH_NO_TORCH (GGUF-only install) it would have pulled
  torch back into the venv through bitsandbytes' dependencies.

- studio worker: in the new Spark OOM-guard section, decide
  PYTORCH_CUDA_ALLOC_CONF (expandable_segments) BEFORE the guard's first CUDA
  touch -- get_device_properties initializes the CUDA allocator, after which
  the env var is ignored, and the later `import unsloth`
  (patch_dgx_spark_memory_config) is too late for the worker process. Uses
  the same CUDA-free nvidia-smi name sniff, append-don't-override, and
  UNSLOTH_NO_EXPANDABLE_SEGMENTS opt-out as the library patch. Live-verified
  on the N1X: env set while torch.cuda.is_initialized() is still False.

- uninstall.ps1: only run `fuser -k 8888/tcp` in a probed WSL distro when an
  Unsloth install actually exists there (checked BEFORE the rm deletes the
  marker) -- an unrelated listener on 8888 (e.g. Jupyter) in a clean distro
  must survive a Windows-side uninstall. The Unsloth-specific pkills stay
  unconditional.

- install.ps1 + uninstall.ps1: persist the chosen WSL distro to
  %LOCALAPPDATA%\Unsloth\wsl-distro.txt at install; uninstall reads it
  (before removing the directory) and prepends it to the cleanup candidates,
  so a custom UNSLOTH_WSL_DISTRO install is cleaned without the env var
  being set again at uninstall time.

- provision_llama_cuda.sh: honor UNSLOTH_LLAMA_PR (numeric-validated,
  best-effort fetch of pull/N/head after clone) so a provisioned tree
  matches a PR pin the way setup.sh does; and require only llama-server in
  the main cmake build (mirroring setup.sh), building the helper targets
  (llama-cli/quantize/mtmd-cli/gguf-split) best-effort afterwards -- an
  older UNSLOTH_LLAMA_TAG pin lacking a newer helper target no longer fails
  the whole provision.

Not changed: the "--tauri rejection doesn't restore the venv rollback"
comment is incorrect -- the rejection returns through Exit-InstallFailure,
which itself calls Restore-StudioVenvRollback.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 23:12:47 -07:00
..
data CI: scope GITHUB_TOKEN permissions, add MLX CI, unblock ~60 skipped tests (#5312) 2026-05-11 03:19:13 -07:00
check_frontend_dep_removal.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
check_new_install_scripts.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
enforce_kwargs_spacing.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
install_gemma4_mlx.sh Update Install Scripts (#5968) 2026-06-03 05:39:42 -07:00
install_qwen3_6_mlx.sh Update Install Scripts (#5968) 2026-06-03 05:39:42 -07:00
lint_workflow_triggers.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
lockfile_supply_chain_audit.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
notebook_to_python.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
notebook_validator.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
run_ruff_format.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
scan_npm_packages.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
scan_packages.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
stamp_studio_release.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
uninstall.ps1 fix(install,studio): address Codex round-4 review (6 of 7 comments real) 2026-06-09 23:12:47 -07:00
uninstall.sh Merge origin/main into woa-nvidia-wsl-fallback 2026-06-03 07:39:46 -07:00
verify_comment_only_diff.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
verify_import_hoist.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00