From b71dfe637fc3b2823aa346730eb2ab9bb2c3eeed Mon Sep 17 00:00:00 2001 From: zrm Date: Sat, 17 Jun 2023 15:11:05 -0400 Subject: [PATCH] recommendation that n_nodes evenly divide n_threads did not warrant such aggressive enforcement --- ggml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ggml.c b/ggml.c index 8cfe9d14d..002b982bd 100644 --- a/ggml.c +++ b/ggml.c @@ -14064,7 +14064,7 @@ void set_numa_thread_affinity(int thread_n, int n_threads) { if (!ggml_is_numa()) { return; } // run thread on node_num thread_n / (threads per node) - int node_num = thread_n / (n_threads / ggml_numa.n_nodes); + int node_num = thread_n / ((n_threads + ggml_numa.n_nodes - 1) / ggml_numa.n_nodes); struct ggml_numa_node *node = &ggml_numa.nodes[node_num]; size_t setsize = CPU_ALLOC_SIZE(ggml_numa.total_cpus); cpu_set_t *cpus = CPU_ALLOC(ggml_numa.total_cpus);