-
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: RHEL8 EA2 Backends #7535
Closed
Closed
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
48e4f46
Uninstall setuptools after TRTLLM build (#7465)
pvijayakrish 9e66d7a
Fixing file permission (#7467)
pvijayakrish 1c83d30
confirmed protobuf cmake error from non-contianer build
nv-kmcgill53 b347380
Merge ORT RHEL changes Into Kyle's RHEL dev (#7498)
fpetrini15 cd95348
Pytorch Backend Manylinux Support
fpetrini15 df213f7
Uncomment dockerfile build
fpetrini15 904885f
Revert
fpetrini15 26dfe6e
Use python3.10
fpetrini15 e6a4984
Install jpeg lib
fpetrini15 b52bb72
confirmed protobuf cmake error from non-contianer build
nv-kmcgill53 6968ac1
Merge ORT RHEL changes Into Kyle's RHEL dev (#7498)
fpetrini15 219f5fb
adding back tritonserver.lib
nv-kmcgill53 0073620
fixup for PR
nv-kmcgill53 b1ea5da
fixup for PR
nv-kmcgill53 25deb30
Use distro
fpetrini15 c54ec51
Don't modify Python version
fpetrini15 bc9d072
Import distro
fpetrini15 18457ea
Formatting
fpetrini15 449d85c
Remove merge artifact
fpetrini15 6344f41
Fix compose tests
fpetrini15 62040d9
Post-rebase hooks
fpetrini15 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,7 +116,8 @@ def fail_if(p, msg): | |
|
||
|
||
def target_platform(): | ||
if FLAGS.target_platform is not None: | ||
# When called by compose.py, FLAGS will be None | ||
if FLAGS and FLAGS.target_platform is not None: | ||
return FLAGS.target_platform | ||
platform_string = platform.system().lower() | ||
if platform_string == "linux": | ||
|
@@ -132,7 +133,8 @@ def target_platform(): | |
|
||
|
||
def target_machine(): | ||
if FLAGS.target_machine is not None: | ||
# When called by compose.py, FLAGS will be None | ||
if FLAGS and FLAGS.target_machine is not None: | ||
return FLAGS.target_machine | ||
return platform.machine().lower() | ||
|
||
|
@@ -639,13 +641,16 @@ def pytorch_cmake_args(images): | |
cmake_backend_arg("pytorch", "TRITON_PYTORCH_DOCKER_IMAGE", None, image), | ||
] | ||
|
||
if FLAGS.enable_gpu: | ||
# TODO: TPRD-372 TorchTRT extension is not currently supported by our manylinux build | ||
# TODO: TPRD-373 NVTX extension is not currently supported by our manylinux build | ||
if target_platform() != "rhel": | ||
if FLAGS.enable_gpu: | ||
cargs.append( | ||
cmake_backend_enable("pytorch", "TRITON_PYTORCH_ENABLE_TORCHTRT", True) | ||
) | ||
cargs.append( | ||
cmake_backend_enable("pytorch", "TRITON_PYTORCH_ENABLE_TORCHTRT", True) | ||
cmake_backend_enable("pytorch", "TRITON_ENABLE_NVTX", FLAGS.enable_nvtx) | ||
) | ||
cargs.append( | ||
cmake_backend_enable("pytorch", "TRITON_ENABLE_NVTX", FLAGS.enable_nvtx) | ||
) | ||
return cargs | ||
|
||
|
||
|
@@ -899,6 +904,203 @@ def install_dcgm_libraries(dcgm_version, target_machine): | |
) | ||
|
||
|
||
def create_dockerfile_buildbase_rhel(ddir, dockerfile_name, argmap): | ||
df = """ | ||
ARG TRITON_VERSION={} | ||
ARG TRITON_CONTAINER_VERSION={} | ||
ARG BASE_IMAGE={} | ||
""".format( | ||
argmap["TRITON_VERSION"], | ||
argmap["TRITON_CONTAINER_VERSION"], | ||
argmap["BASE_IMAGE"], | ||
) | ||
|
||
df += """ | ||
FROM ${BASE_IMAGE} | ||
|
||
ARG TRITON_VERSION | ||
ARG TRITON_CONTAINER_VERSION | ||
""" | ||
|
||
df += """ | ||
# Install docker docker buildx | ||
RUN yum install -y ca-certificates curl gnupg yum-utils \\ | ||
&& yum-config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo \\ | ||
&& yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | ||
# && yum install -y docker.io docker-buildx-plugin | ||
|
||
# libcurl4-openSSL-dev is needed for GCS | ||
# python3-dev is needed by Torchvision | ||
# python3-pip and libarchive-dev is needed by python backend | ||
# libxml2-dev is needed for Azure Storage | ||
# scons is needed for armnn_tflite backend build dep | ||
RUN yum install -y \\ | ||
ca-certificates \\ | ||
autoconf \\ | ||
automake \\ | ||
git \\ | ||
gperf \\ | ||
re2-devel \\ | ||
openssl-devel \\ | ||
libtool \\ | ||
libcurl-devel \\ | ||
libb64-devel \\ | ||
gperftools-devel \\ | ||
patchelf \\ | ||
python3.11-devel \\ | ||
python3-pip \\ | ||
python3-setuptools \\ | ||
rapidjson-devel \\ | ||
python3-scons \\ | ||
pkg-config \\ | ||
unzip \\ | ||
wget \\ | ||
zlib-devel \\ | ||
libarchive-devel \\ | ||
libxml2-devel \\ | ||
numactl-devel \\ | ||
wget | ||
|
||
RUN pip3 install --upgrade pip \\ | ||
&& pip3 install --upgrade \\ | ||
wheel \\ | ||
setuptools \\ | ||
docker \\ | ||
virtualenv | ||
|
||
# Install boost version >= 1.78 for boost::span | ||
# Current libboost-dev apt packages are < 1.78, so install from tar.gz | ||
RUN wget -O /tmp/boost.tar.gz \\ | ||
https://archives.boost.io/release/1.80.0/source/boost_1_80_0.tar.gz \\ | ||
&& (cd /tmp && tar xzf boost.tar.gz) \\ | ||
&& mv /tmp/boost_1_80_0/boost /usr/include/boost | ||
|
||
# Server build requires recent version of CMake (FetchContent required) | ||
# Might not need this if the installed version of cmake is high enough for our build. | ||
# RUN apt update -q=2 \\ | ||
# && apt install -y gpg wget \\ | ||
# && wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null \\ | ||
# && . /etc/os-release \\ | ||
# && echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $UBUNTU_CODENAME main" | tee /etc/apt/sources.list.d/kitware.list >/dev/null \\ | ||
# && apt-get update -q=2 \\ | ||
# && apt-get install -y --no-install-recommends cmake=3.27.7* cmake-data=3.27.7* | ||
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. Are these comments needed? |
||
""" | ||
if FLAGS.enable_gpu: | ||
df += install_dcgm_libraries(argmap["DCGM_VERSION"], target_machine()) | ||
df += """ | ||
ENV TRITON_SERVER_VERSION ${TRITON_VERSION} | ||
ENV NVIDIA_TRITON_SERVER_VERSION ${TRITON_CONTAINER_VERSION} | ||
""" | ||
|
||
df += """ | ||
WORKDIR /workspace | ||
RUN rm -fr * | ||
COPY . . | ||
ENTRYPOINT [] | ||
""" | ||
|
||
with open(os.path.join(ddir, dockerfile_name), "w") as dfile: | ||
dfile.write(df) | ||
|
||
|
||
def create_dockerfile_buildbase_rhel(ddir, dockerfile_name, argmap): | ||
df = """ | ||
ARG TRITON_VERSION={} | ||
ARG TRITON_CONTAINER_VERSION={} | ||
ARG BASE_IMAGE={} | ||
""".format( | ||
argmap["TRITON_VERSION"], | ||
argmap["TRITON_CONTAINER_VERSION"], | ||
argmap["BASE_IMAGE"], | ||
) | ||
|
||
df += """ | ||
FROM ${BASE_IMAGE} | ||
|
||
ARG TRITON_VERSION | ||
ARG TRITON_CONTAINER_VERSION | ||
""" | ||
df += """ | ||
# Install docker docker buildx | ||
RUN yum install -y ca-certificates curl gnupg yum-utils \\ | ||
&& yum-config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo \\ | ||
&& yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | ||
# && yum install -y docker.io docker-buildx-plugin | ||
|
||
# libcurl4-openSSL-dev is needed for GCS | ||
# python3-dev is needed by Torchvision | ||
# python3-pip and libarchive-dev is needed by python backend | ||
# libxml2-dev is needed for Azure Storage | ||
# scons is needed for armnn_tflite backend build dep | ||
RUN yum install -y \\ | ||
ca-certificates \\ | ||
autoconf \\ | ||
automake \\ | ||
git \\ | ||
gperf \\ | ||
re2-devel \\ | ||
openssl-devel \\ | ||
libtool \\ | ||
libcurl-devel \\ | ||
libb64-devel \\ | ||
gperftools-devel \\ | ||
patchelf \\ | ||
python3.11-devel \\ | ||
python3-pip \\ | ||
python3-setuptools \\ | ||
rapidjson-devel \\ | ||
python3-scons \\ | ||
pkg-config \\ | ||
unzip \\ | ||
wget \\ | ||
zlib-devel \\ | ||
libarchive-devel \\ | ||
libxml2-devel \\ | ||
numactl-devel \\ | ||
wget | ||
|
||
RUN pip3 install --upgrade pip \\ | ||
&& pip3 install --upgrade \\ | ||
wheel \\ | ||
setuptools \\ | ||
docker \\ | ||
virtualenv | ||
|
||
# Install boost version >= 1.78 for boost::span | ||
# Current libboost-dev apt packages are < 1.78, so install from tar.gz | ||
RUN wget -O /tmp/boost.tar.gz \\ | ||
https://archives.boost.io/release/1.80.0/source/boost_1_80_0.tar.gz \\ | ||
&& (cd /tmp && tar xzf boost.tar.gz) \\ | ||
&& mv /tmp/boost_1_80_0/boost /usr/include/boost | ||
|
||
# Server build requires recent version of CMake (FetchContent required) | ||
# Might not need this if the installed version of cmake is high enough for our build. | ||
# RUN apt update -q=2 \\ | ||
# && apt install -y gpg wget \\ | ||
# && wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null \\ | ||
# && . /etc/os-release \\ | ||
# && echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $UBUNTU_CODENAME main" | tee /etc/apt/sources.list.d/kitware.list >/dev/null \\ | ||
# && apt-get update -q=2 \\ | ||
# && apt-get install -y --no-install-recommends cmake=3.27.7* cmake-data=3.27.7* | ||
""" | ||
if FLAGS.enable_gpu: | ||
df += install_dcgm_libraries(argmap["DCGM_VERSION"], target_machine()) | ||
df += """ | ||
ENV TRITON_SERVER_VERSION ${TRITON_VERSION} | ||
ENV NVIDIA_TRITON_SERVER_VERSION ${TRITON_CONTAINER_VERSION} | ||
""" | ||
|
||
df += """ | ||
WORKDIR /workspace | ||
RUN rm -fr * | ||
COPY . . | ||
ENTRYPOINT [] | ||
""" | ||
|
||
with open(os.path.join(ddir, dockerfile_name), "w") as dfile: | ||
dfile.write(df) | ||
|
||
|
||
def create_dockerfile_buildbase_rhel(ddir, dockerfile_name, argmap): | ||
df = """ | ||
ARG TRITON_VERSION={} | ||
|
@@ -1301,7 +1503,6 @@ def dockerfile_prepare_container_linux(argmap, backends, enable_gpu, target_mach | |
gpu_enabled=gpu_enabled | ||
) | ||
|
||
# This | ||
if target_platform() == "rhel": | ||
df += """ | ||
# Common dpeendencies. | ||
|
@@ -1816,6 +2017,12 @@ def core_build( | |
os.path.join(repo_install_dir, "lib", "tritonserver.lib"), | ||
os.path.join(install_dir, "bin"), | ||
) | ||
elif target_platform() == "rhel": | ||
cmake_script.mkdir(os.path.join(install_dir, "bin")) | ||
cmake_script.cp( | ||
os.path.join(repo_install_dir, "bin", "tritonserver"), | ||
os.path.join(install_dir, "bin"), | ||
) | ||
elif target_platform() == "rhel": | ||
cmake_script.mkdir(os.path.join(install_dir, "bin")) | ||
cmake_script.cp( | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Aren't
yum update
is required?Also wondering why
yum
notdnf
?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.
@mc-nv ignore these changes for now. There was an issue with the rebasing.
That said, you comments apply to our other RHEL PRs. In general, we can't do
yum update
because it will update the release version from 8.9 to 8.10, which would differ from the release version of the CUDA base container.I have no preference for
yum
vsdnf
.