@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / ab374786c7
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 9, 02:30 UTC

[CPU][IBM Z][Dockerfile] Fix IBM Z builds (#33243)

Signed-off-by: Rehan Khan <Rehan.Khan7@ibm.com>

R3hankhan committed Feb 2, 2026 at 13:11 UTC ab374786c7ebc7e3b6af1778404094261338e4ca
1 file changed +32 -11
docker/Dockerfile.s390x
+32 -11
@@ -1,5 +1,5 @@
1 # Base UBI image for s390x architecture
2 -ARG BASE_UBI_IMAGE_TAG=9.5-1736404155
2 +ARG BASE_UBI_IMAGE_TAG=9.6
3 ARG PYTHON_VERSION=3.12
4 FROM registry.access.redhat.com/ubi9/ubi-minimal:${BASE_UBI_IMAGE_TAG} AS base
5
@@ -14,12 +14,18 @@ ENV LANG=C.UTF-8 \
14
15 # Install development utilities
16 RUN microdnf install -y \
17 - which procps findutils tar vim git gcc-toolset-14 gcc-toolset-14-libatomic-devel patch zlib-devel \
17 + which procps findutils tar vim git gcc-toolset-14 gcc-toolset-14-binutils gcc-toolset-14-libatomic-devel patch zlib-devel \
18 libjpeg-turbo-devel libtiff-devel libpng-devel libwebp-devel freetype-devel harfbuzz-devel \
19 openssl-devel openblas openblas-devel autoconf automake libtool cmake numpy libsndfile \
20 clang llvm-devel llvm-static clang-devel && \
21 microdnf clean all
22
23 +ENV GCC_TOOLSET_ROOT=/opt/rh/gcc-toolset-14/root \
24 + PATH=/opt/rh/gcc-toolset-14/root/usr/bin:/usr/local/bin:/usr/bin:/bin \
25 + LD_LIBRARY_PATH=/opt/rh/gcc-toolset-14/root/usr/lib64:/usr/local/lib:/usr/lib64 \
26 + LIBRARY_PATH=/opt/rh/gcc-toolset-14/root/usr/lib64 \
27 + PKG_CONFIG_PATH=/opt/rh/gcc-toolset-14/root/usr/lib64/pkgconfig
28 +
29 # Python Installation
30 FROM base AS python-install
31 ARG PYTHON_VERSION
@@ -87,13 +93,13 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \
93
94 FROM python-install AS torch-vision
95 # Install torchvision
90 -ARG TORCH_VISION_VERSION=v0.23.0
96 +ARG TORCH_VISION_VERSION=v0.25.0
97 WORKDIR /tmp
98 RUN --mount=type=cache,target=/root/.cache/uv \
99 git clone https://github.com/pytorch/vision.git && \
100 cd vision && \
101 git checkout $TORCH_VISION_VERSION && \
96 - uv pip install torch==2.8.0 --index-url https://download.pytorch.org/whl/cpu && \
102 + uv pip install torch==2.10.0 --index-url https://download.pytorch.org/whl/cpu && \
103 python setup.py bdist_wheel
104
105 FROM python-install AS hf-xet-builder
@@ -174,7 +180,19 @@ RUN --mount=type=cache,target=/root/.cache/uv \
180 if ! grep '#include "dynamic_annotations.h"' numba/_dispatcher.cpp; then \
181 sed -i '/#include "internal\/pycore_atomic.h"/i\#include "dynamic_annotations.h"' numba/_dispatcher.cpp; \
182 fi && python setup.py bdist_wheel
177 -
183 +
184 +# Build OpenCV from source for s390x
185 +FROM python-install AS opencv-builder
186 +WORKDIR /tmp
187 +ARG MAX_JOBS
188 +ARG OPENCV_VERSION=90
189 +ARG ENABLE_HEADLESS=1
190 +RUN --mount=type=cache,target=/root/.cache/uv \
191 + uv pip install numpy setuptools wheel scikit_build build && \
192 + git clone --recursive https://github.com/opencv/opencv-python.git -b ${OPENCV_VERSION} && \
193 + cd opencv-python && \
194 + python -m build --wheel --installer=uv --outdir /tmp/opencv-python/dist
195 +
196 # Build Outlines Core
197 FROM python-install AS outlines-core-builder
198 WORKDIR /tmp
@@ -198,7 +216,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
216 # Final build stage
217 FROM python-install AS vllm-cpu
218 ARG PYTHON_VERSION
201 -
219 +ARG PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu"
220 # Set correct library path for torch and numactl
221 ENV LD_LIBRARY_PATH="/opt/vllm/lib64/python${PYTHON_VERSION}/site-packages/torch/lib:/usr/local/lib:/opt/rh/gcc-toolset-14/root/usr/lib64:$LD_LIBRARY_PATH"
222 ENV C_INCLUDE_PATH="/usr/local/include:$C_INCLUDE_PATH"
@@ -209,7 +227,8 @@ ENV GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1
227 ENV PCP_DIR=/opt/rh/gcc-toolset-14/root
228 ENV PKG_CONFIG_PATH="/opt/rh/gcc-toolset-14/root/usr/lib64/pkgconfig:/usr/local/lib/pkgconfig/"
229 ENV PATH="${VIRTUAL_ENV:+${VIRTUAL_ENV}/bin}:/opt/rh/gcc-toolset-14/root/usr/bin:/usr/local/bin:$CARGO_HOME/bin:$RUSTUP_HOME/bin:$PATH"
212 -
230 +ENV PIP_EXTRA_INDEX_URL=${PIP_EXTRA_INDEX_URL}
231 +ENV UV_EXTRA_INDEX_URL=${PIP_EXTRA_INDEX_URL}
232 COPY . /workspace/vllm
233 WORKDIR /workspace/vllm
234
@@ -225,23 +244,25 @@ RUN --mount=type=cache,target=/root/.cache/uv \
244 --mount=type=bind,from=hf-xet-builder,source=/tmp/hf-xet/dist,target=/tmp/hf-xet-wheels/ \
245 --mount=type=bind,from=numba-builder,source=/tmp/llvmlite/dist,target=/tmp/llvmlite-wheels/ \
246 --mount=type=bind,from=numba-builder,source=/tmp/numba/dist,target=/tmp/numba-wheels/ \
247 + --mount=type=bind,from=opencv-builder,source=/tmp/opencv-python/dist,target=/tmp/opencv-wheels/ \
248 --mount=type=bind,from=outlines-core-builder,source=/tmp/outlines-core/dist,target=/tmp/outlines-core/dist/ \
229 - sed -i '/^torch/d' requirements/build.txt && \
249 ARROW_WHL_FILE=$(ls /tmp/arrow-wheels/pyarrow-*.whl) && \
250 VISION_WHL_FILE=$(ls /tmp/vision-wheels/*.whl) && \
251 HF_XET_WHL_FILE=$(ls /tmp/hf-xet-wheels/*.whl) && \
252 LLVM_WHL_FILE=$(ls /tmp/llvmlite-wheels/*.whl) && \
253 NUMBA_WHL_FILE=$(ls /tmp/numba-wheels/*.whl) && \
254 + OPENCV_WHL_FILE=$(ls /tmp/opencv-wheels/*.whl) && \
255 OUTLINES_CORE_WHL_FILE=$(ls /tmp/outlines-core/dist/*.whl) && \
236 - uv pip install -v \
256 + uv pip install -v \
257 $ARROW_WHL_FILE \
258 $VISION_WHL_FILE \
259 $HF_XET_WHL_FILE \
260 $LLVM_WHL_FILE \
261 $NUMBA_WHL_FILE \
262 + $OPENCV_WHL_FILE \
263 $OUTLINES_CORE_WHL_FILE \
264 --index-strategy unsafe-best-match \
244 - -r requirements/build.txt \
265 + -r requirements/cpu-build.txt \
266 -r requirements/cpu.txt
267
268
@@ -252,7 +273,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
273
274 # setup non-root user for vllm
275 RUN umask 002 && \
255 - useradd --uid 2000 --gid 0 vllm && \
276 + /usr/sbin/useradd --uid 2000 --gid 0 vllm && \
277 mkdir -p /home/vllm && \
278 chmod g+rwx /home/vllm
279