-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: tritonfrontend
support for no/partial endpoint builds
#7605
base: main
Are you sure you want to change the base?
Changes from 14 commits
59d9aa8
0b66a27
173216e
c9fa783
384da14
40da2be
f08de59
f3fc425
a657cae
be36c42
80ee6e5
723df84
48acc3e
c6efa9e
2932600
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -521,15 +521,21 @@ if(${TRITON_ENABLE_TRACING}) | |
if (NOT WIN32) | ||
target_include_directories( | ||
tracing-library | ||
PRIVATE ${OPENTELEMETRY_CPP_INCLUDE_DIRS} | ||
PUBLIC ${OPENTELEMETRY_CPP_INCLUDE_DIRS} | ||
) | ||
|
||
target_link_libraries( | ||
tracing-library | ||
PRIVATE | ||
PUBLIC | ||
${OPENTELEMETRY_CPP_LIBRARIES}) | ||
endif() | ||
|
||
set_target_properties( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this modification still required? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without the |
||
tracing-library | ||
PROPERTIES | ||
POSITION_INDEPENDENT_CODE ON | ||
) | ||
|
||
target_link_libraries( | ||
tracing-library | ||
PUBLIC | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,8 +62,6 @@ set( | |
../../common.h | ||
../../common.cc | ||
../../restricted_features.h | ||
../../tracer.h | ||
$<$<BOOL:${TRITON_ENABLE_TRACING}>:../../tracer.cc> | ||
../../classification.cc | ||
) | ||
|
||
|
@@ -96,13 +94,10 @@ endif() | |
|
||
if(${TRITON_ENABLE_TRACING}) | ||
message("TRACING/STATS IS CURRENTLY NOT SUPPORTED.") | ||
find_package(absl CONFIG REQUIRED) | ||
find_package(CURL CONFIG REQUIRED) | ||
find_package(nlohmann_json CONFIG REQUIRED) | ||
find_package(opentelemetry-cpp CONFIG REQUIRED) | ||
list(APPEND PY_BINDING_DEPENDENCY_LIBS | ||
tracing-library | ||
) | ||
list( | ||
APPEND PY_BINDING_DEPENDENCY_LIBS | ||
$<TARGET_OBJECTS:tracing-library> | ||
) | ||
endif() | ||
|
||
# ===================== End of Collection =================================== | ||
|
@@ -122,8 +117,6 @@ pybind11_add_module( | |
${PYTHON_FRONTEND_BINDING_SRCS} | ||
) | ||
|
||
target_include_directories(py-bindings PRIVATE ${CMAKE_SOURCE_DIR}/src) | ||
|
||
target_link_libraries( | ||
py-bindings | ||
PRIVATE | ||
|
@@ -153,14 +146,21 @@ if(${TRITON_ENABLE_GPU}) | |
endif() | ||
|
||
if(${TRITON_ENABLE_TRACING}) | ||
target_include_directories( | ||
target_include_directories( | ||
py-bindings | ||
PRIVATE ${OPENTELEMETRY_CPP_INCLUDE_DIRS} | ||
PUBLIC ${OPENTELEMETRY_CPP_INCLUDE_DIRS} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this may also be unnecessary now for the same reason as described below. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed in comment above. |
||
) | ||
|
||
target_link_libraries( | ||
py-bindings | ||
PUBLIC | ||
${OPENTELEMETRY_CPP_LIBRARIES} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now that these libs are exposed publicly by the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without linking and including these libraries/directories to |
||
) | ||
|
||
target_compile_definitions( | ||
py-bindings | ||
PRIVATE TRITON_ENABLE_TRACING=1 | ||
) | ||
target_compile_definitions( | ||
py-bindings | ||
PRIVATE TRITON_ENABLE_TRACING=1 | ||
) | ||
endif() | ||
|
||
if(${TRITON_ENABLE_STATS}) | ||
|
@@ -177,5 +177,6 @@ set_target_properties( | |
py-bindings | ||
PROPERTIES | ||
BUILD_RPATH "$ORIGIN:/opt/tritonserver/lib" | ||
POSITION_INDEPENDENT_CODE ON | ||
) | ||
# ===================== End of Python Bindings ============================== | ||
# ===================== End of Python Bindings ============================== |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fpetrini15 any general wisdom on necessity of PUBLIC vs PRIVATE and why it fixes it? or @KrishnanPrash
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC, by specifying
tracing-library
's dependencies as private, any other targets that depend ontracing-library
will not be able to see its dependencies (not inherited)--they will have to link/include them again individually. In this case, it appears that to compile thetracing-library
, CMake needs to have access to the open telemetry include directories. From my meetings with @KrishnanPrash, it seems like anything that depends ontracing-library
also needs to have access to this directory. In this case, it would make sense to expose this as a public dependency.Take this with a grain of salt, however, as I am no CMake expert 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing from PRIVATE to PUBLIC allows the directories to be included with any library that links to the tracing-library, which in this case is py-bindings.