]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
Implement GGML_CPU_ALL_VARIANTS for ARM (#14080)
authorChristian Kastner <redacted>
Wed, 11 Jun 2025 19:07:44 +0000 (19:07 +0000)
committerGitHub <redacted>
Wed, 11 Jun 2025 19:07:44 +0000 (21:07 +0200)
commit532802f938c6a18cc6a704057ab571f253fd77ed
tree9f0b162b6f0b03c77d44e3e9944fe6102840901c
parentd4e0d95cf581f50c9a21d06eaecae2dd580076bd
Implement GGML_CPU_ALL_VARIANTS for ARM (#14080)

* ggml-cpu: Factor out feature detection build from x86

* ggml-cpu: Add ARM feature detection and scoring

This is analogous to cpu-feats-x86.cpp. However, to detect compile-time
activation of features, we rely on GGML_USE_<FEAT> which need to be set
in cmake, instead of GGML_<FEAT> that users would set for x86.

This is because on ARM, users specify features with GGML_CPU_ARM_ARCH,
rather than with individual flags.

* ggml-cpu: Implement GGML_CPU_ALL_VARIANTS for ARM

Like x86, however to pass around arch flags within cmake, we use
GGML_INTERNAL_<FEAT> as we don't have GGML_<FEAT>.

Some features are optional, so we may need to build multiple backends
per arch version (armv8.2_1, armv8.2_2, ...), and let the scoring
function sort out which one can be used.

* ggml-cpu: Limit ARM GGML_CPU_ALL_VARIANTS to Linux for now

The other platforms will need their own specific variants.

This also fixes the bug that the the variant-building branch was always
being executed as the else-branch of GGML_NATIVE=OFF. The branch is
moved to an elseif-branch which restores the previous behavior.
ggml/src/CMakeLists.txt
ggml/src/ggml-cpu/CMakeLists.txt
ggml/src/ggml-cpu/arch/arm/cpu-feats.cpp [new file with mode: 0644]