Skip to content

Commit

Permalink
threadpool: do not clear barrier counters between graphs computes (fi…
Browse files Browse the repository at this point in the history
…xes 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.
  • Loading branch information
max-krasnyansky committed Aug 22, 2024
1 parent 6d6a52b commit d90a9c3
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions ggml/src/ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit d90a9c3

Please sign in to comment.