diff --git a/ggml/src/ggml-cuda/common.cuh b/ggml/src/ggml-cuda/common.cuh index 37d0d104c..6b36ca90b 100644 --- a/ggml/src/ggml-cuda/common.cuh +++ b/ggml/src/ggml-cuda/common.cuh @@ -1268,7 +1268,7 @@ struct ggml_cuda_graph { CUDA_CHECK(cudaGraphExecDestroy(instance)); } } - // the ggml graph is captured as a series of CUDA graphs, so the GPU can run one chunk while the next is enqueued + // the ggml graph is captured as a series of CUDA graphs, so the GPU can run one chunk while the next is enqueued std::vector instances; size_t num_nodes = 0; std::vector nodes; diff --git a/ggml/src/ggml-cuda/ggml-cuda.cu b/ggml/src/ggml-cuda/ggml-cuda.cu index ff9e9a7ea..454d17d78 100644 --- a/ggml/src/ggml-cuda/ggml-cuda.cu +++ b/ggml/src/ggml-cuda/ggml-cuda.cu @@ -496,7 +496,7 @@ struct ggml_cuda_pool_leg : public ggml_cuda_pool { #ifdef USE_CUDA_GRAPH int n_captured = 0; for (const auto & [key, graph] : ctx.cuda_graphs) { - n_captured += graph->instance != nullptr; + n_captured += graph->instances.size(); } if (n_captured > 0) { GGML_LOG_DEBUG(GGML_CUDA_NAME " pool[%d]: memory freed, %d captured CUDA graphs must be captured again\n", device, n_captured);