Skip to content

Commit

Permalink
ggml : disable CUDA graphs for non-llama.cpp projects
Browse files Browse the repository at this point in the history
  • Loading branch information
ggerganov committed Jun 26, 2024
1 parent dc8cc2d commit ceb7736
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ggml/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down

0 comments on commit ceb7736

Please sign in to comment.