From ceb77363cd0f9811ec4bec8da2d4434b47ca622e Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Wed, 26 Jun 2024 20:14:22 +0300 Subject: [PATCH] ggml : disable CUDA graphs for non-llama.cpp projects --- ggml/src/CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ggml/src/CMakeLists.txt b/ggml/src/CMakeLists.txt index ba341d37..367153f5 100644 --- a/ggml/src/CMakeLists.txt +++ b/ggml/src/CMakeLists.txt @@ -295,7 +295,16 @@ if (GGML_CUDA) list(APPEND GGML_CDEF_PUBLIC GGML_USE_CUDA) - add_compile_definitions(GGML_CUDA_USE_GRAPHS) + # TODO: for now CUDA graphs should be used only with llama.cpp + # https://github.com/ggerganov/whisper.cpp/issues/2258 + message(STATUS "CMAKE_PROJECT_NAME: ${CMAKE_PROJECT_NAME}") + if (CMAKE_PROJECT_NAME STREQUAL "llama.cpp") + add_compile_definitions(GGML_CUDA_USE_GRAPHS) + message(STATUS "GGML_CUDA_USE_GRAPHS enabled") + else() + message(STATUS "GGML_CUDA_USE_GRAPHS disabled") + endif() + add_compile_definitions(GGML_CUDA_DMMV_X=${GGML_CUDA_DMMV_X}) add_compile_definitions(GGML_CUDA_MMV_Y=${GGML_CUDA_MMV_Y}) add_compile_definitions(K_QUANTS_PER_ITERATION=${GGML_CUDA_KQUANTS_ITER})