From d90a9c38d23976009c9da7ed44c17d2f7032ca24 Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Thu, 15 Aug 2024 16:20:42 -0700 Subject: [PATCH] threadpool: do not clear barrier counters between graphs computes (fixes race with small graphs) This fixes the race condition with very small graphs where the main thread happens to start a new graph while the workers are just about to exit from barriers. --- ggml/src/ggml.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/ggml/src/ggml.c b/ggml/src/ggml.c index fc70ec0cacf549..33ac2e247a76b0 100644 --- a/ggml/src/ggml.c +++ b/ggml/src/ggml.c @@ -19362,8 +19362,6 @@ enum ggml_status ggml_graph_compute(struct ggml_cgraph * cgraph, struct ggml_cpl threadpool->cgraph = cgraph; threadpool->cplan = cplan; threadpool->n_threads_cur = n_threads; - threadpool->n_barrier = 0; - threadpool->n_barrier_passed = 0; threadpool->current_chunk = 0; threadpool->ec = GGML_STATUS_SUCCESS; }