-
Notifications
You must be signed in to change notification settings - Fork 207
Enable triton-client python interface #8943
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
Changes from all commits
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 |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| ### RPM external rapidjson 1.1.0 | ||
| ## INCLUDE cpp-standard | ||
| Source: https://github.com/Tencent/rapidjson/archive/refs/tags/v%{realversion}.tar.gz | ||
| BuildRequires: cmake gmake | ||
| %prep | ||
| %setup -n %{n}-%{realversion} | ||
|
|
||
| %build | ||
| rm -rf ../build ; mkdir ../build ; cd ../build | ||
| cmake ../%{n}-%{realversion} \ | ||
| -DCMAKE_INSTALL_PREFIX="%{i}" \ | ||
| -DCMAKE_INSTALL_LIBDIR=lib \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -DCMAKE_CXX_STANDARD=%{cms_cxx_standard} \ | ||
| -DRAPIDJSON_BUILD_TESTS=OFF \ | ||
| -DRAPIDJSON_BUILD_DOC=OFF \ | ||
| -DRAPIDJSON_BUILD_EXAMPLES=OFF | ||
|
|
||
| make %{makeprocesses} | ||
|
|
||
| %install | ||
| cd ../build | ||
| make install | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| ### RPM external triton-inference-client 2.25.0 | ||
| ## INITENV +PATH PYTHON3PATH %{pkginstroot}/${PYTHON3_LIB_SITE_PACKAGES} | ||
| ## INCLUDE cpp-standard | ||
| %define branch r22.08 | ||
| %define github_user triton-inference-server | ||
|
|
@@ -7,12 +8,14 @@ | |
|
|
||
| Source0: git+https://github.com/%{github_user}/client.git?obj=%{branch}/%{client_tag}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}.tgz | ||
| Source1: git+https://github.com/%{github_user}/common.git?obj=%{branch}/%{common_tag}&export=common-%{realversion}&output=/common-%{realversion}.tgz | ||
| BuildRequires: cmake git | ||
| Requires: protobuf grpc cuda abseil-cpp re2 | ||
| BuildRequires: cmake git py3-wheel | ||
| Requires: protobuf grpc cuda abseil-cpp re2 rapidjson | ||
| Requires: py3-numpy py3-grpcio-tools py3-python-rapidjson | ||
|
|
||
| %prep | ||
|
|
||
| %setup -D -T -b 0 -n %{n}-%{realversion} | ||
| sed -i -e 's|import os|import os,sys|' src/python/library/build_wheel.py | ||
| %setup -D -T -b 1 -n common-%{realversion} | ||
|
|
||
| %build | ||
|
|
@@ -44,25 +47,46 @@ cmake ${PROJ_DIR} \ | |
| -DCMAKE_CXX_STANDARD=%{cms_cxx_standard} \ | ||
| -DTRITON_ENABLE_CC_HTTP=OFF \ | ||
| -DTRITON_ENABLE_CC_GRPC=ON \ | ||
| -DTRITON_ENABLE_PYTHON_HTTP=OFF \ | ||
| -DTRITON_ENABLE_PYTHON_GRPC=OFF \ | ||
| -DTRITON_ENABLE_PERF_ANALYZER=OFF \ | ||
| -DTRITON_ENABLE_EXAMPLES=OFF \ | ||
| -DTRITON_ENABLE_TESTS=OFF \ | ||
| -DTRITON_USE_THIRD_PARTY=OFF \ | ||
| -DTRITON_KEEP_TYPEINFO=ON \ | ||
| -DTRITON_COMMON_REPO_TAG=${common_tag} \ | ||
| -DTRITON_ENABLE_GPU=${TRITON_ENABLE_GPU_VALUE} \ | ||
| -DCMAKE_CXX_FLAGS="-Wno-error -fPIC" \ | ||
| -DFETCHCONTENT_SOURCE_DIR_REPO-COMMON=${COMMON_DIR} \ | ||
| -DCMAKE_PREFIX_PATH="${GRPC_ROOT};${ABSEIL_CPP_ROOT};${RE2_ROOT};${RAPIDJSON_ROOT}" | ||
|
|
||
| make %{makeprocesses} VERBOSE=1 | ||
|
|
||
| rm -rf ../buildpy ; mkdir ../buildpy ; cd ../buildpy | ||
| cmake ../%{n}-%{realversion}/src/python \ | ||
| -DCMAKE_INSTALL_PREFIX="%{i}" \ | ||
| -DCMAKE_INSTALL_LIBDIR=lib \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -DCMAKE_CXX_STANDARD=%{cms_cxx_standard} \ | ||
| -DTRITON_ENABLE_PYTHON_HTTP=OFF \ | ||
|
Contributor
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. Following the above comment, I would include the corresponding lines here:
Contributor
Author
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. these flags are not available for |
||
| -DTRITON_ENABLE_PYTHON_GRPC=ON \ | ||
| -DTRITON_ENABLE_PERF_ANALYZER=OFF \ | ||
| -DTRITON_ENABLE_EXAMPLES=OFF \ | ||
| -DTRITON_ENABLE_TESTS=OFF \ | ||
| -DTRITON_COMMON_REPO_TAG=${common_tag} \ | ||
| -DTRITON_ENABLE_GPU=${TRITON_ENABLE_GPU_VALUE} \ | ||
| -DTRITON_VERSION=%{realversion} \ | ||
| -DCMAKE_CXX_FLAGS="-Wno-error -fPIC" \ | ||
| -DFETCHCONTENT_SOURCE_DIR_REPO-COMMON=${COMMON_DIR} \ | ||
| -DCMAKE_PREFIX_PATH="${GRPC_ROOT};${ABSEIL_CPP_ROOT};${RE2_ROOT}" | ||
| -DCMAKE_PREFIX_PATH="${GRPC_ROOT};${ABSEIL_CPP_ROOT};${RE2_ROOT};${RAPIDJSON_ROOT}" | ||
|
|
||
|
|
||
| make %{makeprocesses} VERBOSE=1 | ||
|
|
||
| %install | ||
| cd ../build | ||
| make install | ||
| cd ../buildpy | ||
| mkdir -p %{i}/${PYTHON3_LIB_SITE_PACKAGES} | ||
| rsync -a ./library/linux/wheel/build/lib/ %{i}/${PYTHON3_LIB_SITE_PACKAGES}/ | ||
|
|
||
| if [ "%{cuda_gcc_support}" = "true" ] ; then | ||
| # modify header for consistent definition of GPU support | ||
|
|
||
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.
If this part is only for building the C++ client (since there's a separate
buildpybelow), shouldn't these lines be kept here? (the defaults for all of these are OFF, right now, but I think it's better to be explicit, in case the default changes...)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.
These
TRITON_ENABLE_PYTHON_*flags are not available fortriton/src/c++/CMakeLists.txt( which we use to build the c++ interface) andcmakegenerate warning message that these are unused flags.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.
Ah, that is because they are in the top-level CMakeLists.txt, but we're using the project-specific ones for more control. Okay, never mind then.