File tree 1 file changed +8
-2
lines changed 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] = {
3698
3698
"f(x,y)" ,
3699
3699
};
3700
3700
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
+
3701
3707
static_assert (GGML_OP_COUNT == 51 , "GGML_OP_COUNT != 51" );
3702
3708
3703
3709
static_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)
14541
14547
}
14542
14548
14543
14549
// FINALIZE
14544
- if (node -> n_tasks > 1 ) {
14550
+ if (node -> n_tasks > 1 && GGML_OP_HAS_FINALIZE [ node -> op ] ) {
14545
14551
if (atomic_fetch_add (& state_shared .n_ready , 1 ) == n_threads - 1 ) {
14546
14552
atomic_store (& state_shared .has_work , false);
14547
14553
}
@@ -14577,7 +14583,7 @@ void ggml_graph_compute(struct ggml_context * ctx, struct ggml_cgraph * cgraph)
14577
14583
ggml_compute_forward (& params , node );
14578
14584
14579
14585
// wait for thread pool
14580
- if (node -> n_tasks > 1 ) {
14586
+ if (node -> n_tasks > 1 && GGML_OP_HAS_FINALIZE [ node -> op ] ) {
14581
14587
if (atomic_fetch_add (& state_shared .n_ready , 1 ) == n_threads - 1 ) {
14582
14588
atomic_store (& state_shared .has_work , false);
14583
14589
}
You can’t perform that action at this time.
0 commit comments