Skip to content

Commit 0521c2b

Browse files
committed
Revert "feat: nanobind bindings (#5961)"
This reverts commit 5bff317.
1 parent ae28b3a commit 0521c2b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+21
-5932
lines changed

cpp/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ set(TRT_LIB TensorRT::NvInfer)
198198
get_filename_component(TRT_LLM_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR} PATH)
199199

200200
set(3RDPARTY_DIR ${TRT_LLM_ROOT_DIR}/3rdparty)
201-
if(BINDING_TYPE STREQUAL "pybind" OR BUILD_DEEP_EP)
201+
if(BINDING_TYPE STREQUAL "pybind")
202202
add_subdirectory(${3RDPARTY_DIR}/pybind11
203203
${CMAKE_CURRENT_BINARY_DIR}/pybind11)
204204
endif()
@@ -217,7 +217,7 @@ include_directories(
217217
${3RDPARTY_DIR}/cutlass/tools/util/include
218218
${3RDPARTY_DIR}/NVTX/include
219219
${3RDPARTY_DIR}/json/include)
220-
if(BINDING_TYPE STREQUAL "pybind" OR BUILD_DEEP_EP)
220+
if(BINDING_TYPE STREQUAL "pybind")
221221
include_directories(${3RDPARTY_DIR}/pybind11/include)
222222
endif()
223223
if(BINDING_TYPE STREQUAL "nanobind")

cpp/include/tensorrt_llm/batch_manager/runtimeBuffers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class RuntimeBuffers
168168

169169
public:
170170
//! Additional buffers depending on model type
171-
std::shared_ptr<TransformerBuffers> transformerBuffers;
171+
std::unique_ptr<TransformerBuffers> transformerBuffers;
172172
std::unique_ptr<RnnStateBuffers> rnnStateBuffers;
173173

174174
//! Encoder-Decoder

cpp/tensorrt_llm/batch_manager/runtimeBuffers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void RuntimeBuffers::create(SizeType32 maxBatchSize, SizeType32 maxBeamWidth,
8484

8585
if (modelConfig.isTransformerBased())
8686
{
87-
transformerBuffers = std::make_shared<TransformerBuffers>(maxBatchSize, maxBeamWidth, maxAttentionWindowVec,
87+
transformerBuffers = std::make_unique<TransformerBuffers>(maxBatchSize, maxBeamWidth, maxAttentionWindowVec,
8888
maxAttentionWindow, sinkTokenLen, runtime, modelConfig, worldConfig);
8989
}
9090
if (modelConfig.isRnnBased())

cpp/tensorrt_llm/nanobind/CMakeLists.txt

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,7 @@ set(TRTLLM_NB_MODULE
33
${TRTLLM_NB_MODULE}
44
PARENT_SCOPE)
55

6-
set(SRCS
7-
batch_manager/algorithms.cpp
8-
batch_manager/bindings.cpp
9-
batch_manager/buffers.cpp
10-
batch_manager/cacheTransceiver.cpp
11-
batch_manager/kvCacheManager.cpp
12-
batch_manager/llmRequest.cpp
13-
executor/bindings.cpp
14-
executor/executor.cpp
15-
executor/executorConfig.cpp
16-
executor/request.cpp
17-
runtime/bindings.cpp
18-
testing/modelSpecBinding.cpp
19-
runtime/moeBindings.cpp
20-
userbuffers/bindings.cpp
21-
../runtime/ipcNvlsMemory.cu
22-
bindings.cpp)
6+
set(SRCS ../runtime/ipcNvlsMemory.cu bindings.cpp)
237

248
include_directories(${PROJECT_SOURCE_DIR}/include)
259

@@ -30,29 +14,20 @@ set_property(TARGET ${TRTLLM_NB_MODULE} PROPERTY POSITION_INDEPENDENT_CODE ON)
3014
target_link_directories(${TRTLLM_NB_MODULE} PUBLIC
3115
"${TORCH_INSTALL_PREFIX}/lib")
3216

33-
if(ENABLE_NVSHMEM)
34-
target_link_libraries(${TRTLLM_NB_MODULE} PUBLIC nvshmem::nvshmem_host
35-
nvshmem::nvshmem_device)
36-
endif()
37-
3817
target_link_libraries(
3918
${TRTLLM_NB_MODULE}
40-
PUBLIC ${SHARED_TARGET}
41-
${UNDEFINED_FLAG}
42-
${NO_AS_NEEDED_FLAG}
43-
${Python3_LIBRARIES}
44-
${TORCH_LIBRARIES}
45-
torch_python
46-
${CUDA_NVML_LIB})
19+
PUBLIC ${SHARED_TARGET} ${UNDEFINED_FLAG} ${NO_AS_NEEDED_FLAG}
20+
${Python3_LIBRARIES} ${TORCH_LIBRARIES} torch_python)
21+
4722
target_compile_definitions(
4823
${TRTLLM_NB_MODULE} PUBLIC TRTLLM_NB_MODULE=${TRTLLM_NB_MODULE}
49-
PYBIND11_DETAILED_ERROR_MESSAGES=1)
24+
NB_DETAILED_ERROR_MESSAGES=1)
5025

5126
if(NOT WIN32)
5227
set_target_properties(
5328
${TRTLLM_NB_MODULE}
5429
PROPERTIES
5530
LINK_FLAGS
56-
"-Wl,-rpath,'$ORIGIN/libs' -Wl,-rpath,'$ORIGIN/../nvidia/nccl/lib' -Wl,-rpath,'${CUDA_TOOLKIT_ROOT_DIR}/targets/x86_64-linux/lib/stubs' ${AS_NEEDED_FLAG} ${UNDEFINED_FLAG}"
31+
"-Wl,-rpath,'$ORIGIN/libs' -Wl,-rpath,'$ORIGIN/../nvidia/nccl/lib' ${AS_NEEDED_FLAG} ${UNDEFINED_FLAG}"
5732
)
5833
endif()

cpp/tensorrt_llm/nanobind/batch_manager/algorithms.cpp

Lines changed: 0 additions & 178 deletions
This file was deleted.

cpp/tensorrt_llm/nanobind/batch_manager/algorithms.h

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)