CUDA: skip graph compat check when graph is being reused (#32004)

This commit is contained in:
Aman Gupta authored and GitHub committed 2026-11-10 18:53:47 +08:00
1 parent a591cbe17c
commit 15759e0ca9
1 file changed
+3 -1
+3 -1
View File
@@ -5262,7 +5262,9 @@ static enum ggml_status ggml_backend_cuda_graph_compute(ggml_backend_t backend,
ggml_cuda_graph * graph = cuda_ctx->cuda_graph(graph_key);
if (graph->is_enabled()) {
const bool graph_compatible = ggml_cuda_graph_check_compability(cgraph);
// graph->uid is set only for a compatible graph (see ggml_cuda_graph_update_required), so a reused graph needs no new check
const bool graph_reused = cgraph->uid != 0 && cgraph->uid == graph->uid;
const bool graph_compatible = graph_reused || ggml_cuda_graph_check_compability(cgraph);
if (graph_compatible) {
const bool properties_changed = ggml_cuda_graph_update_required(cuda_ctx, cgraph);