Skip to content

Commit

Permalink
clear numa affinity for main thread even with openmp
Browse files Browse the repository at this point in the history
  • Loading branch information
slaren committed May 30, 2024
1 parent fa864af commit 377bc78
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand All @@ -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;
Expand Down

0 comments on commit 377bc78

Please sign in to comment.