From d53a49bab5fbec1abd9478ad531f30b55973ed8f Mon Sep 17 00:00:00 2001 From: Sai Kiran Polisetty Date: Tue, 2 Jul 2024 11:16:58 +0530 Subject: [PATCH 1/5] Update CMakeList.txt --- CMakeLists.txt | 82 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 55 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c54e07a..3b54243 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -132,33 +132,61 @@ endif() # configure_file(${SOURCE_DIR}/libtriton_tensorrt.ldscript libtriton_tensorrt.ldscript COPYONLY) -add_library( - triton-tensorrt-backend SHARED - ${SOURCE_DIR}/tensorrt.cc - ${SOURCE_DIR}/model_state.cc - ${SOURCE_DIR}/tensorrt_model.cc - ${SOURCE_DIR}/tensorrt_model.h - ${SOURCE_DIR}/instance_state.cc - ${SOURCE_DIR}/tensorrt_model_instance.cc - ${SOURCE_DIR}/tensorrt_model_instance.h - ${SOURCE_DIR}/shape_tensor.cc - ${SOURCE_DIR}/shape_tensor.h - ${SOURCE_DIR}/tensorrt_utils.cc - ${SOURCE_DIR}/tensorrt_utils.h - ${SOURCE_DIR}/filesystem.h - ${SOURCE_DIR}/filesystem.cc - ${SOURCE_DIR}/semaphore.h - ${SOURCE_DIR}/shared_library.h - ${SOURCE_DIR}/shared_library.cc - ${SOURCE_DIR}/loader.cc - ${SOURCE_DIR}/loader.h - ${SOURCE_DIR}/logging.cc - ${SOURCE_DIR}/logging.h - ${SOURCE_DIR}/output_allocator.cc - ${SOURCE_DIR}/output_allocator.h - ${SOURCE_DIR}/io_binding_info.cc - ${SOURCE_DIR}/io_binding_info.h -) +if("$ENV{TRT_VERSION}" VERSION_LESS 10) + add_library( + triton-tensorrt-backend SHARED + ${SOURCE_DIR}/tensorrt.cc + ${SOURCE_DIR}/model_state.cc + ${SOURCE_DIR}/tensorrt_model.cc + ${SOURCE_DIR}/tensorrt_model.h + ${SOURCE_DIR}/instance_state.cc + ${SOURCE_DIR}/tensorrt_model_instance.cc + ${SOURCE_DIR}/tensorrt_model_instance.h + ${SOURCE_DIR}/shape_tensor.cc + ${SOURCE_DIR}/shape_tensor.h + ${SOURCE_DIR}/tensorrt_utils.cc + ${SOURCE_DIR}/tensorrt_utils.h + ${SOURCE_DIR}/filesystem.h + ${SOURCE_DIR}/filesystem.cc + ${SOURCE_DIR}/semaphore.h + ${SOURCE_DIR}/shared_library.h + ${SOURCE_DIR}/shared_library.cc + ${SOURCE_DIR}/loader.cc + ${SOURCE_DIR}/loader.h + ${SOURCE_DIR}/logging.cc + ${SOURCE_DIR}/logging.h + ${SOURCE_DIR}/output_allocator.cc + ${SOURCE_DIR}/output_allocator.h + ${SOURCE_DIR}/io_binding_info.cc + ${SOURCE_DIR}/io_binding_info.h + ) +else() + add_library( + triton-tensorrt-backend SHARED + ${SOURCE_DIR}/tensorrt.cc + ${SOURCE_DIR}/model_state.cc + ${SOURCE_DIR}/tensorrt_model.cc + ${SOURCE_DIR}/tensorrt_model.h + ${SOURCE_DIR}/instance_state.cc + ${SOURCE_DIR}/tensorrt_model_instance.cc + ${SOURCE_DIR}/tensorrt_model_instance.h + ${SOURCE_DIR}/tensorrt_utils.cc + ${SOURCE_DIR}/tensorrt_utils.h + ${SOURCE_DIR}/filesystem.h + ${SOURCE_DIR}/filesystem.cc + ${SOURCE_DIR}/semaphore.h + ${SOURCE_DIR}/shared_library.h + ${SOURCE_DIR}/shared_library.cc + ${SOURCE_DIR}/loader.cc + ${SOURCE_DIR}/loader.h + ${SOURCE_DIR}/logging.cc + ${SOURCE_DIR}/logging.h + ${SOURCE_DIR}/output_allocator.cc + ${SOURCE_DIR}/output_allocator.h + ${SOURCE_DIR}/io_binding_info.cc + ${SOURCE_DIR}/io_binding_info.h + ) +endif() add_library( TritonTensorRTBackend::triton-tensorrt-backend ALIAS triton-tensorrt-backend From 54580940abdeb760aca0f4f74f35df4bccd39766 Mon Sep 17 00:00:00 2001 From: Sai Kiran Polisetty Date: Tue, 2 Jul 2024 12:07:31 +0530 Subject: [PATCH 2/5] Update --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b54243..c729fcc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -142,8 +142,6 @@ if("$ENV{TRT_VERSION}" VERSION_LESS 10) ${SOURCE_DIR}/instance_state.cc ${SOURCE_DIR}/tensorrt_model_instance.cc ${SOURCE_DIR}/tensorrt_model_instance.h - ${SOURCE_DIR}/shape_tensor.cc - ${SOURCE_DIR}/shape_tensor.h ${SOURCE_DIR}/tensorrt_utils.cc ${SOURCE_DIR}/tensorrt_utils.h ${SOURCE_DIR}/filesystem.h @@ -170,6 +168,8 @@ else() ${SOURCE_DIR}/instance_state.cc ${SOURCE_DIR}/tensorrt_model_instance.cc ${SOURCE_DIR}/tensorrt_model_instance.h + ${SOURCE_DIR}/shape_tensor.cc + ${SOURCE_DIR}/shape_tensor.h ${SOURCE_DIR}/tensorrt_utils.cc ${SOURCE_DIR}/tensorrt_utils.h ${SOURCE_DIR}/filesystem.h From 19c30545022283aa06e99c7898f2588e72f75389 Mon Sep 17 00:00:00 2001 From: Sai Kiran Polisetty Date: Tue, 2 Jul 2024 22:51:47 +0530 Subject: [PATCH 3/5] Update --- CMakeLists.txt | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c729fcc..8314a3b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -122,17 +122,6 @@ message(STATUS "TRT_VERSION envvar is $ENV{TRT_VERSION}") # if("$ENV{TRT_VERSION}" VERSION_LESS 10) set(SOURCE_DIR "src_trt8") -else() - set(SOURCE_DIR "src") -endif() - - -# -# Shared library implementing the Triton Backend API -# -configure_file(${SOURCE_DIR}/libtriton_tensorrt.ldscript libtriton_tensorrt.ldscript COPYONLY) - -if("$ENV{TRT_VERSION}" VERSION_LESS 10) add_library( triton-tensorrt-backend SHARED ${SOURCE_DIR}/tensorrt.cc @@ -159,6 +148,7 @@ if("$ENV{TRT_VERSION}" VERSION_LESS 10) ${SOURCE_DIR}/io_binding_info.h ) else() + set(SOURCE_DIR "src") add_library( triton-tensorrt-backend SHARED ${SOURCE_DIR}/tensorrt.cc @@ -188,6 +178,11 @@ else() ) endif() +# +# Shared library implementing the Triton Backend API +# +configure_file(${SOURCE_DIR}/libtriton_tensorrt.ldscript libtriton_tensorrt.ldscript COPYONLY) + add_library( TritonTensorRTBackend::triton-tensorrt-backend ALIAS triton-tensorrt-backend ) From 6e5328df4467a9c78546600a4ff0b4fafd74fdd1 Mon Sep 17 00:00:00 2001 From: Sai Kiran Polisetty Date: Tue, 2 Jul 2024 23:36:33 +0530 Subject: [PATCH 4/5] Update --- CMakeLists.txt | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8314a3b..9057db3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,6 +147,13 @@ if("$ENV{TRT_VERSION}" VERSION_LESS 10) ${SOURCE_DIR}/io_binding_info.cc ${SOURCE_DIR}/io_binding_info.h ) + # Shared library implementing the Triton Backend API + configure_file(${SOURCE_DIR}/libtriton_tensorrt.ldscript libtriton_tensorrt.ldscript COPYONLY) + + target_include_directories( + triton-tensorrt-backend + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_DIR} + ) else() set(SOURCE_DIR "src") add_library( @@ -176,22 +183,19 @@ else() ${SOURCE_DIR}/io_binding_info.cc ${SOURCE_DIR}/io_binding_info.h ) -endif() + # Shared library implementing the Triton Backend API + configure_file(${SOURCE_DIR}/libtriton_tensorrt.ldscript libtriton_tensorrt.ldscript COPYONLY) -# -# Shared library implementing the Triton Backend API -# -configure_file(${SOURCE_DIR}/libtriton_tensorrt.ldscript libtriton_tensorrt.ldscript COPYONLY) + target_include_directories( + triton-tensorrt-backend + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_DIR} + ) +endif() add_library( TritonTensorRTBackend::triton-tensorrt-backend ALIAS triton-tensorrt-backend ) -target_include_directories( - triton-tensorrt-backend - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_DIR} -) - target_include_directories( triton-tensorrt-backend PRIVATE ${TRITON_TENSORRT_INCLUDE_PATHS} From 37d4f8c0e6b3245faf5cb3b71da4928b0a3c4658 Mon Sep 17 00:00:00 2001 From: Sai Kiran Polisetty Date: Tue, 2 Jul 2024 23:42:00 +0530 Subject: [PATCH 5/5] Formatting --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9057db3..847cdd1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -151,8 +151,8 @@ if("$ENV{TRT_VERSION}" VERSION_LESS 10) configure_file(${SOURCE_DIR}/libtriton_tensorrt.ldscript libtriton_tensorrt.ldscript COPYONLY) target_include_directories( - triton-tensorrt-backend - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_DIR} + triton-tensorrt-backend + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_DIR} ) else() set(SOURCE_DIR "src") @@ -187,8 +187,8 @@ else() configure_file(${SOURCE_DIR}/libtriton_tensorrt.ldscript libtriton_tensorrt.ldscript COPYONLY) target_include_directories( - triton-tensorrt-backend - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_DIR} + triton-tensorrt-backend + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_DIR} ) endif()