@@ -2451,6 +2451,7 @@ static void set_ggml_graph_node_properties(ggml_tensor * node, ggml_graph_node_p
2451
2451
for (int i = 0 ; i < GGML_MAX_SRC; i++) {
2452
2452
graph_node_properties->src_address [i] = node->src [i] ? node->src [i]->data : nullptr ;
2453
2453
}
2454
+ memcpy (graph_node_properties->op_params , node->op_params , GGML_MAX_OP_PARAMS);
2454
2455
}
2455
2456
2456
2457
static bool ggml_graph_node_has_matching_properties (ggml_tensor * node, ggml_graph_node_properties * graph_node_properties) {
@@ -2482,6 +2483,12 @@ static bool ggml_graph_node_has_matching_properties(ggml_tensor * node, ggml_gra
2482
2483
return false ;
2483
2484
}
2484
2485
}
2486
+
2487
+ if (node->op == GGML_OP_SCALE &&
2488
+ memcmp (graph_node_properties->op_params , node->op_params , GGML_MAX_OP_PARAMS) != 0 ) {
2489
+ return false ;
2490
+ }
2491
+
2485
2492
return true ;
2486
2493
}
2487
2494
@@ -2694,7 +2701,9 @@ GGML_CALL static enum ggml_status ggml_backend_cuda_graph_compute(ggml_backend_t
2694
2701
CUDA_CHECK (cudaGraphGetNodes (cuda_ctx->cuda_graph ->graph , nullptr , &cuda_ctx->cuda_graph ->num_nodes ));
2695
2702
// Subsequent call with non-null argument gets nodes
2696
2703
cuda_ctx->cuda_graph ->nodes .resize (cuda_ctx->cuda_graph ->num_nodes );
2704
+ cuda_ctx->cuda_graph ->nodes .clear ();
2697
2705
cuda_ctx->cuda_graph ->params .resize (cuda_ctx->cuda_graph ->num_nodes );
2706
+ cuda_ctx->cuda_graph ->params .clear ();
2698
2707
if (cuda_ctx->cuda_graph ->num_nodes > 0 ) {
2699
2708
CUDA_CHECK (cudaGraphGetNodes (cuda_ctx->cuda_graph ->graph , cuda_ctx->cuda_graph ->nodes .data (), &cuda_ctx->cuda_graph ->num_nodes ));
2700
2709
0 commit comments