Skip to content

Commit

Permalink
fixed a bug that resulted in the program hanging
Browse files Browse the repository at this point in the history
  • Loading branch information
LostRuins committed Jan 9, 2024
1 parent 66533c8 commit 693f649
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -16557,7 +16557,7 @@ static thread_ret_t ggml_graph_compute_thread(void * data) {
atomic_store(&state->shared->n_active, n_threads);
atomic_store(&state->shared->node_n, node_n);
} else {
// wait for other threads to finish
// wait for other threads to finish
const int last = node_n;

const bool do_yield = last < 0 || cgraph->nodes[last]->op == GGML_OP_MUL_MAT;
Expand All @@ -16573,7 +16573,8 @@ static thread_ret_t ggml_graph_compute_thread(void * data) {
}

node_n = atomic_load(&state->shared->node_n);
} while (node_n == last);
if (node_n != last) break;
};
}

// check if we should stop
Expand Down

0 comments on commit 693f649

Please sign in to comment.