fix(llama-cpp): retain CPU variants in GPU builds - #11255
Merged
Conversation
Build the runtime CPU variant set alongside x86 GPU backends so partial offload uses the host's SIMD kernels instead of the scalar fallback. Keep arm64 GPU images on the portable binary until their builders consistently provide gcc-14. Assisted-by: Codex:gpt-5
mudler
approved these changes
Jul 31, 2026
mudler
added a commit
that referenced
this pull request
Aug 3, 2026
Since #11255 and #11276 every GPU image also builds ggml's CPU_ALL_VARIANTS matrix, so a partial offload uses the host's SIMD kernels. That works everywhere except SYCL, where the Makefile compiles the whole tree with icpx -fsycl: icpx never finishes ggml-cpu/arch/x86/repack.cpp at -march=sapphirerapids. In run 30765516644 both sycl_f16 and sycl_f32 stopped at that translation unit and sat there for 5h30m with a single compile in flight until GitHub killed the job at its 6h limit, and turboquant's f16 job lost its runner outright. gcc compiles the same file in seconds in the vulkan and CPU jobs of the same run, so the CPU variant matrix is only unbuildable under icpx. Route SYCL back to the portable fallback binary, which is what these images shipped before #11255. run.sh already prefers *-cpu-all when present and falls back otherwise, so nothing else has to change. Assisted-by: Claude Code:claude-opus-5[1m] [Read] [Edit] [Bash] Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
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.
Description
This PR fixes #11254.
GPU llama.cpp images on x86 now use the existing
llama-cpp-cpu-allbuild target, preserving the selected CUDA/ROCm/Vulkan/SYCL backend while also packaging ggml's runtime-selected CPU kernels for partial offload. GPU arm64 builds remain on the portable fallback because their base images do not consistently provide the gcc-14 toolchain required by ggml's full armv9.2 variant matrix.A focused shell regression test covers the architecture/build-type target selection.
Notes for Reviewers
Verification:
make test-build-scriptsmake test-ci-scripts(41 tests)bash -n .docker/llama-cpp-build-target.sh .docker/llama-cpp-compile.sh scripts/build/llama-cpp-build-target_test.sh backend/cpp/llama-cpp/run.shgit diff --checkA full backend container build was not run locally because it is a long GPU/toolchain matrix build; CI is expected to exercise the affected llama.cpp image variants.
Signed commits