From d39ec38fa8cbbfb9743f141904a812aacdc9a3bf Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Mon, 8 Jan 2024 08:20:18 -0800 Subject: [PATCH] Enable setting thread affinity on NUMA systems --- llama.cpp/ggml.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/llama.cpp/ggml.c b/llama.cpp/ggml.c index b74dc14b72..f0dd70af59 100644 --- a/llama.cpp/ggml.c +++ b/llama.cpp/ggml.c @@ -16185,7 +16185,6 @@ typedef pthread_t ggml_thread_t; #endif // Android's libc implementation "bionic" does not support setting affinity -#if defined(__linux__) && !defined(__BIONIC__) static void set_numa_thread_affinity(int thread_n, int n_threads) { if (!ggml_is_numa()) { return; @@ -16232,12 +16231,6 @@ static void clear_numa_thread_affinity(void) { CPU_FREE(cpus); } -#else -// TODO: Windows etc. -// (the linux implementation may also work on BSD, someone should test) -static void set_numa_thread_affinity(int thread_n, int n_threads) { UNUSED(thread_n); UNUSED(n_threads); } -static void clear_numa_thread_affinity(void) {} -#endif struct ggml_compute_state_shared { const struct ggml_cgraph * cgraph;