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 15, 09:45 UTC
fix:Build torch wheel inline rather than picking from nightly (#18351)
Signed-off-by: Dilip Gowda Bhagavan <dilip.bhagavan@ibm.com>
Dilip Gowda Bhagavan committed
May 21, 2025 at 03:52 UTC
23baa2180b0ebba5ae94073ba9b8e93f88b75486
2 files changed
+29
-4
docker/Dockerfile.s390x
+29
-3
@@ -84,16 +84,40 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \
84
rustup default stable && \
85
rustup show
86
87
+FROM python-install AS torch
88
+ARG TORCH_VERSION=2.7.0
89
+ENV export _GLIBCXX_USE_CXX11_ABI=1
90
+ENV CARGO_HOME=/root/.cargo
91
+ENV RUSTUP_HOME=/root/.rustup
92
+ENV PATH="$CARGO_HOME/bin:$RUSTUP_HOME/bin:$PATH"
93
+
94
+WORKDIR /tmp
95
+
96
+RUN --mount=type=cache,target=/root/.cache/uv \
97
+ --mount=type=bind,from=rust,source=/root/.cargo,target=/root/.cargo,rw \
98
+ --mount=type=bind,from=rust,source=/root/.rustup,target=/root/.rustup,rw \
99
+ git clone https://github.com/pytorch/pytorch.git && \
100
+ cd pytorch && \
101
+ git checkout v2.7.0 && \
102
+ git submodule sync && \
103
+ git submodule update --init --recursive && \
104
+ uv pip install cmake ninja && \
105
+ uv pip install -r requirements.txt && \
106
+ python setup.py bdist_wheel
107
+
108
+
109
FROM python-install AS torch-vision
110
# Install torchvision
89
-ARG TORCH_VERSION=2.7.0.dev20250304
111
+ARG TORCH_VERSION=2.7.0
112
ARG TORCH_VISION_VERSION=v0.20.1
113
WORKDIR /tmp
114
RUN --mount=type=cache,target=/root/.cache/uv \
115
+ --mount=type=bind,from=torch,source=/tmp/pytorch/dist,target=/tmp/torch-wheels/ \
116
git clone https://github.com/pytorch/vision.git && \
117
cd vision && \
118
git checkout $TORCH_VISION_VERSION && \
96
- uv pip install -v torch==${TORCH_VERSION} --extra-index-url https://download.pytorch.org/whl/nightly/cpu && \
119
+ TORCH_WHL_FILE=$(ls /tmp/torch-wheels/*.whl | head -n 1) && \
120
+ uv pip install -v $TORCH_WHL_FILE && \
121
python setup.py bdist_wheel
122
123
FROM python-install AS hf-xet-builder
@@ -138,15 +162,17 @@ RUN --mount=type=cache,target=/root/.cache/uv \
162
--mount=type=bind,from=pyarrow,source=/tmp/arrow/python/dist,target=/tmp/arrow-wheels \
163
--mount=type=bind,from=torch-vision,source=/tmp/vision/dist,target=/tmp/vision-wheels/ \
164
--mount=type=bind,from=hf-xet-builder,source=/tmp/hf-xet/dist,target=/tmp/hf-xet-wheels/ \
165
+ --mount=type=bind,from=torch,source=/tmp/pytorch/dist,target=/tmp/torch-wheels/ \
166
sed -i '/^torch/d' requirements/build.txt && \
167
ARROW_WHL_FILE=$(ls /tmp/arrow-wheels/pyarrow-*.whl | head -n 1) && \
168
VISION_WHL_FILE=$(ls /tmp/vision-wheels/*.whl | head -n 1) && \
169
HF_XET_WHL_FILE=$(ls /tmp/hf-xet-wheels/*.whl | head -n 1) && \
170
+ TORCH_WHL_FILE=$(ls /tmp/torch-wheels/*.whl | head -n 1) && \
171
uv pip install -v \
172
$ARROW_WHL_FILE \
173
$VISION_WHL_FILE \
174
$HF_XET_WHL_FILE \
149
- --extra-index-url https://download.pytorch.org/whl/nightly/cpu \
175
+ $TORCH_WHL_FILE \
176
--index-strategy unsafe-best-match \
177
-r requirements/build.txt \
178
-r requirements/cpu.txt
requirements/cpu.txt
-1
@@ -8,7 +8,6 @@ setuptools>=77.0.3,<80.0.0
8
torch==2.7.0+cpu; platform_machine == "x86_64"
9
torch==2.7.0; platform_system == "Darwin"
10
torch==2.7.0; platform_machine == "ppc64le" or platform_machine == "aarch64"
11
-torch==2.7.0.dev20250304; platform_machine == "s390x"
11
12
# required for the image processor of minicpm-o-2_6, this must be updated alongside torch
13
torchaudio; platform_machine != "ppc64le" and platform_machine != "s390x"