CUDA: compress-mode size (#1110)

Co-authored-by: firecoperana <firecoperana>
This commit is contained in:
firecoperana
2026-01-07 10:33:17 -06:00
committed by GitHub
parent 99fbd84971
commit 9c1bef35e8
2 changed files with 13 additions and 0 deletions

View File

@@ -135,6 +135,9 @@ option(GGML_CUDA_NO_VMM "ggml: do not try to use CUDA VMM"
option(GGML_CUDA_FA_ALL_QUANTS "ggml: compile all quants for FlashAttention" OFF)
option(GGML_CUDA_USE_GRAPHS "ggml: use CUDA graphs (llama.cpp only)" ON)
set (GGML_CUDA_FUSION "1" CACHE STRING "ggml: enable/disable fusion")
set (GGML_CUDA_COMPRESSION_MODE "size" CACHE STRING
"ggml: cuda link binary compression mode; requires cuda 12.8+")
set_property(CACHE GGML_CUDA_COMPRESSION_MODE PROPERTY STRINGS "none;speed;balance;size")
option(GGML_IQK_FLASH_ATTENTION "ggml: enable the IQK FlashAttention CPU kernels" ON)
option(GGML_IQK_FA_ALL_QUANTS "ggml: compile all quants for IQK FlashAttention" OFF)

View File

@@ -1171,7 +1171,17 @@ set(CUDA_CXX_FLAGS "")
if (GGML_CUDA)
set(CUDA_FLAGS -use_fast_math -extended-lambda -lineinfo)
message("-- CUDA Toolkit: ${CUDAToolkit_VERSION}")
if (CUDAToolkit_VERSION VERSION_GREATER_EQUAL "12.8")
# Options are:
# - none (not recommended)
# - speed (nvcc's default)
# - balance
# - size
list(APPEND CUDA_FLAGS -compress-mode=${GGML_CUDA_COMPRESSION_MODE})
endif()
if (GGML_FATAL_WARNINGS)
list(APPEND CUDA_FLAGS -Werror all-warnings)
endif()