Skip to content

Commit d4bdfc6

Browse files
committed
better way to disable for arm
1 parent 2d493d2 commit d4bdfc6

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

ggml/src/ggml-cpu/ggml-cpu.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7824,21 +7824,23 @@ static void ggml_compute_forward_mul_mat_id(
78247824
const int64_t nr0 = ne01;
78257825
const int64_t nr1 = cne1;
78267826

7827-
7828-
#if defined(__aarch64__)
7829-
// disable for ARM
7830-
int chunk_size = (nr0 + nr1) / nth;
7831-
#else
78327827
int chunk_size = 16;
78337828
if (nr0 == 1 || nr1 == 1) {
78347829
chunk_size = 64;
78357830
}
7831+
7832+
#if defined(__aarch64__)
7833+
// disable for ARM
7834+
const bool disable_chunking = true;
7835+
#else
7836+
// disable for NUMA
7837+
const bool disable_chunking = ggml_is_numa();
78367838
#endif // defined(__aarch64__)
78377839

78387840
int64_t nchunk0 = (nr0 + chunk_size - 1) / chunk_size;
78397841
int64_t nchunk1 = (nr1 + chunk_size - 1) / chunk_size;
78407842

7841-
if (nchunk0 * nchunk1 < nth * 4 || ggml_is_numa()) {
7843+
if (nchunk0 * nchunk1 < nth * 4 || disable_chunking) {
78427844
nchunk0 = nr0 > nr1 ? nth : 1;
78437845
nchunk1 = nr0 > nr1 ? 1 : nth;
78447846
}

0 commit comments

Comments
 (0)