unsloth/docker
danielhanchen 0d574d8161 Address reviewer-2 findings on PR #5748
Round-2 of the 12-persona reviewer.py pass found 17 issues. Address the
P1s + the regression-class P2s in this commit; the remaining nits are
left for a follow-up cleanup pass.

1. unsloth/_gpu_init.py: the `NVIDIA_VISIBLE_DEVICES in os.environ` check
   triggered for every NVIDIA-runtime container including `--gpus all`
   (NVIDIA_VISIBLE_DEVICES=all is the default). Gate strictly on a
   non-special device list. Also drop the precondition that the env var
   was absent: if the user already pinned TORCHINDUCTOR_COMPILE_THREADS=1
   we should still plant the UNSLOTH_FORCE_SINGLE_COMPILE_WORKER sentinel
   so the zoo-side patch knows to preserve the forcing.

2. unsloth/_gpu_init.py: after the post-`import unsloth_zoo` reassertion,
   monkey-patch `unsloth_zoo.temporary_patches.common.determine_compile_threads`
   to return 1, so any later `torch.compile` call that rebuilds the
   options dict still sees the single-worker forcing even if a downstream
   patch_torch_compile pops the env var again.

3. docker/Dockerfile: torchaudio==2.11.0 mismatched the torch==2.10.0
   release pairing; pin to 2.10.0 so the ABI is correct and the audio
   stack matches torch/cu128.

4. docker/Dockerfile: drop `12.1+PTX` from TORCH_CUDA_ARCH_LIST. The
   cu128 toolkit compiler does not know about compute_121; the trailing
   PTX entry forced nvcc to emit a `sm_121` gencode that breaks any
   in-container source builds.

5. docker/smoke_test.py: the device-capability floor said `cap[0] < 8`,
   rejecting Turing (sm_75) while the Dockerfile + entrypoint advertise
   sm_75 as supported. Lower the smoke floor to sm_75 and print a hint
   that bf16 is not available on Turing.

6. docker/run.sh: `-it` is unconditional; CI / non-TTY invocations died
   with "the input device is not a TTY". Probe `[ -t 0 ] && [ -t 1 ]`
   first. Also remove `set -x` which echoed the forwarded HF_TOKEN /
   WANDB_API_KEY / UNSLOTH_LICENSE values to stdout.

7. docker/test_locally.sh: `-e HF_TOKEN="${HF_TOKEN:-}"` either pasted
   the secret verbatim into the process arg list or shadowed any
   in-container value with an empty string. Forward conditionally.

8. .github/workflows/docker-publish.yml: gate `latest` on default branch
   AND on `unsloth_ref` not being overridden via workflow_dispatch.
   Otherwise a maintainer testing a feature SHA from main could overwrite
   `:latest` with non-main source.

9. docker/Dockerfile.studio: add an `UNSLOTH_STUDIO_REF` build-arg so
   the Studio companion image is pinned to a known unsloth ref instead
   of cloning `main` whenever it builds.
2026-05-24 15:24:20 +00:00
..
.dockerignore Add entrypoint with GPU pre-flight checks + opinionated run.sh wrapper 2026-05-24 07:04:48 +00:00
build.sh Add Docker build for Blackwell that runs on any NVIDIA GPU host 2026-05-24 06:52:58 +00:00
Dockerfile Address reviewer-2 findings on PR #5748 2026-05-24 15:24:20 +00:00
Dockerfile.studio Address reviewer-2 findings on PR #5748 2026-05-24 15:24:20 +00:00
entrypoint.sh entrypoint.sh: correct driver-floor message (570+ unconditionally on cu128) 2026-05-24 11:36:36 +00:00
freeze.sh Add Docker build for Blackwell that runs on any NVIDIA GPU host 2026-05-24 06:52:58 +00:00
hf_pull.sh hf_{push,pull}.sh: use new hf CLI, fall back to deprecated huggingface-cli 2026-05-24 09:40:22 +00:00
hf_push.sh hf_{push,pull}.sh: use new hf CLI, fall back to deprecated huggingface-cli 2026-05-24 09:40:22 +00:00
run.sh Address reviewer-2 findings on PR #5748 2026-05-24 15:24:20 +00:00
setup_qemu.sh Add linux/arm64 (DGX Spark / Grace) support via QEMU at build time 2026-05-24 10:34:59 +00:00
smoke_test.py Address reviewer-2 findings on PR #5748 2026-05-24 15:24:20 +00:00
test_locally.sh Address reviewer-2 findings on PR #5748 2026-05-24 15:24:20 +00:00