Repository navigation
Studio: keep a working GPU llama.cpp prebuilt over a CPU-only source fallback, and say so in the footer - #10975
Merged
Conversation
…fallback, and say so in the footer
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. |
Member
Author
|
@codex security review |
danielhanchen
added a commit
to danielhanchen/unsloth-staging-2
that referenced
this pull request
Sep 15, 2026
…ulkan on an Intel host for PR #10975
danielhanchen
added a commit
to danielhanchen/unsloth-staging-2
that referenced
this pull request
Sep 15, 2026
…Intel host on CPU for PR #10975
danielhanchen
added a commit
to danielhanchen/unsloth-staging-2
that referenced
this pull request
Sep 15, 2026
…d name the arm64 CPU fallback in the footer for PR #10975
danielhanchen
added a commit
to danielhanchen/unsloth-staging-2
that referenced
this pull request
Sep 15, 2026
…s runtime lines for PR #10975
danielhanchen
added a commit
to danielhanchen/unsloth-staging-2
that referenced
this pull request
Sep 15, 2026
Member
Author
|
@codex review |
danielhanchen
added a commit
to danielhanchen/unsloth-staging-2
that referenced
this pull request
Sep 15, 2026
|
Codex Review: Didn't find any major issues. Another round soon, please! 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". |
danielhanchen
deleted the
keep-gpu-prebuilt-over-cpu-source-fallback
branch
September 15, 2026 08:43
This was referenced Sep 15, 2026
shaojun
pushed a commit
to shaojun/unsloth
that referenced
this pull request
Sep 29, 2026
…fallback, and say so in the footer (unslothai#10975) * Studio: keep a working GPU llama.cpp prebuilt over a CPU-only source fallback, and say so in the footer * Match the kept prebuilt to the GPU vendor that can run it, and keep Vulkan on an Intel host for PR unslothai#10975 * Read legacy marker backends, validate the kept prebuilt, and name an Intel host on CPU for PR unslothai#10975 * Check the kept prebuilt offline with the updater's own completeness check for PR unslothai#10975 * Keep a GPU prebuilt only while it still covers the installed card, and name the arm64 CPU fallback in the footer for PR unslothai#10975 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Check the kept CUDA prebuilt against the physical SMs and the driver's runtime lines for PR unslothai#10975 * Name both causes of a CPU-only source fallback in the footer for PR unslothai#10975 * Keep the installed GPU prebuilt at the failed update itself, with a one-line reason, for PR unslothai#10975 * Do not keep the old prebuilt over an explicit llama.cpp version pin for PR unslothai#10975 * Shorten the keep-prebuilt comments for PR unslothai#10975 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: danielhanchen <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #9255. Supersedes #9267, whose footer warning is folded in here with the initialisation it was missing.
The defect
When the llama.cpp prebuilt install fails during
unsloth studio update(a GitHub API limit, a TLS failure, a bad release),setup.shrestores the existing install and then source-builds. On a host without nvcc that build is CPU-only, and the swap at the end replaced the restored CUDA prebuilt with it. The footer saidbuilt. The user's GPU was gone until the next successful update, and nothing told them why.This is the Linux half of the "my GPU stopped being used after an update" reports.
setup.ps1already fails a source build that has no toolkit rather than degrading, so Windows is not affected.The fix
A working GPU prebuilt is never replaced by a source build that a failed update forced. At the failed update itself,
setup.shchecks whether the install on disk is worth keeping:llama-serverand a marker recordingbackendcuda, rocm or vulkan (older markers are read throughllama_backendor the asset name);_setup_nvidia_physicalfor cuda,_setup_amd_detectedfor rocm, any of NVIDIA, AMD or Intel for vulkan);supported_sms(physical caps when a mask empties the visible ones) ormapped_targets, and itsruntime_lineagainst the driver's compatible lines, checked offline by the updater's own--check-installed;UNSLOTH_LLAMA_FORCE_COMPILE=1orUNSLOTH_LLAMA_PRstill build).When it is, no source build starts. The step reads, for example:
The reason is read from the helper's log (rate limit, network error, or download failed). The same decision runs again before the compile and at the swap, for the source-build paths that reach a CPU binary another way (no prebuilt for the platform, a CUDA or ROCm build that fell back to CPU part way through). A kept prebuilt is reported as the installed release, not as a failed build, so the footer does not read
limited, and the footer repeats the one-line reason.A GPU host that genuinely ends on a CPU build (nothing to keep) gets a footer warning naming the cause, which is what #9267 set out to add. The arm64 CPU prebuilt fallback is covered too.
Tests
tests/studio/install/test_setup_keeps_gpu_prebuilt_over_cpu_source_fallback.py: the decision is sliced out ofsetup.shand driven against real markers (cuda on an NVIDIA host is kept, rocm and vulkan on an AMD host are kept, a cuda marker with the GPU gone is replaced, cpu markers, absent, malformed and non-string markers are replaced, no server is replaced, a forced or PR build still runs, legacy marker shapes), the coverage check (SMs, physical SMs under a mask, runtime line against the driver, gfx targets and family), the failure reason wording, plus wiring checks for the three decision sites, the configure gate, the status arm and the three footers.Every
tests/sh/test_setup_*.shsuite and the install pytest files pass.bash -nis clean.