Skip to content

fix(llama-cpp): retain CPU variants in GPU builds - #11255

Merged
mudler merged 1 commit into
masterfrom
cron/issue-11254-cpu-offload
Aug 1, 2026
Merged

fix(llama-cpp): retain CPU variants in GPU builds#11255
mudler merged 1 commit into
masterfrom
cron/issue-11254-cpu-offload

Conversation

@localai-org-maint-bot

Copy link
Copy Markdown
Collaborator

Description

This PR fixes #11254.

GPU llama.cpp images on x86 now use the existing llama-cpp-cpu-all build 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-scripts
  • make 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.sh
  • git diff --check

A 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

  • Yes, I signed my commits.
  • Documentation updated (docs/content/) for user-facing changes, or not applicable

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
mudler merged commit cedcbf9 into master Aug 1, 2026
129 of 135 checks passed
@mudler
mudler deleted the cron/issue-11254-cpu-offload branch August 1, 2026 07:26
@localai-bot localai-bot added the bug Something isn't working label Aug 1, 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CPU offload performance regression?

3 participants