1- ARG BASE_IMAGE=nvcr.io/nvidia/tritonserver:25.05 -py3-min
2- ARG PYTORCH_IMAGE=nvcr.io/nvidia/pytorch:25.05 -py3
3- ARG NVRTC_VER=12.9.41 -1
1+ ARG BASE_IMAGE=nvcr.io/nvidia/tritonserver:25.06 -py3-min
2+ ARG PYTORCH_IMAGE=nvcr.io/nvidia/pytorch:25.06 -py3
3+ ARG NVRTC_VER=12.9.86 -1
44ARG TRT_VER=10.11.0.33
55ARG NCCL_VER=2.27.5-1+cuda12.9
66ARG RELEASE_URL_TRT_x86=https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.11.0/tars/TensorRT-${TRT_VER}.Linux.x86_64-gnu.cuda-12.9.tar.gz
77ARG RELEASE_URL_TRT_ARM=https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.11.0/tars/TensorRT-${TRT_VER}.Linux.aarch64-gnu.cuda-12.9.tar.gz
88
99# Versions of packages to copy from pytorch image
10- ARG TORCH_VER=2.8.0a0+5228986c39.nv25.5
11- ARG TORCHVISION_VER=0.22.0a0
10+ ARG TORCH_VER=2.8.0a0+5228986c39.nv25.6
11+ ARG TORCHVISION_VER=0.22.0a0+95f10a4e
1212ARG SETUPTOOLS_VER=78.1.1
1313ARG PYTORCH_TRITON_VER=3.3.0+git96316ce52.nvinternal
1414ARG JINJA2_VER=3.1.6
15- ARG NETWORKX_VER=3.4.2
15+ ARG NETWORKX_VER=3.5
1616ARG SYMPY_VER=1.14.0
1717ARG PACKAGING_VER=23.2
18- ARG FLASH_ATTN_VER=2.7.3
18+ ARG FLASH_ATTN_VER=2.7.4.post1
19+
20+ ARG TENSORRTLLM_REPO=https://github.com/NVIDIA/TensorRT-LLM.git
21+ ARG TENSORRTLLM_REPO_TAG=release/1.0
22+ ARG TENSORRTLLM_VER=1.0.0
1923
2024FROM ${PYTORCH_IMAGE} AS pytorch_image
2125FROM ${BASE_IMAGE} AS install_dependencies
2226
23- ARG TENSORRTLLM_REPO=https://github.com/NVIDIA/TensorRT-LLM.git
24- ARG TENSORRTLLM_REPO_TAG=release/0.21
25-
2627WORKDIR /workspace
2728
28- ARG CCACHE_REMOTE_STORAGE
29- ARG CCACHE_URL
30- ENV CCACHE_DEBUG=1
31-
32- RUN if [ -n "${CCACHE_REMOTE_STORAGE}" ] ; then \
33- curl -k -L ${CCACHE_URL} -o ccache.tar.gz ; \
34- tar -xzf ccache.tar.gz -C /usr/local --strip-components=1 ; \
35- rm ccache.tar.gz ; \
36- ccache --set-config=remote_only=true ; \
37- ccache --set-config=remote_storage=${CCACHE_REMOTE_STORAGE} ; \
38- ccache --set-config=log_file=/tmp/ccache.log ; \
39- ccache -p ; \
40- fi
41-
42- ARG TORCH_VER
43- ARG TORCHVISION_VER
44- ARG SETUPTOOLS_VER
45- ARG PYTORCH_TRITON_VER
46- ARG JINJA2_VER
47- ARG NETWORKX_VER
48- ARG SYMPY_VER
49- ARG PACKAGING_VER
50- ARG FLASH_ATTN_VER
51- # Copy PyTorch package from PyTorch image
52- COPY --from=pytorch_image /usr/local/lib/lib* /usr/local/lib/
53- COPY --from=pytorch_image /usr/local/lib/python3.12/dist-packages/torch /usr/local/lib/python3.12/dist-packages/torch
54- COPY --from=pytorch_image /usr/local/lib/python3.12/dist-packages/torch-${TORCH_VER}.dist-info /usr/local/lib/python3.12/dist-packages/torch-${TORCH_VER}.dist-info
55- COPY --from=pytorch_image /usr/local/lib/python3.12/dist-packages/torchgen /usr/local/lib/python3.12/dist-packages/torchgen
56- COPY --from=pytorch_image /usr/local/lib/python3.12/dist-packages/torchvision /usr/local/lib/python3.12/dist-packages/torchvision
57- COPY --from=pytorch_image /usr/local/lib/python3.12/dist-packages/torchvision-${TORCHVISION_VER}.dist-info /usr/local/lib/python3.12/dist-packages/torchvision-${TORCHVISION_VER}.dist-info
58- COPY --from=pytorch_image /usr/local/lib/python3.12/dist-packages/torchvision.libs /usr/local/lib/python3.12/dist-packages/torchvision.libs
59- COPY --from=pytorch_image /usr/local/lib/python3.12/dist-packages/setuptools /usr/local/lib/python3.12/dist-packages/setuptools
60- COPY --from=pytorch_image /usr/local/lib/python3.12/dist-packages/setuptools-${SETUPTOOLS_VER}.dist-info /usr/local/lib/python3.12/dist-packages/setuptools-${SETUPTOOLS_VER}.dist-info
61- COPY --from=pytorch_image /usr/local/lib/python3.12/dist-packages/functorch /usr/local/lib/python3.12/dist-packages/functorch
62- COPY --from=pytorch_image /usr/local/lib/python3.12/dist-packages/pytorch_triton-${PYTORCH_TRITON_VER}.dist-info /usr/local/lib/python3.12/dist-packages/pytorch_triton-${PYTORCH_TRITON_VER}.dist-info
63- COPY --from=pytorch_image /usr/local/lib/python3.12/dist-packages/triton /usr/local/lib/python3.12/dist-packages/triton
64- COPY --from=pytorch_image /usr/local/lib/python3.12/dist-packages/jinja2 /usr/local/lib/python3.12/dist-packages/jinja2
65- COPY --from=pytorch_image /usr/local/lib/python3.12/dist-packages/jinja2-${JINJA2_VER}.dist-info /usr/local/lib/python3.12/dist-packages/jinja2-${JINJA2_VER}.dist-info
66- COPY --from=pytorch_image /usr/local/lib/python3.12/dist-packages/networkx /usr/local/lib/python3.12/dist-packages/networkx
67- COPY --from=pytorch_image /usr/local/lib/python3.12/dist-packages/networkx-${NETWORKX_VER}.dist-info /usr/local/lib/python3.12/dist-packages/networkx-${NETWORKX_VER}.dist-info
68- COPY --from=pytorch_image /usr/local/lib/python3.12/dist-packages/sympy /usr/local/lib/python3.12/dist-packages/sympy
69- COPY --from=pytorch_image /usr/local/lib/python3.12/dist-packages/sympy-${SYMPY_VER}.dist-info /usr/local/lib/python3.12/dist-packages/sympy-${SYMPY_VER}.dist-info
70- COPY --from=pytorch_image /usr/local/lib/python3.12/dist-packages/packaging /usr/local/lib/python3.12/dist-packages/packaging
71- COPY --from=pytorch_image /usr/local/lib/python3.12/dist-packages/packaging-${PACKAGING_VER}.dist-info /usr/local/lib/python3.12/dist-packages/packaging-${PACKAGING_VER}.dist-info
72- COPY --from=pytorch_image /usr/local/lib/python3.12/dist-packages/flash_attn /usr/local/lib/python3.12/dist-packages/flash_attn
73- COPY --from=pytorch_image /usr/local/lib/python3.12/dist-packages/flash_attn-${FLASH_ATTN_VER}.dist-info /usr/local/lib/python3.12/dist-packages/flash_attn-${FLASH_ATTN_VER}.dist-info
74- COPY --from=pytorch_image /usr/local/lib/python3.12/dist-packages/flash_attn_2_cuda.cpython-312-*-linux-gnu.so /usr/local/lib/python3.12/dist-packages/
75-
7629# Might not need to copy cusparseLt in the future once it's included in DLFW cuda container
7730COPY --from=pytorch_image /usr/local/cuda/lib64/libcusparseLt* /usr/local/cuda/lib64/
7831
@@ -134,7 +87,7 @@ RUN pip3 install /usr/local/tensorrt/python/tensorrt-*-cp$( python3 -c "import s
13487ENV LD_LIBRARY_PATH=/usr/local/tensorrt/lib:${LD_LIBRARY_PATH}
13588ENV TRT_ROOT=/usr/local/tensorrt
13689
137- FROM install_dependencies AS tensorrt_llm_build
90+ FROM install_dependencies AS tensorrt_llm_code
13891
13992WORKDIR /workspace
14093
@@ -143,16 +96,6 @@ ARG TENSORRTLLM_REPO_TAG
14396RUN git-lfs install \
14497 && git clone --single-branch --recurse-submodules --depth=1 -b ${TENSORRTLLM_REPO_TAG} ${TENSORRTLLM_REPO} tensorrt_llm
14598
146- RUN pip3 install --no-cache-dir polygraphy==0.49.9 mpi4py==3.1.5 cmake==4.0.3 ninja
147- ENV CMAKE_POLICY_VERSION_MINIMUM=3.5
148-
149- RUN cd tensorrt_llm && \
150- if [ -n "${CCACHE_REMOTE_STORAGE}" ] ; then \
151- python3 scripts/build_wheel.py --trt_root="${TRT_ROOT}" --clean --use_ccache ; \
152- else \
153- python3 scripts/build_wheel.py --trt_root="${TRT_ROOT}" --clean ; \
154- fi
155-
15699# Final stage to build the TRT-LLM container
157100FROM ${BASE_IMAGE} AS final_stage
158101
@@ -239,17 +182,15 @@ ENV TRT_VERSION=$TRT_VER
239182ENV LD_LIBRARY_PATH=/usr/local/tensorrt/lib:${LD_LIBRARY_PATH}
240183ENV TRT_ROOT=/usr/local/tensorrt
241184
242- WORKDIR /tmp
243-
244185# Install TRT-LLM wheel after all the dependencies are installed
245- COPY --from=tensorrt_llm_build /workspace/tensorrt_llm/build/tensorrt_llm*whl .
246- RUN pip3 install --no-cache-dir tensorrt_llm*.whl \
247- && rm -f tensorrt_llm*.whl
186+ ARG TENSORRTLLM_VER
187+ RUN --mount=type=secret,id=pypi_extra_values,env=PYPI_EXTRA_VALUES \
188+ pip install --no-cache-dir ${PYPI_EXTRA_VALUES} tensorrt_llm==${TENSORRTLLM_VER}
248189
249190# Copying the Tensorrt LLM scripts and applications
250191WORKDIR /app
251- COPY --from=tensorrt_llm_build /workspace/tensorrt_llm/triton_backend/scripts scripts
252- COPY --from=tensorrt_llm_build /workspace/tensorrt_llm/triton_backend/all_models all_models
253- COPY --from=tensorrt_llm_build /workspace/tensorrt_llm/triton_backend/inflight_batcher_llm/client client
254- COPY --from=tensorrt_llm_build /workspace/tensorrt_llm/triton_backend/tools tools
255- COPY --from=tensorrt_llm_build /workspace/tensorrt_llm/examples examples
192+ COPY --from=tensorrt_llm_code /workspace/tensorrt_llm/triton_backend/scripts scripts
193+ COPY --from=tensorrt_llm_code /workspace/tensorrt_llm/triton_backend/all_models all_models
194+ COPY --from=tensorrt_llm_code /workspace/tensorrt_llm/triton_backend/inflight_batcher_llm/client client
195+ COPY --from=tensorrt_llm_code /workspace/tensorrt_llm/triton_backend/tools tools
196+ COPY --from=tensorrt_llm_code /workspace/tensorrt_llm/examples examples
0 commit comments