Files
LocalAI/scripts/build/llama-cpp-build-target_test.sh
mudler's LocalAI [bot] a0f7faaa2a fix(sycl): stop building the ggml CPU variant matrix with icpx (#11321)
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>
2026-08-03 19:00:00 +02:00

33 lines
1014 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
CURDIR=$(dirname "$(realpath "$0")")
SELECTOR="$CURDIR/../../.docker/llama-cpp-build-target.sh"
assert_target() {
local arch=$1
local build_type=$2
local expected=$3
local actual
actual=$("$SELECTOR" "$arch" "$build_type")
if [ "$actual" != "$expected" ]; then
echo "FAIL: $arch/$build_type selected $actual, expected $expected"
exit 1
fi
}
assert_target amd64 cublas llama-cpp-cpu-all
assert_target amd64 vulkan llama-cpp-cpu-all
assert_target amd64 "" llama-cpp-cpu-all
assert_target arm64 cublas llama-cpp-fallback
assert_target arm64 "" llama-cpp-cpu-all
# SYCL builds the whole tree with icpx -fsycl, and icpx never finishes
# ggml-cpu/arch/x86/repack.cpp at -march=sapphirerapids: every sycl job sat on
# that one translation unit until GitHub killed it at its 6h limit.
assert_target amd64 sycl_f16 llama-cpp-fallback
assert_target amd64 sycl_f32 llama-cpp-fallback
echo "PASS: llama.cpp build target preserves CPU variants where supported"