[ggml][llama-cpp] Add portable-cpu feature to avoid SIGILL from binary (Fixes #53372) - #53482
[ggml][llama-cpp] Add portable-cpu feature to avoid SIGILL from binary (Fixes #53372)#53482Reeshabh Choudhary (reeshabh90) wants to merge 3 commits into
Conversation
Billy O'Neal (BillyONeal)
left a comment
There was a problem hiding this comment.
In general we discourage features to select CPU support like this because it's unreasonable for users to figure out which cocktail of features to use. Given how binary caching works, we probably need to do what your portable-cpu feature does all of the time.
|
Additionally GPT 5.6 Sol reports:
|
|
Sorry, rereading what I wrote sounds a bit harsh. My point is, this is a good change, thank you! It just needs to be done all the time rather than being a feature. |
caching ggml defaults to GGML_NATIVE=ON, enabling CPU-specific instruction sets for the host that performs the build. vcpkg's binary cache key does not encode the physical CPU used to produce a cached binary, so a binary built on one host can be served from cache and executed on a different host lacking the required instruction set, causing SIGILL. Add a 'portable-cpu' feature to ggml that disables native CPU detection and architecture-specific instruction sets to produce portable CPU binaries. llama-cpp gets a matching 'portable-cpu' feature that forwards to ggml's feature when using the system ggml library. Fixes microsoft#53372
dfc47de to
b96a63d
Compare
and made the CPU-portability flags unconditional. Also added GGML_FMA=OFF and GGML_F16C=OFF per your note, since those aren't gated by GGML_NATIVE upstream.
|
@microsoft-github-policy-service agree |
No problem. I have made suggested changes. Kindly take a look. |
caching
ggml defaults to GGML_NATIVE=ON, enabling CPU-specific instruction sets for the host that performs the build. vcpkg's binary cache key does not encode the physical CPU used to produce a cached binary, so a binary built on one host can be served from cache and executed on a different host lacking the required instruction set, causing SIGILL.
Add a 'portable-cpu' feature to ggml that disables native CPU detection and architecture-specific instruction sets to produce portable CPU binaries. llama-cpp gets a matching 'portable-cpu' feature that forwards to ggml's feature when using the system ggml library.
Fixes #53372