Skip to content

Commit 68f9c6d

Browse files
committed
fix cuda graph spams
1 parent ddce19d commit 68f9c6d

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

ggml/src/ggml-cuda/common.cuh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@ struct ggml_cuda_graph {
11721172
} else {
11731173
number_consecutive_updates = 0;
11741174
}
1175-
if (number_consecutive_updates >= 4) {
1175+
if (number_consecutive_updates >= 4 && !disable_due_to_too_many_updates) {
11761176
GGML_LOG_DEBUG("%s: disabling CUDA graphs due to too many consecutive updates\n", __func__);
11771177
disable_due_to_too_many_updates = true;
11781178
}

ggml/src/ggml-cuda/ggml-cuda.cu

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3929,13 +3929,18 @@ static void ggml_cuda_graph_evaluate_and_capture(ggml_backend_cuda_context * cud
39293929
}
39303930

39313931
#ifdef USE_CUDA_GRAPH
3932+
static bool cugraph_warned = false;
39323933
static bool ggml_cuda_graph_set_enabled(ggml_backend_cuda_context * cuda_ctx, const void * graph_key) {
39333934
ggml_cuda_graph * graph = cuda_ctx->cuda_graph(graph_key);
39343935

39353936
if (graph->graph == nullptr) {
39363937
if (ggml_cuda_info().devices[cuda_ctx->device].cc < GGML_CUDA_CC_AMPERE) {
39373938
if (!graph->disable_due_to_gpu_arch) {
3938-
GGML_LOG_DEBUG("%s: disabling CUDA graphs due to GPU architecture\n", __func__);
3939+
if(!cugraph_warned)
3940+
{
3941+
cugraph_warned = true;
3942+
GGML_LOG_DEBUG("%s: disabling CUDA graphs due to GPU architecture\n", __func__);
3943+
}
39393944
}
39403945
graph->disable_due_to_gpu_arch = true;
39413946
}

0 commit comments

Comments
 (0)