File tree 1 file changed +3
-7
lines changed
1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -16900,9 +16900,7 @@ static void ggml_graph_compute_thread_sync_node(int * node_n, struct ggml_comput
16900
16900
const int last_node_n = * node_n;
16901
16901
16902
16902
while (true) {
16903
- if (do_yield) {
16904
- sched_yield();
16905
- }
16903
+ sched_yield();
16906
16904
16907
16905
* node_n = atomic_load(&state->shared->node_n);
16908
16906
if (* node_n != last_node_n) break;
@@ -16914,9 +16912,7 @@ static void ggml_graph_compute_thread_sync_task(int * task_phase, struct ggml_co
16914
16912
const int last_task_phase = * task_phase;
16915
16913
16916
16914
while (true) {
16917
- if (do_yield) {
16918
- sched_yield();
16919
- }
16915
+ sched_yield();
16920
16916
16921
16917
* task_phase = atomic_load(&state->shared->node_task);
16922
16918
if (* task_phase != last_task_phase) break;
@@ -17042,7 +17038,7 @@ static thread_ret_t ggml_graph_compute_thread(void * data) {
17042
17038
// since it is not clear what is the best approach, it should potentially become user-configurable
17043
17039
// ref: https://github.com/ggerganov/ggml/issues/291
17044
17040
// UPD: adding the do_yield flag seems to resolve the issue universally
17045
- const bool do_yield = node_n < 0 || cgraph->nodes[node_n]->op == GGML_OP_MUL_MAT ;
17041
+ const bool do_yield = true ;
17046
17042
ggml_graph_compute_thread_sync_task(&task_phase, state, do_yield);
17047
17043
}
17048
17044
You can’t perform that action at this time.
0 commit comments