Skip to content

Commit 75d3361

Browse files
tanmayv25pskiran1mc-nv
authored
Adding support for TensorRT 10 APIs in the backend. Keep TRT 8 support as well (#88) (#89)
* Replace binding index-based methods with name-based alternatives * Remove unused variables * Remove unused variables * Remove allInput*Specified() * Delete TRTV1Interface * Replace getProfileShapeValues() with getProfileTensorValues() * Remove buffer_bindings_ * Enhancements * Replace isExecutionBinding() * Add INT64 support * Remove hasImplicitBatchDimension() * Update Copyright * Remove unused variables * Undo copyright * Undo Copyright * Undo copyright * Fix the handling in INT64 shape tensors output * Fix data dependent output shapes * Fix pre commit errors * Update copyright * Resolve review comments * Include source for building on TRT 8 (#86) (#87) * Include source for building on TRT 8 * Apply suggestions from code review --------- * Fix envvar access in CMake --------- Co-authored-by: Sai Kiran Polisetty <[email protected]> Co-authored-by: Misha Chornyi <[email protected]>
1 parent 5c881ce commit 75d3361

32 files changed

+8797
-759
lines changed

CMakeLists.txt

Lines changed: 45 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -102,35 +102,56 @@ if(${TRITON_ENABLE_NVTX})
102102
add_definitions(-DTRITON_ENABLE_NVTX=1)
103103
endif() # TRITON_ENABLE_NVTX
104104

105+
if(NOT DEFINED ENV{TRT_VERSION})
106+
set(ENV{TRT_VERSION} 10.0.1.6)
107+
endif()
108+
109+
message(STATUS "TRT_VERSION envvar is $ENV{TRT_VERSION}")
110+
111+
#
112+
# FIXME: Update src folder to build with TRT8 and then remove
113+
# src_trt8 folder.
114+
# Currently the iGPU builds are still using TensorRT 8. This means
115+
# we need to keep supporting TRT 8 for this backend. As there has
116+
# been significant clean-ups when moving from TRT 8 to TRT 10
117+
# we are maintaining a previous version of backend for now.
118+
#
119+
if("$ENV{TRT_VERSION}" VERSION_LESS 10)
120+
set(SOURCE_DIR "src_trt8")
121+
else()
122+
set(SOURCE_DIR "src")
123+
endif()
124+
125+
105126
#
106127
# Shared library implementing the Triton Backend API
107128
#
108-
configure_file(src/libtriton_tensorrt.ldscript libtriton_tensorrt.ldscript COPYONLY)
129+
configure_file(${SOURCE_DIR}/libtriton_tensorrt.ldscript libtriton_tensorrt.ldscript COPYONLY)
109130

110131
add_library(
111132
triton-tensorrt-backend SHARED
112-
src/tensorrt.cc
113-
src/model_state.cc
114-
src/tensorrt_model.cc
115-
src/tensorrt_model.h
116-
src/instance_state.cc
117-
src/tensorrt_model_instance.cc
118-
src/tensorrt_model_instance.h
119-
src/tensorrt_utils.cc
120-
src/tensorrt_utils.h
121-
src/filesystem.h
122-
src/filesystem.cc
123-
src/semaphore.h
124-
src/shared_library.h
125-
src/shared_library.cc
126-
src/loader.cc
127-
src/loader.h
128-
src/logging.cc
129-
src/logging.h
130-
src/output_allocator.cc
131-
src/output_allocator.h
132-
src/io_binding_info.cc
133-
src/io_binding_info.h
133+
${SOURCE_DIR}/tensorrt.cc
134+
${SOURCE_DIR}/model_state.cc
135+
${SOURCE_DIR}/tensorrt_model.cc
136+
${SOURCE_DIR}/tensorrt_model.h
137+
${SOURCE_DIR}/instance_state.cc
138+
${SOURCE_DIR}/tensorrt_model_instance.cc
139+
${SOURCE_DIR}/tensorrt_model_instance.h
140+
${SOURCE_DIR}/tensorrt_utils.cc
141+
${SOURCE_DIR}/tensorrt_utils.h
142+
${SOURCE_DIR}/filesystem.h
143+
${SOURCE_DIR}/filesystem.cc
144+
${SOURCE_DIR}/semaphore.h
145+
${SOURCE_DIR}/shared_library.h
146+
${SOURCE_DIR}/shared_library.cc
147+
${SOURCE_DIR}/loader.cc
148+
${SOURCE_DIR}/loader.h
149+
${SOURCE_DIR}/logging.cc
150+
${SOURCE_DIR}/logging.h
151+
${SOURCE_DIR}/output_allocator.cc
152+
${SOURCE_DIR}/output_allocator.h
153+
${SOURCE_DIR}/io_binding_info.cc
154+
${SOURCE_DIR}/io_binding_info.h
134155
)
135156

136157
add_library(
@@ -139,7 +160,7 @@ add_library(
139160

140161
target_include_directories(
141162
triton-tensorrt-backend
142-
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
163+
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_DIR}
143164
)
144165

145166
target_include_directories(

0 commit comments

Comments
 (0)