Repository navigation
Studio Linux update: torch repair and the source build read the NVIDIA driver library, a CPU wheel recorded as CUDA is repaired, a satisfied pin keeps the GPU prebuilt - #11008
Conversation
…PU wheel the install recorded as CUDA is repaired; a satisfied version pin keeps the GPU prebuilt
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…rary after unparseable capabilities for PR #11008
|
@codex security review |
…ublished release pins exactly, for PR #11008
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
From a CI sweep: your --- a/studio/install_python_stack.py
+++ b/studio/install_python_stack.py
@@ -3933,7 +3933,9 @@ def _ensure_cuda_torch() -> None:
and not _deliberate_cpu_torch()
- and _is_cuda_family_leaf(_torch_index_leaf(_detect_cuda_torch_index_url(known_only = True) or ""))
+ and _is_cuda_family_leaf(
+ _torch_index_leaf(_detect_cuda_torch_index_url(known_only = True) or "")
+ )
):Reproduced against The reason it did not autofix itself is not yours. main is currently unformatted relative to its own hook, in three files from #10989 and #7536, so the autofix patch is computed over your merge tree and then will not apply to your head. Your run says so: Not touching the branch, since you have it in flight. |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…A driver library, a CPU wheel recorded as CUDA is repaired, a satisfied pin keeps the GPU prebuilt (unslothai#11008) * Torch repair and the source build read the NVIDIA driver library; a CPU wheel the install recorded as CUDA is repaired; a satisfied version pin keeps the GPU prebuilt * Match pinned refs the installer's way and fall back to the driver library after unparseable capabilities for PR unslothai#11008 * Register the installer module before importing it in the keep guard * Exact match first for fork release tags; test the commit-prefix pin * Repair any CPU torch nobody chose on an NVIDIA host at the next update * Probe capabilities are all or nothing for the source build, for PR unslothai#11008 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Repair a CPU wheel only where the driver runs a CUDA wheel; compare published release pins exactly, for PR unslothai#11008 * A CUDA family named this run outranks the pinned cpu record, for PR unslothai#11008 * Match a commit pin against the marker's source ref fields too, for PR unslothai#11008 * Repair a CPU wheel only when the driver's CUDA family is known, for PR unslothai#11008 * Apply the repository kwarg spacing, for PR unslothai#11008 --------- Co-authored-by: danielhanchen <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Three Linux gaps left after #10975 and #10985, all on the update path a Desktop or
unsloth studio updaterun takes.What was wrong
_ensure_cuda_torchreads the host's compute capabilities from nvidia-smi only, so on a host where it is absent or stale the check that swaps a kernel-less cu128/cu130 wheel for cu126 returned early. Studio: read the NVIDIA inventory from NVML or the CUDA driver when nvidia-smi cannot answer #10985 taught the index selector to read the driver library; the repair beside it still did not.+cpubehind, and an install that ran while the GPU was not detected recordscpuautomatically. Windows has the flavour invariant for this; Linux resolves the expected flavour and only records it, and_ensure_cuda_torchtreated any CPU wheel without a CUDA pin as deliberate.setup.shreads--query-gpu=compute_capto chooseCMAKE_CUDA_ARCHITECTURES, and an empty list means a CPU build (studio/setup.sh: validate source-built llama.cpp and guard empty CUDA arch detection #5854). The probe module beside it lists the same capabilities._gpu_prebuilt_to_keep_over_cpu_buildtreats anyUNSLOTH_LLAMA_TAG/UNSLOTH_LLAMA_RELEASE_TAGpin as "not this install", so an update that failed to fetch the pinned release replaced the working GPU prebuilt of that very version with a CPU source build.The change
_host_compute_sms()reads nvidia-smi first and the driver library second;_ensure_cuda_torchuses it, and_inventory_compute_smsis shared with_detect_cuda_torch_index_url(one unreadable row still voids the answer, as with nvidia-smi).UNSLOTH_TORCH_BACKEND=cpu, or a manifest that recordedcpuas named rather than automatically selected (the distinctionrecorded_torch_flavor_was_pinnedexists for). A hidden GPU still leaves it alone. The message names the recorded CUDA family when there is one, so the next update after a CPU wheel slipped in puts CUDA torch back.setup.sh's source build reads the capabilities fromnvidia_probe.pywhen nvidia-smi gives none;UNSLOTH_NVIDIA_LIBRARY_PROBE=0turns that off as everywhere else.tag/release_tagthrough_installed_prebuilt_ref_matches: an exact match, or the installer's ownrefs_match(branch aliases and commit prefixes, so a short commit pin matches the recorded full one), keeping the install when they match and replacing it otherwise.Tests
tests/studio/install/test_cuda_repair.py: the inventory supplies the SMs when nvidia-smi cannot and a cu130 wheel on a Volta card is moved to cu126; no inventory stays blind; an unreadable row is not evidence; nvidia-smi still wins when it answers; a recorded cu128, no record, and an automaticcpurecord each bring CUDA torch back over a CPU wheel; a namedcpurecord, an explicit CPU pin,UNSLOTH_TORCH_BACKEND=cpu, no GPU and a hidden GPU each leave it alone.tests/studio/install/test_setup_keeps_gpu_prebuilt_over_cpu_source_fallback.py: a pin the old install satisfies keeps it and a different one replaces it, for both variables; the source-build fallback to the probe is present between the nvidia-smi read and the arch resolution.test_gpu_detection_followups.py,test_nvidia_library_probe.py(407 passed) andtests/sh/test_resolve_cuda_archs.sh.