File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -3698,6 +3698,12 @@ static const char * GGML_OP_SYMBOL[GGML_OP_COUNT] = {
36983698 "f(x,y)" ,
36993699};
37003700
3701+ // only send finalize op to thread pool if it actually does something
3702+ // currently none of them?
3703+ static const bool GGML_OP_HAS_FINALIZE [GGML_OP_COUNT ] = {
3704+ 0
3705+ };
3706+
37013707static_assert (GGML_OP_COUNT == 51 , "GGML_OP_COUNT != 51" );
37023708
37033709static_assert (sizeof (struct ggml_object )%GGML_MEM_ALIGN == 0 , "ggml_object size must be a multiple of GGML_MEM_ALIGN" );
@@ -14541,7 +14547,7 @@ void ggml_graph_compute(struct ggml_context * ctx, struct ggml_cgraph * cgraph)
1454114547 }
1454214548
1454314549 // FINALIZE
14544- if (node -> n_tasks > 1 ) {
14550+ if (node -> n_tasks > 1 && GGML_OP_HAS_FINALIZE [ node -> op ] ) {
1454514551 if (atomic_fetch_add (& state_shared .n_ready , 1 ) == n_threads - 1 ) {
1454614552 atomic_store (& state_shared .has_work , false);
1454714553 }
@@ -14577,7 +14583,7 @@ void ggml_graph_compute(struct ggml_context * ctx, struct ggml_cgraph * cgraph)
1457714583 ggml_compute_forward (& params , node );
1457814584
1457914585 // wait for thread pool
14580- if (node -> n_tasks > 1 ) {
14586+ if (node -> n_tasks > 1 && GGML_OP_HAS_FINALIZE [ node -> op ] ) {
1458114587 if (atomic_fetch_add (& state_shared .n_ready , 1 ) == n_threads - 1 ) {
1458214588 atomic_store (& state_shared .has_work , false);
1458314589 }
You can’t perform that action at this time.
0 commit comments