From 783b7ca02da377a04b8ea0a15c96134704726201 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 7 Feb 2024 22:28:29 +0000 Subject: [PATCH] Removing unneeded branch in server.cpp example and moving get_numa_affinity and making it static --- examples/server/server.cpp | 5 ----- ggml.c | 18 ++++++++---------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/examples/server/server.cpp b/examples/server/server.cpp index 17eca9f67..0db4795bc 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -2243,11 +2243,6 @@ static void server_params_parse(int argc, char **argv, server_params &sparams, else { invalid_param = true; break; } } } - - else if (arg == "--numa") - { - params.numa = GGML_NUMA_STRATEGY_DISABLED; - } else if (arg == "--embedding") { params.embedding = true; diff --git a/ggml.c b/ggml.c index 3d8f20389..1bc8437c0 100644 --- a/ggml.c +++ b/ggml.c @@ -1951,7 +1951,14 @@ inline static void ggml_critical_section_end(void) { atomic_fetch_sub(&g_state_barrier, 1); } -cpu_set_t ggml_get_numa_affinity(void); // get cpuset from numactl +static cpu_set_t ggml_get_numa_affinity(void) { + cpu_set_t cpuset; + pthread_t thread; + thread = pthread_self(); + CPU_ZERO(&cpuset); + pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset); + return cpuset; +} void ggml_numa_init(uint32_t numa_flag) { if (g_state.numa.n_nodes > 0) { @@ -2031,15 +2038,6 @@ void ggml_numa_init(uint32_t numa_flag) { #endif } -cpu_set_t ggml_get_numa_affinity(void) { - cpu_set_t cpuset; - pthread_t thread; - thread = pthread_self(); - CPU_ZERO(&cpuset); - pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset); - return cpuset; -} - bool ggml_is_numa(void) { return g_state.numa.n_nodes > 1; }