Skip to content

ggml : Add GGML_USE_SVE macro to disable SVE by default #8426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ggml/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,7 @@ if (CMAKE_OSX_ARCHITECTURES STREQUAL "arm64" OR
list(APPEND ARCH_FLAGS -mno-unaligned-access)
endif()
if (GGML_SVE)
list(APPEND GGML_CDEF_PUBLIC GGML_USE_SVE)
list(APPEND ARCH_FLAGS -march=armv8.6-a+sve)
endif()
endif()
Expand Down
2 changes: 1 addition & 1 deletion ggml/src/ggml-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ extern "C" {
#endif
#endif

#if defined(__ARM_FEATURE_SVE)
#if (defined(__ARM_FEATURE_SVE) && defined(GGML_USE_SVE))
#include <arm_sve.h>
#endif

Expand Down
4 changes: 2 additions & 2 deletions ggml/src/ggml-quants.c
Original file line number Diff line number Diff line change
Expand Up @@ -3813,7 +3813,7 @@ void ggml_vec_dot_q4_0_q8_0(int n, float * restrict s, size_t bs, const void * r
return;
}
#endif
#if defined(__ARM_FEATURE_SVE)
#if (defined(__ARM_FEATURE_SVE) && defined(GGML_USE_SVE))
const svbool_t ptrueh = svptrue_pat_b8(SV_VL16);
const svbool_t ptruel = svnot_b_z(svptrue_b8(), ptrueh);

Expand Down Expand Up @@ -5421,7 +5421,7 @@ void ggml_vec_dot_q8_0_q8_0(int n, float * restrict s, size_t bs, const void * r
return;
}
#endif
#if defined(__ARM_FEATURE_SVE)
#if (defined(__ARM_FEATURE_SVE) && defined(GGML_USE_SVE))
svfloat32_t sumv0 = svdup_n_f32(0.0f);
svfloat32_t sumv1 = svdup_n_f32(0.0f);

Expand Down
2 changes: 1 addition & 1 deletion ggml/src/ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -21758,7 +21758,7 @@ int ggml_cpu_has_neon(void) {
}

int ggml_cpu_has_sve(void) {
#if defined(__ARM_FEATURE_SVE)
#if (defined(__ARM_FEATURE_SVE) && defined(GGML_USE_SVE))
// TODO: Currently, SVE 256 bit is only supported.
GGML_ASSERT(svcntb() == QK8_0);
return 1;
Expand Down