Skip to content

Commit

Permalink
Merge branch 'main' into feature-generic-dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
dyastremsky authored Oct 19, 2024
2 parents fd3866b + fb4da44 commit 333949f
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 16 deletions.
56 changes: 48 additions & 8 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,9 @@ option(TRITON_ENABLE_PERF_ANALYZER_TS "Enable TorchServe support for Performance
option(TRITON_ENABLE_PERF_ANALYZER_OPENAI "Enable OpenAI support for Performance Analyzer" OFF)

#
# Client Options
# Feature Options
#
option(TRITON_ENABLE_CC_HTTP "Build C++ HTTP client libraries" ON)
option(TRITON_ENABLE_CC_GRPC "Build C++ GRPC client libraries" ON)
option(TRITON_ENABLE_PYTHON_HTTP "Build Python HTTP client libraries" OFF)
option(TRITON_ENABLE_PYTHON_GRPC "Build Python GRPC client libraries" OFF)
option(TRITON_ENABLE_GPU "Enable GPU support in libraries" OFF)
option(TRITON_ENABLE_GPU "Enable GPU support in libraries" ON)
option(TRITON_ENABLE_ZLIB "Include ZLIB library in build" ON)

#
Expand All @@ -59,6 +55,36 @@ set(TRITON_THIRD_PARTY_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/third-party-i
# Add third party installation to the search path
set(CMAKE_PREFIX_PATH ${TRITON_THIRD_PARTY_INSTALL_PREFIX} ${CMAKE_PREFIX_PATH})

# Triton CC Client Libraries
find_library(TRITON_HTTP_STATIC_LIB
NAMES httpclient_static
PATHS "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}"
REQUIRED
)
find_library(TRITON_GRPC_STATIC_LIB
NAMES grpcclient_static
PATHS "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}"
REQUIRED
)
find_library(TRITON_JSON_STATIC_LIB
NAMES json_utils_static
PATHS "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}"
REQUIRED
)
find_library(TRITON_SHM_STATIC_LIB
NAMES shm_utils_static
PATHS "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}"
REQUIRED
)

set(TRITON_RHEL_BUILD OFF)
if(LINUX)
file(STRINGS "/etc/os-release" DISTRO_ID_LIKE REGEX "ID_LIKE")
if(${DISTRO_ID_LIKE} MATCHES "rhel|centos")
set (TRITON_RHEL_BUILD ON)
endif(${DISTRO_ID_LIKE} MATCHES "rhel|centos")
endif(LINUX)

#
# Dependencies
#
Expand Down Expand Up @@ -176,8 +202,8 @@ add_executable(
target_link_libraries(
perf_analyzer
PRIVATE
httpclient_static
grpcclient_static
${TRITON_HTTP_STATIC_LIB}
${TRITON_GRPC_STATIC_LIB}
client-backend-library
-lb64
${CMAKE_DL_LIBS}
Expand All @@ -198,6 +224,13 @@ target_compile_definitions(
GIT_SHA=${GIT_SHA}
)

if(TRITON_RHEL_BUILD)
target_compile_definitions(
perf_analyzer
PUBLIC TRITON_RHEL_BUILD=1
)
endif(TRITON_RHEL_BUILD)

# If gpu is enabled then compile with CUDA dependencies
if(TRITON_ENABLE_GPU)
target_compile_definitions(
Expand Down Expand Up @@ -305,6 +338,13 @@ add_executable(
set_target_properties(perf_analyzer_unit_tests
PROPERTIES COMPILE_FLAGS "-Wno-write-strings")

if(TRITON_RHEL_BUILD)
target_compile_definitions(
perf_analyzer_unit_tests
PUBLIC TRITON_RHEL_BUILD=1
)
endif(TRITON_RHEL_BUILD)

target_include_directories(
perf_analyzer_unit_tests
PRIVATE
Expand Down
2 changes: 1 addition & 1 deletion src/client_backend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ target_link_libraries(
PUBLIC
triton-common-json # from repo-common
triton-client-backend-library
json_utils_static
${TRITON_JSON_STATIC_LIB}
${CAPI_TARGET_LINK_LIBRARY}
${TFS_TARGET_LINK_LIBRARY}
${TS_TARGET_LINK_LIBRARY}
Expand Down
2 changes: 1 addition & 1 deletion src/client_backend/openai/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ target_include_directories(
target_link_libraries(
openai-client-backend-library
PUBLIC CURL::libcurl
PUBLIC httpclient_static
PUBLIC ${TRITON_HTTP_STATIC_LIB}
)

if(${TRITON_ENABLE_GPU})
Expand Down
2 changes: 1 addition & 1 deletion src/client_backend/torchserve/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ target_include_directories(
target_link_libraries(
ts-client-backend-library
PUBLIC CURL::libcurl
PUBLIC httpclient_static
PUBLIC ${TRITON_HTTP_STATIC_LIB}
)

if(${TRITON_ENABLE_GPU})
Expand Down
6 changes: 3 additions & 3 deletions src/client_backend/triton/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ target_link_directories(

target_link_libraries(
triton-client-backend-library
PUBLIC grpcclient_static
PUBLIC ${TRITON_GRPC_STATIC_LIB}
PUBLIC gRPC::grpc++
PUBLIC gRPC::grpc
)

target_link_libraries(
triton-client-backend-library
PUBLIC shm_utils_static
PUBLIC httpclient_static
PUBLIC ${TRITON_SHM_STATIC_LIB}
PUBLIC ${TRITON_HTTP_STATIC_LIB}
PRIVATE CURL::libcurl
)

Expand Down
4 changes: 2 additions & 2 deletions src/client_backend/triton_c_api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ target_include_directories(

target_link_libraries(
triton-c-api-backend-library
PUBLIC grpcclient_static
PUBLIC ${TRITON_GRPC_STATIC_LIB}
PUBLIC gRPC::grpc++
PUBLIC gRPC::grpc
)

target_link_libraries(
triton-c-api-backend-library
PUBLIC httpclient_static
PUBLIC ${TRITON_HTTP_STATIC_LIB}
PUBLIC triton-core-serverapi # from repo-core
)

Expand Down
7 changes: 7 additions & 0 deletions src/data_loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@

#include "data_loader.h"

#ifdef TRITON_RHEL_BUILD
#define BUFFERSIZE BUFSIZ
#include <b64/decode.h>
#undef BUFFERSIZE
#else
#include <b64/decode.h>
#endif

#include <rapidjson/filereadstream.h>

#include <fstream>
Expand Down

0 comments on commit 333949f

Please sign in to comment.