From d4bdfc631440429c29cc8d5d069cbea27c90e128 Mon Sep 17 00:00:00 2001 From: slaren Date: Sun, 9 Feb 2025 17:20:09 +0100 Subject: [PATCH] better way to disable for arm --- ggml/src/ggml-cpu/ggml-cpu.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ggml/src/ggml-cpu/ggml-cpu.c b/ggml/src/ggml-cpu/ggml-cpu.c index 7906423e3..2bdf843d1 100644 --- a/ggml/src/ggml-cpu/ggml-cpu.c +++ b/ggml/src/ggml-cpu/ggml-cpu.c @@ -7824,21 +7824,23 @@ static void ggml_compute_forward_mul_mat_id( const int64_t nr0 = ne01; const int64_t nr1 = cne1; - -#if defined(__aarch64__) - // disable for ARM - int chunk_size = (nr0 + nr1) / nth; -#else int chunk_size = 16; if (nr0 == 1 || nr1 == 1) { chunk_size = 64; } + +#if defined(__aarch64__) + // disable for ARM + const bool disable_chunking = true; +#else + // disable for NUMA + const bool disable_chunking = ggml_is_numa(); #endif // defined(__aarch64__) int64_t nchunk0 = (nr0 + chunk_size - 1) / chunk_size; int64_t nchunk1 = (nr1 + chunk_size - 1) / chunk_size; - if (nchunk0 * nchunk1 < nth * 4 || ggml_is_numa()) { + if (nchunk0 * nchunk1 < nth * 4 || disable_chunking) { nchunk0 = nr0 > nr1 ? nth : 1; nchunk1 = nr0 > nr1 ? 1 : nth; }