Skip to content

Commit 24a6734

Browse files
authored
ggml-cpu : add check for ARM MATMUL_INT8/i8mm support (ggml-org#15922)
This commit adds a check for GGML_MACHINE_SUPPORTS_i8mm when enabling MATMUL_INT8 features, ensuring that i8mm intrinsics are only used when the target hardware actually supports them. The motivation for this is to fix ggml CI build failures where the feature detection correctly identifies that i8mm is not supported, adding the +noi8mm flag, but MATMUL_INT8 preprocessor definitions are still enabled, causing the compiler to attempt to use vmmlaq_s32 intrinsics without i8mm support. Refs: https://github.com/ggml-org/ggml/actions/runs/17525174120/job/49909199499
1 parent 2b3efea commit 24a6734

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ggml/src/ggml-cpu/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,13 @@ function(ggml_add_cpu_backend_variant_impl tag_name)
224224
foreach(feature DOTPROD SVE MATMUL_INT8 FMA FP16_VECTOR_ARITHMETIC SME)
225225
string(FIND "${ARM_FEATURE}" "__ARM_FEATURE_${feature} 1" feature_pos)
226226
if (NOT ${feature_pos} EQUAL -1)
227-
message(STATUS "ARM feature ${feature} enabled")
227+
# Special handling for MATMUL_INT8 when machine doesn't support i8mm
228+
if ("${feature}" STREQUAL "MATMUL_INT8" AND GGML_MACHINE_SUPPORTS_noi8mm)
229+
message(STATUS "ARM feature ${feature} detected but unsetting due to machine not supporting i8mm")
230+
list(APPEND ARCH_FLAGS -U__ARM_FEATURE_MATMUL_INT8)
231+
else()
232+
message(STATUS "ARM feature ${feature} enabled")
233+
endif()
228234
endif()
229235
endforeach()
230236
endif()

0 commit comments

Comments
 (0)