Skip to content

Commit 86a0d09

Browse files
authored
Extracted minimum changes from migration branch (#722)
Migrate PA Repo w/ Minimum Client changes.
1 parent 442915d commit 86a0d09

File tree

5 files changed

+115
-7
lines changed

5 files changed

+115
-7
lines changed

CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ option(TRITON_ENABLE_TESTS "Include tests in build" OFF)
5454
option(TRITON_ENABLE_GPU "Enable GPU support in libraries" OFF)
5555
option(TRITON_ENABLE_ZLIB "Include ZLIB library in build" ON)
5656

57+
# Package Perf Analyzer with the Python Client -- Intended to be used by PA repo
58+
option(TRITON_PACKAGE_PERF_ANALYZER "Include Perf Analyzer in pip wheel" OFF)
59+
5760
set(TRITON_REPO_ORGANIZATION "https://github.com/triton-inference-server" CACHE STRING "Git repository to pull from")
5861
set(TRITON_COMMON_REPO_TAG "main" CACHE STRING "Tag for triton-inference-server/common repo")
5962
set(TRITON_THIRD_PARTY_REPO_TAG "main" CACHE STRING "Tag for triton-inference-server/third_party repo")
@@ -223,6 +226,7 @@ if(TRITON_ENABLE_PYTHON_HTTP OR TRITON_ENABLE_PYTHON_GRPC)
223226
-DTRITON_ENABLE_PERF_ANALYZER_OPENAI:BOOL=${TRITON_ENABLE_PERF_ANALYZER_OPENAI}
224227
-DTRITON_ENABLE_EXAMPLES:BOOL=${TRITON_ENABLE_EXAMPLES}
225228
-DTRITON_ENABLE_TESTS:BOOL=${TRITON_ENABLE_TESTS}
229+
-DTRITON_PACKAGE_PERF_ANALYZER:BOOL=${TRITON_PACKAGE_PERF_ANALYZER}
226230
-DTRITON_ENABLE_GPU:BOOL=${TRITON_ENABLE_GPU}
227231
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
228232
-DCMAKE_INSTALL_PREFIX:PATH=${TRITON_INSTALL_PREFIX}

src/c++/library/CMakeLists.txt

+104-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# Copyright (c) 2020-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# Redistribution and use in source and binary forms, with or without
44
# modification, are permitted provided that the following conditions
@@ -60,7 +60,58 @@ if(TRITON_ENABLE_CC_HTTP OR TRITON_ENABLE_PERF_ANALYZER OR TRITON_ENABLE_EXAMPLE
6060
PRIVATE
6161
client-common-library
6262
)
63-
endif()
63+
64+
add_library(
65+
json_utils_static STATIC
66+
$<TARGET_OBJECTS:json-utils-library>
67+
)
68+
69+
add_library(
70+
TritonClient::json_utils_static ALIAS json_utils_static
71+
)
72+
73+
foreach(_json_target json-utils-library json_utils_static)
74+
target_compile_features(${_json_target} PRIVATE cxx_std_${TRITON_MIN_CXX_STANDARD})
75+
target_compile_options(
76+
${_json_target} PRIVATE
77+
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
78+
-Wall -Wextra -Wno-unused-parameter -Werror>
79+
$<$<CXX_COMPILER_ID:MSVC>:/W0 /D_WIN32_WINNT=0x0A00 /EHsc>
80+
)
81+
82+
set_target_properties(
83+
${_json_target}
84+
PROPERTIES
85+
POSITION_INDEPENDENT_CODE ON
86+
)
87+
88+
target_include_directories(
89+
${_json_target}
90+
PUBLIC
91+
$<INSTALL_INTERFACE:include>
92+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
93+
PRIVATE
94+
${CMAKE_CURRENT_SOURCE_DIR}
95+
)
96+
97+
install(
98+
FILES
99+
${CMAKE_CURRENT_SOURCE_DIR}/json_utils.h
100+
DESTINATION include
101+
)
102+
endforeach()
103+
104+
install(
105+
TARGETS
106+
json_utils_static
107+
EXPORT
108+
triton-client-targets
109+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
110+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
111+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
112+
)
113+
114+
endif() # TRITON_ENABLE_CC_HTTP OR TRITON_ENABLE_PERF_ANALYZER OR TRITON_ENABLE_EXAMPLES
64115

65116
#
66117
# shm_utils
@@ -75,6 +126,56 @@ target_link_libraries(
75126
client-common-library
76127
)
77128

129+
add_library(
130+
shm_utils_static STATIC
131+
$<TARGET_OBJECTS:shm-utils-library>
132+
)
133+
134+
add_library(
135+
TritonClient::shm_utils_static ALIAS shm_utils_static
136+
)
137+
138+
foreach(_shm_target shm-utils-library shm_utils_static)
139+
target_compile_features(${_shm_target} PRIVATE cxx_std_${TRITON_MIN_CXX_STANDARD})
140+
target_compile_options(
141+
${_shm_target} PRIVATE
142+
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
143+
-Wall -Wextra -Wno-unused-parameter -Werror>
144+
$<$<CXX_COMPILER_ID:MSVC>:/W0 /D_WIN32_WINNT=0x0A00 /EHsc>
145+
)
146+
147+
set_target_properties(
148+
${_shm_target}
149+
PROPERTIES
150+
POSITION_INDEPENDENT_CODE ON
151+
)
152+
153+
target_include_directories(
154+
${_shm_target}
155+
PUBLIC
156+
$<INSTALL_INTERFACE:include>
157+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
158+
PRIVATE
159+
${CMAKE_CURRENT_SOURCE_DIR}
160+
)
161+
162+
install(
163+
FILES
164+
${CMAKE_CURRENT_SOURCE_DIR}/shm_utils.h
165+
DESTINATION include
166+
)
167+
endforeach()
168+
169+
install(
170+
TARGETS
171+
shm_utils_static
172+
EXPORT
173+
triton-client-targets
174+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
175+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
176+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
177+
)
178+
78179
if(TRITON_ENABLE_CC_GRPC OR TRITON_ENABLE_PERF_ANALYZER)
79180
#
80181
# libgrpcclient.so and libgrpcclient_static.a
@@ -400,6 +501,7 @@ if(TRITON_ENABLE_CC_HTTP OR TRITON_ENABLE_CC_GRPC OR TRITON_ENABLE_PERF_ANALYZER
400501
FILES
401502
${CMAKE_CURRENT_SOURCE_DIR}/common.h
402503
${CMAKE_CURRENT_SOURCE_DIR}/ipc.h
504+
${CMAKE_CURRENT_SOURCE_DIR}/cencode.h
403505
DESTINATION include
404506
)
405507

src/python/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# Copyright 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# Redistribution and use in source and binary forms, with or without
44
# modification, are permitted provided that the following conditions
@@ -38,6 +38,8 @@ option(TRITON_ENABLE_PERF_ANALYZER "Enable Performance Analyzer" OFF)
3838
option(TRITON_ENABLE_EXAMPLES "Include examples in build" OFF)
3939
option(TRITON_ENABLE_TESTS "Include tests in build" OFF)
4040
option(TRITON_ENABLE_GPU "Enable GPU support in libraries" OFF)
41+
# Package Perf Analyzer with the Python Client -- Intended to be used by PA repo
42+
option(TRITON_PACKAGE_PERF_ANALYZER "Include Perf Analyzer in pip wheel" OFF)
4143

4244
set(TRITON_COMMON_REPO_TAG "main" CACHE STRING "Tag for triton-inference-server/common repo")
4345

src/python/library/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved.
1+
# Copyright (c) 2020-2024, NVIDIA CORPORATION. All rights reserved.
22
#
33
# Redistribution and use in source and binary forms, with or without
44
# modification, are permitted provided that the following conditions
@@ -100,7 +100,7 @@ if (NOT WIN32)
100100
${WHEEL_DEPENDS}
101101
)
102102

103-
if (${TRITON_ENABLE_PERF_ANALYZER})
103+
if (${TRITON_PACKAGE_PERF_ANALYZER})
104104
set(perf_analyzer_arg --perf-analyzer ${CMAKE_INSTALL_PREFIX}/bin/perf_analyzer)
105105
endif()
106106
set(linux_wheel_stamp_file "linux_stamp.whl")

src/python/library/setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22

3-
# Copyright 2020-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
# Copyright 2020-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
44
#
55
# Redistribution and use in source and binary forms, with or without
66
# modification, are permitted provided that the following conditions
@@ -82,7 +82,7 @@ def req_file(filename, folder="requirements"):
8282
data_files = [
8383
("", ["LICENSE.txt"]),
8484
]
85-
if (PLATFORM_FLAG != "any") and ("@TRITON_ENABLE_PERF_ANALYZER@" == "ON"):
85+
if (PLATFORM_FLAG != "any") and ("@TRITON_PACKAGE_PERF_ANALYZER@" == "ON"):
8686
data_files += [("bin", ["perf_analyzer", "perf_client"])]
8787

8888
setup(

0 commit comments

Comments
 (0)