[ci] Pin Ollama to the AVX2 CPU build in the integration jobs#904
Merged
Conversation
llama-server ships one libggml-cpu-<microarch> build per instruction set and loads the best match for the host CPU at runtime. The hosted runner pool is mixed, so the kernels that serve a request depend on the machine a job lands on, and jobs on the newer hosts intermittently die with a llama-server segmentation fault (ollama/ollama#17006). Remove the AVX-512-bearing builds after install so llama-server falls back to the AVX2 build, whose kernels every runner in the pool shares. Also log the runner CPU and the remaining builds, so a future failure can be attributed to the microarchitecture that served it.
2 tasks
3 tasks
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.
Linked issue: #893
Purpose of change
llama-serverships onelibggml-cpu-<microarch>build per instruction set and loads the best match for the host CPU at load time. The hosted runner pool is mixed, so the kernels that serve a request depend on which machine a job happens to land on, and jobs that land on the newer hosts intermittently die withllama-server process has terminated: signal: segmentation fault. Upstream reports the same crash on hosts with the newer vector extensions (ollama/ollama#17006, open).That explains the shape of the flake described on #893: it is deterministic per runner rather than random, it survives the in-suite reruns (they retry into the same wedged process), and it never reproduced in isolation, because a fork probe kept landing on unaffected hardware.
A census of 40
ubuntu-latestrunners shows how mixed the pool is:13 of 40 runners expose AVX-512, and
llama-serverselectsskylakex/icelake/zen4/sapphirerapidson those. The remaining runners fall back to the AVX2 build, which does not crash. The crash rate measured onmainwas 6 segfaults in 44 integration jobs (~14%), which is the same order as the share of the pool running those builds.This removes the AVX-512-bearing builds after install, so
llama-serverfalls back to the AVX2 build that every runner in the pool can execute. It also logs the runner CPU and the remaining builds, so a future failure can be attributed to the microarchitecture that served it.The exact extension at fault is not pinned down: AMX, AVX-512 and AVX512-BF16 are each present on a share of the pool close enough to the observed crash rate that the data here cannot separate them. The change therefore removes all of them rather than guessing, and falls back to the one build the whole pool shares.
Note for reviewers:
OLLAMA_LLM_LIBRARYis not a usable lever for this on 0.31.x. It is consumed indiscover/runner.goinsideGPUDevices(), where it filters GPU library directories by name (cuda_v12,rocm_v6,mlx_*); a CPU value matches no directory and has no effect on which CPU buildllama-serverloads.Tests
Validated on a fork, since the crash only reproduces on the hosted runner pool.
Three full CI runs with this change: 33 integration jobs, 0 segfaults. At the ~14% per-job rate measured on
main, ~4-5 segfaults were expected, and the chance of 33 clean jobs by luck is under 1%. The suspect hardware did come up during those runs (3 jobs on AVX512-BF16 hosts, 1 on an AMX host) and none of them crashed.The one unrelated failure in those 33 jobs was
EmbeddingIntegrationTeston an AVX2-only host, with no segfault in the job; that host has no AVX-512 build to remove, so it ran the same kernels either way.No measurable runtime cost: median
it-python16m andit-java10m, unchanged from the same jobs without the change.API
No public API changes; this only affects CI.
Documentation
doc-neededdoc-not-neededdoc-included