From 377bc783414eab809aa4dd3043e855fd4df1b877 Mon Sep 17 00:00:00 2001 From: slaren Date: Thu, 30 May 2024 09:58:08 +0200 Subject: [PATCH] clear numa affinity for main thread even with openmp --- ggml.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ggml.c b/ggml.c index 1ec3e144c378f..eb894a21f7827 100644 --- a/ggml.c +++ b/ggml.c @@ -19698,9 +19698,6 @@ static enum ggml_status ggml_graph_compute_parallel(struct ggml_compute_state * // this is a work thread too ggml_graph_compute_thread(&workers[0]); - // don't leave affinity set on the main thread - clear_numa_thread_affinity(); - // join or kill thread pool if (n_threads > 1) { for (int j = 1; j < n_threads; j++) { @@ -19710,6 +19707,9 @@ static enum ggml_status ggml_graph_compute_parallel(struct ggml_compute_state * } } #endif + // don't leave affinity set on the main thread + clear_numa_thread_affinity(); + for (int j = 0; j < n_threads; j++) { if (workers[j].ec != GGML_STATUS_SUCCESS) { compute_status = workers[j].ec;