From db45b6d3a95a97436af9dbd639afbe90d06791db 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 4d4dbdfac..b1400923c 100644 --- a/ggml/src/ggml.c +++ b/ggml/src/ggml.c @@ -19375,8 +19375,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; }