TensorRT-LLMs/cpp/tensorrt_llm/pybind/CMakeLists.txt
Richard Huo ce580ce4f5
[None][feat] KV Cache Connector API (#7228)
Signed-off-by: jthomson04 <jwillthomson19@gmail.com>
Signed-off-by: richardhuo-nv <rihuo@nvidia.com>
Co-authored-by: jthomson04 <jwillthomson19@gmail.com>
Co-authored-by: Iman Tabrizian <10105175+Tabrizian@users.noreply.github.com>
Co-authored-by: Sharan Chetlur <116769508+schetlur-nv@users.noreply.github.com>
2025-08-28 23:09:27 -04:00

63 lines
1.8 KiB
CMake
Executable File

set(TRTLLM_PYBIND_MODULE bindings)
set(TRTLLM_PYBIND_MODULE
${TRTLLM_PYBIND_MODULE}
PARENT_SCOPE)
set(SRCS
batch_manager/algorithms.cpp
batch_manager/bindings.cpp
batch_manager/cacheTransceiver.cpp
batch_manager/kvCacheConnector.cpp
batch_manager/kvCacheManager.cpp
batch_manager/llmRequest.cpp
executor/bindings.cpp
executor/executor.cpp
executor/executorConfig.cpp
executor/request.cpp
runtime/bindings.cpp
testing/modelSpecBinding.cpp
runtime/moeBindings.cpp
userbuffers/bindings.cpp
../runtime/ipcNvlsMemory.cu
thop/bindings.cpp
bindings.cpp)
include_directories(${PROJECT_SOURCE_DIR}/include)
pybind11_add_module(${TRTLLM_PYBIND_MODULE} ${SRCS})
set_property(TARGET ${TRTLLM_PYBIND_MODULE} PROPERTY POSITION_INDEPENDENT_CODE
ON)
target_link_directories(${TRTLLM_PYBIND_MODULE} PUBLIC
"${TORCH_INSTALL_PREFIX}/lib")
if(ENABLE_NVSHMEM)
target_link_libraries(${TRTLLM_PYBIND_MODULE} PUBLIC nvshmem::nvshmem_host
nvshmem::nvshmem_device)
endif()
target_link_libraries(
${TRTLLM_PYBIND_MODULE}
PUBLIC ${SHARED_TARGET}
${UNDEFINED_FLAG}
${NO_AS_NEEDED_FLAG}
${Python3_LIBRARIES}
${TORCH_LIBRARIES}
torch_python
${CUDA_DRV_LIB}
${CUDA_NVML_LIB}
th_common)
target_compile_definitions(
${TRTLLM_PYBIND_MODULE} PUBLIC TRTLLM_PYBIND_MODULE=${TRTLLM_PYBIND_MODULE}
PYBIND11_DETAILED_ERROR_MESSAGES=1)
if(NOT WIN32)
set_target_properties(
${TRTLLM_PYBIND_MODULE}
PROPERTIES
LINK_FLAGS
"-Wl,-rpath,'$ORIGIN/libs' -Wl,-rpath,'$ORIGIN/../nvidia/nccl/lib' ${AS_NEEDED_FLAG} ${UNDEFINED_FLAG}"
)
endif()