Fix: GCC Target Mismatch for vdotq_s32
on AArch64 (Apple M1, M2, etc)
#743
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.
Problem
Building
llama.cpp
on AArch64 (e.g. in Docker on macOS M1/M2) fails when compiling NEON dot product code usingvdotq_s32
. GCC throws the following error:This error occurs because
vdotq_s32
requires the ARMv8.x-A dot product extension (+dotprod
), which is not enabled by default in most toolchains.This PR disables GGML's use of native optimizations as a temporary fix, without modifying
llama.cpp
directly. Since Apple Silicon CPUs may not be a primary target for the llama.cpp project, this workaround allows successful builds.Feel free to close this PR if it does not apply to your use case.