]> git.djapps.eu Git - pkg/ggml/sources/ggml/commit
Implement GGML_CPU_ALL_VARIANTS for ARM (llama/14080)
authorChristian Kastner <redacted>
Wed, 11 Jun 2025 19:07:44 +0000 (19:07 +0000)
committerGeorgi Gerganov <redacted>
Wed, 18 Jun 2025 07:21:15 +0000 (10:21 +0300)
commitf2d4d8f36b73e1c7dd9d459159ea5f11ba0e7244
treee16f47e5f947decf747760d6661ff73dbb1ded79
parent8ea17ca29657e539c7e8c052a5ee714cc53f7fd1
Implement GGML_CPU_ALL_VARIANTS for ARM (llama/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.
src/CMakeLists.txt
src/ggml-cpu/CMakeLists.txt
src/ggml-cpu/arch/arm/cpu-feats.cpp [new file with mode: 0644]