Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python_tools.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## INITENV +PATH PYTHON3PATH %{i}/${PYTHON3_LIB_SITE_PACKAGES}
Source: none

Requires: root curl python3 xrootd llvm hdf5 yoda opencv
Requires: root curl python3 xrootd llvm hdf5 yoda opencv triton-inference-client
Requires: professor2 rivet frontier_client onnxruntime openldap pacparser

Requires: py3-anyio
Expand Down
24 changes: 24 additions & 0 deletions rapidjson.spec
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

34 changes: 29 additions & 5 deletions triton-inference-client.spec
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
Expand All @@ -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
Expand Down Expand Up @@ -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 \
Copy link
Contributor

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 buildpy below), 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...)

Copy link
Contributor Author

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 for triton/src/c++/CMakeLists.txt ( which we use to build the c++ interface) and cmake generate warning message that these are unused flags.

Copy link
Contributor

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.

-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 \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following the above comment, I would include the corresponding lines here:

    -DTRITON_ENABLE_CC_HTTP=OFF \
    -DTRITON_ENABLE_CC_GRPC=OFF \

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these flags are not available for triton/src/python/CMakeLists.txt which we use to build the python interface

-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
Expand Down