Repository navigation
Studio: find uv off PATH for the CUDA runtime wheel step, and name Repair in the GPU backend warning - #17675
Conversation
…pair in the GPU backend warning
Codex Review Summary: ✅ CompletedThis 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. |
|
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". |
…ff PATH [skip ci]
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs 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". |
…nslothai#17744) Follow-up to unslothai#17675 for unslothai#17663 In unslothai#17663 an in-app llama.cpp update on Windows left llama-server running entirely on the CPU, and the update still reported "Updated llama.cpp to b12319". The installer exits 0 when the CUDA runtime it needs could not be installed, because the CPU fallback still works. So the update had no way to tell the user anything was wrong, and the first sign was slow generation. ## Change - `install_llama_prebuilt.py` already logs "CUDA runtime wheel install failed ...; llama.cpp will run on the CPU" when the runtime install fails. After a runtime install that succeeds, it now re-checks, and if the runtime is still missing it logs the same notice. - `update_flow.stream_installer` returns whether the installer printed that notice. It was already reading every line, so this needs no extra process and no new probe. - The llama.cpp update keeps its success state, but its message now adds: "The CUDA runtime llama.cpp needs could not be installed, so it will run on the CPU. Use Repair installation in Settings in the desktop app, or re-run the Unsloth installer." The update flow, its states and the installed files are unchanged. Only the completion message differs, and only when the installer said llama.cpp will run on the CPU. ## Tests - `test_the_installer_logs_the_cpu_fallback_notice_the_update_reads`: guards against the installer's wording drifting from what the update looks for. - `test_an_update_that_leaves_llama_on_the_cpu_says_so[True|False]`: with the notice in the installer output the message names Repair installation; without it the message is unchanged. - `test_a_runtime_still_missing_after_its_install_is_reported`: the re-check fires only when the install succeeded and the runtime is still missing. - Every suite that drives `llama_cpp_update` or `stream_installer` passes (376 passed, 1 skipped). These are the update, combined update, backend switch, update-flow messages, orphaned children, account mutations, path settings, local link and source build suites.
…09 lint (#17748) ## Summary `Source lint`, `workflow-trigger lint` and `Repo tests (CPU, rest-2)` fail on main and every PR based on it since #17675, in `tests/security/test_lint_av_shapes.py::test_the_repository_is_clean_against_its_baseline`: ``` tests/studio/install/test_no_torch_cuda_runtime_wheels.py:308: [AV009] error: copies a Windows system binary 1 new error(s). ``` The test #17675 added copies the `uv` executable found on PATH into a fake home (`shutil.copy2(uv, home / ".local" / "bin" / ...)`), then builds the child's PATH from the venv plus `%SystemRoot%` and `System32`. AV009 fires on any file copy within a few lines of a `System32` path, which is the shape of renaming a Microsoft-signed tool. Here the copied file is uv, and `System32` is only put on the child's PATH, so the finding is a false positive. Both the test and the lint rule are right about what they check; they only meet by proximity. ## Change A `lint-allow: AV009 <reason>` comment above that one copy, the escape hatch the linter's own message names for a line that has to stay. No other line, rule or baseline entry changes, so a real System32 copy anywhere else, including in this file, still fails. ## Testing - `python scripts/lint_av_shapes.py`: `0 new errors` (1 on main). - `pytest tests/security/test_lint_av_shapes.py`: 19 passed (the baseline test fails on main).
Fixes #17663
After an in-app llama.cpp update on Windows (RTX 5090 Laptop), llama-server ran entirely on the CPU, and only Repair installation brought the GPU back.
Why
The
app-*Windows CUDA bundles shipggml-cuda.dllbut no CUDA runtime. In b12319 (and b12284), the cuda13ggml-cuda.dllimportscublas64_13.dll,cublasLt64_13.dllandnvcudart_hybrid64.dll. llama.cpp loads its backends dynamically (GGML_BACKEND_DL), so when those cannot be found it falls back to the CPU without an error. #17463 (merged after v0.1.917-beta, not released yet) installs NVIDIA's runtime wheels when an install has no runtime. Two gaps remain on the path this report took:shutil.which("uv"). A Desktop-started backend can run with a PATH that lacks uv's directory (s3_runtime._find_uvandmlx_repair._uv_executablealready guard this). The fallbackpython -m pipcannot work either, because the venv is made byuv venvwith no pip. In that case an in-app update logs "CUDA runtime wheel install failed; llama.cpp will run on the CPU" and still reports success. The step now also looks in~/.local/binand~/.cargo/bin, where install.ps1 / install.sh put uv by default, the same lookupmlx_repairuses.Nothing changes when uv is on PATH, and the warning shows under the same conditions as before.
Tests
tests/studio/install/test_no_torch_cuda_runtime_wheels.py::test_uv_off_path_is_still_used: with no uv on PATH and uv in~/.local/bin, the wheels are installed with that uv. Fails without the change.studio/frontend/tests/partial-offload.test.ts: the GPU backend warning names Repair installation. Fails without the change.tests/studio/install: 21 failures on both base and head (pre-existing, for example intest_dependency_pass_skips.py); head passes one more test, the new one.Not covered: a real Windows Desktop run. The reporter's exact cause is unconfirmed without their install log, so this hardens the path #17463 added rather than proving their root cause.
Screenshots
The toast after loading a model whose GPU llama.cpp could not use. This was a real CPU load of SmolLM2-135M Q4_K_M in Studio, built from the merge base (left) and this branch (right), with only the load response's GPU backend flag forced on, since this host has no GPU.