Repository navigation
llama.cpp prebuilt: accept upstream win-rocm bundles, run native arm64 under Rosetta, source-build on Jetson - #14373
Conversation
…4 under Rosetta, source-build on Jetson
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. |
|
@codex review |
|
@codex security review |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d123db445c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| names = list(assets) | ||
| legacy = f"llama-{release_tag}-bin-win-hip-radeon-x64.zip" | ||
| pattern = re.compile( | ||
| rf"llama-{re.escape(release_tag)}-bin-win-rocm-([0-9]+(?:\.[0-9]+)*)-x64\.zip" |
There was a problem hiding this comment.
Support all gfx targets in the new win-rocm bundle
When automatic selection uses a non-default upstream repository on GPUs newly covered by win-rocm-10.0—such as gfx1033, gfx1034, gfx1103, gfx1152, or gfx1153—route_backend_request() still consults the legacy UPSTREAM_WINDOWS_HIP_GFX_TARGETS set before release planning, classifies the GPU as unsupported, and rewrites the host to Vulkan. Consequently this new filename matcher is never reached for those supported GPUs, and they receive Vulkan (or CPU fallback) instead of the available ROCm bundle; the upstream coverage/routing table needs to account for the expanded win-rocm target matrix.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Keeping the upstream coverage table as is in this PR. Routing runs before the release's asset list is known, and the table has to hold for every tag a mirror may serve: tags that still ship only win-hip-radeon-x64 carry just the gfx targets listed there, so widening it would send a gfx1103 or gfx1153 host to a HIP bundle without its kernels. Those GPUs keep the Vulkan bundle, which runs on them. The default fork path selects Windows ROCm from its manifest and is unaffected. Widening the table per tag is a separate change.
| # Vulkan before CPU if HIP is missing or fails validation. | ||
| if not host.has_physical_nvidia: |
There was a problem hiding this comment.
Keep HIP masks on the Vulkan fallback
When a Windows ROCm host has HIP_VISIBLE_DEVICES, ROCR_VISIBLE_DEVICES, or its CUDA alias set and the HIP archive is missing or fails validation, this newly appended Vulkan attempt is still selected because the condition only checks for physical NVIDIA hardware. Vulkan ignores those HIP masks, so the fallback can enumerate an AMD adapter the caller deliberately hid or reserved; the existing automatic Vulkan router explicitly suppresses this handoff when a HIP mask is set, and this fallback needs the same guard so it proceeds to CPU instead.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 03fb552: both new Vulkan fallbacks (the release plan and the single-choice resolver) now skip Vulkan when HIP_VISIBLE_DEVICES, ROCR_VISIBLE_DEVICES or CUDA_VISIBLE_DEVICES is set, using the same _hip_visible_device_mask_set() the automatic router uses, so a masked ROCm host goes HIP then CPU. Test: test_windows_rocm_hip_mask_never_falls_back_to_vulkan.
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. 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". |
… fallback; re-check Jetson on update Following ROCm torch clears has_physical_nvidia, so the HIP-to-Vulkan fallback now reads the same retained NVIDIA evidence the auto-Vulkan router does. A Jetson CUDA prebuilt installed before the Tegra check is no longer kept or reused, and a stored cuda request there falls back to detection like the driver-floor case. [skip ci]
|
@codex review |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 89baf4989e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| if route.backend == "cuda" and ( | ||
| driver_below_cuda_prebuilt_floor(route.host) or _tegra_blocks_arm64_cuda(route.host) | ||
| ): | ||
| raise BackendUnavailable(str(exc)) from exc |
There was a problem hiding this comment.
Convert lazy Jetson plan failures before filtering
When a Jetson update has a stored cuda backend and uses the default fork, resolve_simple_install_release_plans() returns a LazyReleasePlans without evaluating its generator, so the Jetson PrebuiltFallback is raised later by _backend_only_release_plans() outside this try. It therefore never becomes BackendUnavailable; the installer preserves the stored CUDA selection and exits with EXIT_BACKEND_UNAVAILABLE instead of retrying automatic detection and initiating the intended source build. The new test misses this production path because its mock raises eagerly.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in b315996: select_backend_install now raises BackendUnavailable for a stored cuda request on a pre-CUDA-13 Jetson before resolving any plans, so the fork's lazy generator can no longer raise the Jetson PrebuiltFallback outside the converting try, and the installer falls back to detection and the source build. Test: test_jetson_stored_cuda_request_with_lazy_plans_falls_back (lazy plans that raise only when consumed).
…up front, before the fork's lazy plans [skip ci]
|
@codex review |
|
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". |
…onger bypasses the HIP mask / NVIDIA guard [skip ci]
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! 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". |
…tching context ceiling; in-process Rosetta check (unslothai#14492) ## Summary Follow-up to unslothai#14372 and unslothai#14373 from a post-merge regression review. ## What changes - **unslothai#14372: explicit device choices win again.** An explicit `--device` / `LLAMA_ARG_DEVICE` / `LLAMA_ARG_MAIN_GPU` kept naming ordinal 0 while the discrete-first mask made ordinal 0 the dGPU. With any explicit device flag, or a visibility mask that cannot be mapped (UUID entries), the discrete tier is off and the previous pick applies. The integrated-GPU set itself is kept, so host-only bytes (context checkpoints, a CPU-pinned projector) are still not charged to a dGPU the pick lands on. Checked only after an integrated GPU is found, so other hosts pay nothing. - **unslothai#14372: a preference cap is not a shortfall.** With `refuse_partial_gpu_fit` on an APU + dGPU host, the discrete tier capped Auto context and raised `GpuMemoryShortError(capped=True)` although the APU held the full context. When the full pool fits the uncapped context, the cap is no longer reported as VRAM-bound. - **unslothai#14372: the reported context ceiling matches the launch.** `best_cap` and the q8 probe now price discrete subsets the same way Auto does, and with a discrete tier the ceiling sweep starts at Auto's GPU floor (a forced multi-GPU split never takes the dGPU-only tier), so the launched context no longer exceeds the reported maximum. - **unslothai#14373: no `sysctl` subprocess per call.** The Rosetta check read `hw.optional.arm64` with a subprocess on every call, Intel Macs included; it now reads it in-process via `sysctlbyname` and caches it. ## Tests - Installer suites: 3656 passed on this branch; against main's source exactly the 5 new or rewritten tests fail. - Placement suites: this branch fails only the 5 tests that already fail on main (no `gguf` module, drafter tests); against main's source 19 fail (the new tests). --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Summary
Three host edges where the llama.cpp prebuilt selector picks the wrong bundle.
What changes
llama-<tag>-bin-win-rocm-<ver>-x64.zipinstead ofwin-hip-radeon-x64. Both names are accepted: the legacy name first, then rocm versions newest first, still as install kindwindows-hip.win-vulkan-x64beforewin-cpu-x64. It never does so when any NVIDIA adapter is present (including one the ROCm torch route set aside) or a HIP visibility mask is set, since Vulkan ignores both. An Intel iGPU or a non-ROCm AMD card beside the ROCm card does not lift that guard.macos-arm64bundle instead of the Metal-offmacos-x64build.sysctl -n hw.optional.arm64== 1; the check is bounded and never raises./etc/nv_tegra_release, ornvidia,tegrain the device tree) with a driver CUDA below 13, the server ARM64linux-arm64-cudabundle is skipped and the installer source-builds.cudabackend request falls back to detection.Hosts affected
Tests
tests/studio/install/test_llama_host_platform_edges.py(43 tests). On the merge base 18 of them fail; here all pass. Controls: