Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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 Dockerfile.sdk
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ARG TRITON_ENABLE_GPU=ON
ARG JAVA_BINDINGS_JAVACPP_PRESETS_TAG=1.5.8
ARG JAVA_BINDINGS_MAVEN_URL=https://archive.apache.org/dist/maven/maven-3/3.9.16/binaries/apache-maven-3.9.16-bin.tar.gz
# DCGM version to install for Model Analyzer
ARG DCGM_VERSION=4.5.3-1
ARG DCGM_VERSION=4.6.1-1

ARG NVIDIA_TRITON_SERVER_SDK_VERSION=unknown
ARG NVIDIA_BUILD_ID=unknown
Expand Down
104 changes: 35 additions & 69 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,10 @@
"release_version": "2.72.0dev",
"triton_container_version": "26.08dev",
"upstream_container_version": "26.07",
"ort_version": "1.27.0",
"ort_openvino_version": "2026.2.0",
"standalone_openvino_version": "2026.2.0",
"dcgm_version": "4.5.3-1",
"rhel_py_version": "3.12.3",
"ort_version": "1.28.0",
"ort_openvino_version": "2026.3.0",
"standalone_openvino_version": "2026.3.0",
"dcgm_version": "4.6.1-1",
}

CORE_BACKENDS = ["ensemble"]
Expand Down Expand Up @@ -554,8 +553,6 @@ def backend_cmake_args(images, components, be, install_dir, library_paths):
args = onnxruntime_cmake_args(images, library_paths)
elif be == "openvino":
args = openvino_cmake_args()
elif be == "python":
args = python_cmake_args()
elif be == "dali":
args = dali_cmake_args()
elif be == "pytorch":
Expand Down Expand Up @@ -614,18 +611,6 @@ def backend_cmake_args(images, components, be, install_dir, library_paths):
return cargs


def python_cmake_args():
cargs = []
if target_platform() == "rhel":
cargs.append(
cmake_backend_arg(
"python", "PYBIND11_PYTHON_VERSION", "STRING", FLAGS.rhel_py_version
)
)

return cargs


def pytorch_cmake_args(images):
if "pytorch" in images:
image = images["pytorch"]
Expand Down Expand Up @@ -925,9 +910,6 @@ def create_dockerfile_buildbase_rhel(ddir, dockerfile_name, argmap):
numactl-devel \\
openssl-devel \\
pkg-config \\
python3-pip \\
python3-scons \\
python3-setuptools \\
rapidjson-devel \\
re2-devel \\
readline-devel \\
Expand Down Expand Up @@ -961,20 +943,21 @@ def create_dockerfile_buildbase_rhel(ddir, dockerfile_name, argmap):
""".format(
os.getenv("CCACHE_REMOTE_STORAGE")
)
# Requires openssl-devel to be installed first for pyenv build to be successful
df += change_default_python_version_rhel(FLAGS.rhel_py_version)
df += set_python_location_to_manylinux_for_rhel()
df += restore_embeddable_python_lib_rhel()
df += """

RUN pip3 install --upgrade pip \\
&& pip3 install --upgrade \\
auditwheel \\
build \\
wheel \\
setuptools \\
cmake==4.0.3 \\
docker \\
virtualenv \\
patchelf==0.17.2 \\
cmake==4.0.3
scons \\
setuptools \\
virtualenv \\
wheel
"""
df += f"""
# Install boost version >= 1.78 for boost::span
Expand Down Expand Up @@ -1335,9 +1318,10 @@ def dockerfile_prepare_container_linux(argmap, backends, enable_gpu, target_mach
libb64-devel \\
gperftools-devel \\
wget \\
python3.12-pip \\
numactl-devel

"""
df += set_python_location_to_manylinux_for_rhel()
df += """
RUN pip3 install patchelf==0.17.2

"""
Expand Down Expand Up @@ -1412,8 +1396,7 @@ def dockerfile_prepare_container_linux(argmap, backends, enable_gpu, target_mach
openssl-devel \\
readline-devel
"""
# Requires openssl-devel to be installed first for pyenv build to be successful
df += change_default_python_version_rhel(FLAGS.rhel_py_version)
df += set_python_location_to_manylinux_for_rhel()
df += """
RUN pip3 install --upgrade pip \\
&& pip3 install --upgrade \\
Expand Down Expand Up @@ -1554,30 +1537,30 @@ def add_cpu_libs_to_linux_dockerfile(backends, target_machine):
return df


def change_default_python_version_rhel(version):
df = f"""
# The python library version available for install via 'yum install python3.X-devel' does not
# match the version of python inside the RHEL base container. This means that python packages
# installed within the container will not be picked up by the python backend stub process pybind
# bindings. It must instead must be installed via pyenv.
ENV PYENV_ROOT=/opt/pyenv_build
RUN curl https://pyenv.run | bash
ENV PATH="${{PYENV_ROOT}}/bin:$PATH"
RUN eval "$(pyenv init -)"
RUN CONFIGURE_OPTS=\"--with-openssl=/usr/lib64\" && pyenv install {version} \\
&& cp ${{PYENV_ROOT}}/versions/{version}/lib/libpython3* /usr/lib64/

# RHEL image has several python versions. It's important
# to set the correct version, otherwise, packages that are
# pip installed will not be found during testing.
ENV PYVER={version} PYTHONPATH=/opt/python/v
RUN ln -sf ${{PYENV_ROOT}}/versions/${{PYVER}}* ${{PYTHONPATH}}
ENV PYBIN=${{PYTHONPATH}}/bin
ENV PYTHON_BIN_PATH=${{PYBIN}}/python${{PYVER}} PATH=${{PYBIN}}:${{PATH}}
def set_python_location_to_manylinux_for_rhel():
df = """
ENV PATH="/opt/_internal/pipx/shared/bin:$PATH"
"""
return df


def restore_embeddable_python_lib_rhel():
# The manylinux base container configures CPython with --disable-shared,
# so no libpython*.so is ever built, and its finalize.sh then compresses
# every libpython*.a into static-libs-for-embedding-only.tar.xz and drops
# the originals. triton_python_backend_stub links pybind11::embed and so
# needs that archive. Restore it in place -- the path it unpacks to is
# exactly the LIBDIR the interpreter's sysconfig reports, which is where
# pybind11's FindPythonLibsNew looks.
#
# This deliberately fails the build if the archive is absent: without it
# the stub link fails much later with an unresolvable -lpython<ver>.
return """
RUN tar -xvf /opt/_internal/static-libs-for-embedding-only.tar.xz \\
-C /opt/_internal
"""


def create_build_dockerfiles(
container_build_dir, images, backends, repoagents, caches, endpoints
):
Expand Down Expand Up @@ -1987,17 +1970,6 @@ def backend_build(
cmake_script.mkdir(os.path.join(install_dir, "backends"))
cmake_script.rmdir(os.path.join(install_dir, "backends", be))

# The python library version available for install via 'yum install python3.X-devel' does not
# match the version of python inside the RHEL base container. This means that python packages
# installed within the container will not be picked up by the python backend stub process pybind
# bindings. It must instead must be installed via pyenv. We package it here for better usability.
if target_platform() == "rhel" and be == "python":
major_minor_version = ".".join((FLAGS.rhel_py_version).split(".")[:2])
version_matched_files = "/usr/lib64/libpython" + major_minor_version + "*"
cmake_script.cp(
version_matched_files, os.path.join(repo_install_dir, "backends", be)
)

cmake_script.cpdir(
os.path.join(repo_install_dir, "backends", be),
os.path.join(install_dir, "backends"),
Expand Down Expand Up @@ -2616,12 +2588,6 @@ def enable_all():
default=DEFAULT_TRITON_VERSION_MAP["dcgm_version"],
help="This flag sets the DCGM version for Triton Inference Server to be built. Default: the latest supported version.",
)
parser.add_argument(
"--rhel-py-version",
required=False,
default=DEFAULT_TRITON_VERSION_MAP["rhel_py_version"],
help="This flag sets the Python version for RHEL platform of Triton Inference Server to be built. Default: the latest supported version.",
)
parser.add_argument(
"--build-secret",
action="append",
Expand Down
16 changes: 8 additions & 8 deletions compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
FLAGS = None


#### helper functions
# helper functions
def log(msg, force=False):
if force or not FLAGS.quiet:
try:
Expand Down Expand Up @@ -255,35 +255,35 @@ def create_argmap(images, skip_pull):
vars = p_path.stdout
log_verbose("inspect args: {}".format(vars))

e0 = re.search("TRITON_SERVER_GPU_ENABLED=([\S]{1,}) ", vars)
e0 = re.search("TRITON_SERVER_GPU_ENABLED=([\\S]{1,}) ", vars)
e1 = re.search("CUDA_VERSION", vars)
gpu_enabled = False
if e0 != None:
if e0 is not None:
gpu_enabled = e0.group(1) == "1"
elif e1 != None:
elif e1 is not None:
gpu_enabled = True
fail_if(
gpu_enabled != enable_gpu,
"Error: full container provided was build with "
"'TRITON_SERVER_GPU_ENABLED' as {} and you are composing container"
"with 'TRITON_SERVER_GPU_ENABLED' as {}".format(gpu_enabled, enable_gpu),
)
e = re.search("TRITON_SERVER_VERSION=([\S]{6,}) ", vars)
e = re.search("TRITON_SERVER_VERSION=([\\S]{6,}) ", vars)
version = "" if e is None else e.group(1)
fail_if(
len(version) == 0,
"docker inspect to find triton server version failed, {}".format(p_path.stderr),
)
e = re.search("NVIDIA_TRITON_SERVER_VERSION=([\S]{5,}) ", vars)
e = re.search("NVIDIA_TRITON_SERVER_VERSION=([\\S]{5,}) ", vars)
container_version = "" if e is None else e.group(1)
fail_if(
len(container_version) == 0,
"docker inspect to find triton container version failed, {}".format(vars),
)
dcgm_ver = re.search("DCGM_VERSION=([\S]{4,}) ", vars)
dcgm_ver = re.search("DCGM_VERSION=([\\S]{4,}) ", vars)
dcgm_version = ""
if dcgm_ver is None:
dcgm_version = "4.5.3-1"
dcgm_version = "4.6.1-1"
log(
"WARNING: DCGM version not found from image, installing the earlierst version {}".format(
dcgm_version
Expand Down
7 changes: 3 additions & 4 deletions qa/L0_backend_python/env/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ rm -rf *.tar.gz
install_build_deps
install_conda

# Test conda env without custom Python backend stub This environment should
# always use the default Python version shipped in the container. For Ubuntu
# 24.04 it is Python 3.12, for Ubuntu 22.04 is Python 3.10 and for Ubuntu 20.04
# is 3.8.
# Test conda env without custom Python backend stub. This environment should
# always use the default Python version shipped in the container, which is
# 3.12 -- nothing below that is supported.
path_to_conda_pack='$$TRITON_MODEL_DIRECTORY/python_3_12_environment.tar.gz'
create_conda_env "3.12" "python-3-12"
conda install -c conda-forge libstdcxx-ng=14 -y
Expand Down
28 changes: 6 additions & 22 deletions qa/L0_backend_python/examples/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,33 +42,18 @@ pip3 uninstall -y numpy
# NOTE: Using this subtest as a test case that involves using a python model with
# numpy 2.X without changing the environments used in all the other test cases.
if [ "$TEST_JETSON" == "0" ] && [[ ${TEST_WINDOWS} == 0 ]]; then
if [ ${PYTHON_ENV_VERSION} == "8" ]; then
# Python 3.8 does not support numpy 2.x, so installing numpy1.x
pip3 install "numpy<2"
pip3 install torch==2.0.0+cu117 -f https://download.pytorch.org/whl/torch_stable.html torchvision==0.15.0+cu117
else
# Python 3.9 >= supports numpy 2.x.
pip3 install "numpy>=2"
pip3 install torch==2.5.0 torchvision==0.20.0 --index-url https://download.pytorch.org/whl/cu124
fi
pip3 install "numpy>=2"
pip3 install torch==2.5.0 torchvision==0.20.0 --index-url https://download.pytorch.org/whl/cu124
else
if [ ${PYTHON_ENV_VERSION} == "8" ]; then
# Python 3.8 does not support numpy 2.x, so installing numpy1.x
pip3 install "numpy<2"
pip3 install torch==2.0.0 -f https://download.pytorch.org/whl/torch_stable.html torchvision==0.15.0
else
# Python 3.9 >= supports numpy 2.x.
pip3 install "numpy>=2"
pip3 install torch==2.5.0 -f https://download.pytorch.org/whl/torch_stable.html torchvision==0.20.0
fi
pip3 install "numpy>=2"
pip3 install torch==2.5.0 -f https://download.pytorch.org/whl/torch_stable.html torchvision==0.20.0
fi

# Install `validators` for Model Instance Kind example
pip3 install validators

# Install JAX
# Jax has dropped the support for Python 3.8. See https://jax.readthedocs.io/en/latest/changelog.html
if [ "$TEST_JETSON" == "0" ] && [ ${PYTHON_ENV_VERSION} != "8" ]; then
if [ "$TEST_JETSON" == "0" ]; then
pip install -U "jax[cuda12]"
fi

Expand Down Expand Up @@ -152,8 +137,7 @@ kill_server

# JAX AddSub
# JAX is not supported on Jetson
# Jax has dropped the support for Python 3.8. See https://jax.readthedocs.io/en/latest/changelog.html
if [ "$TEST_JETSON" == "0" ] && [ ${PYTHON_ENV_VERSION} != "8" ]; then
if [ "$TEST_JETSON" == "0" ]; then
CLIENT_LOG="../examples_jax_client.log"
mkdir -p models/jax/1/
cp examples/jax/model.py models/jax/1/model.py
Expand Down
Loading
Loading