docker: tighten comments across the Blackwell image and helpers

Condense the verbose explanatory comments added by this branch to their essential
points without dropping any load-bearing rationale. Touches comments and
docstrings only, no code changes. Leaves the stable-tag gate rationale, the
byte-identical enable= sync notes, and the update-alternatives pin comment as is.
This commit is contained in:
Daniel Han 2026-07-18 11:49:15 +00:00
commit a26ead4957
33 changed files with 761 additions and 1300 deletions

View file

@ -1028,8 +1028,8 @@ def _detect_cuda_torch_index_url() -> str:
(e.g. NVIDIA detected only via the /proc/driver/nvidia/gpus fallback).
"""
# Explicit override (parity with install.sh / install.ps1):
# UNSLOTH_TORCH_INDEX_FAMILY=cu128|cu130|cu126|cpu|... pins the wheel
# index when probing is wrong or impossible (no GPU at build time, CI).
# UNSLOTH_TORCH_INDEX_FAMILY=cu128|cu130|cu126|cpu|... pins the wheel index
# when probing is wrong or impossible (no GPU at build time, CI).
family = os.environ.get("UNSLOTH_TORCH_INDEX_FAMILY")
if family:
return f"{_PYTORCH_WHL_BASE}/{family}"
@ -2070,9 +2070,8 @@ def install_python_stack() -> int:
# --local overlays a local repo checkout after updating deps.
local_repo = os.environ.get("STUDIO_LOCAL_REPO", "")
# unsloth-zoo git ref for the --local overlay. Honor UNSLOTH_ZOO_REF (the
# Docker publish workflow / unsloth-studio-update resolve one ref and forward
# it) so the Studio venv can track the operator-requested zoo instead of
# always main. Unset -> main, byte-identical to the previous bare git URL.
# publish workflow / unsloth-studio-update forward one ref) so the Studio venv
# tracks the requested zoo, not always main. Unset -> main.
zoo_ref = os.environ.get("UNSLOTH_ZOO_REF", "").strip() or "main"
zoo_git_spec = "unsloth-zoo @ git+https://github.com/unslothai/unsloth-zoo@" + zoo_ref
base_total = 11 if IS_WINDOWS else 12 # +1 for the anyio repair check (step 8b)