recommendation that n_nodes evenly divide n_threads did not warrant such aggressive enforcement

This commit is contained in:
zrm 2023-06-17 15:11:05 -04:00
parent bf83dcb279
commit b71dfe637f

2
ggml.c
View file

@ -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);