Skip to content

Commit ff1868f

Browse files
committed
feat(vllm-tensorizer): Add DeepEP build with NVSHMEM support
1 parent 9a0288b commit ff1868f

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

vllm-tensorizer/Dockerfile

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,40 @@ RUN --mount=type=bind,from=deepgemm-downloader,source=/git/DeepGEMM,target=/work
178178
. /opt/arch_flags.sh && \
179179
/opt/build.sh
180180

181+
FROM alpine/git:2.36.3 AS deepep-downloader
182+
WORKDIR /git
183+
ARG DEEPEP_COMMIT='73b6ea4'
184+
RUN git clone --filter=tree:0 --no-single-branch --no-checkout \
185+
https://github.com/deepseek-ai/DeepEP && \
186+
cd DeepEP && \
187+
git checkout "${DEEPEP_COMMIT}" && \
188+
git submodule update --init --recursive --jobs 8 \
189+
--depth 1 --filter=tree:0
190+
191+
FROM builder-base AS deepep-builder
192+
ARG TARGETPLATFORM
193+
ARG NVSHMEM_VER='3.3.24'
194+
# DeepEP only supports x86_64 (Hopper/Blackwell GPUs)
195+
RUN mkdir -p /wheels /opt/nvshmem/lib && \
196+
if [ "$TARGETPLATFORM" != "linux/amd64" ]; then \
197+
echo "Skipping DeepEP build for $TARGETPLATFORM (x86_64 only)" && \
198+
touch /wheels/.deepep_skipped; \
199+
exit 0; \
200+
fi && \
201+
CUDA_MAJOR=$(echo ${CUDA_VERSION} | cut -d. -f1) && \
202+
NVSHMEM_FILE="libnvshmem-linux-x86_64-${NVSHMEM_VER}_cuda${CUDA_MAJOR}-archive.tar.xz" && \
203+
curl -fSL "https://developer.download.nvidia.com/compute/nvshmem/redist/libnvshmem/linux-x86_64/${NVSHMEM_FILE}" \
204+
-o /tmp/nvshmem.tar.xz && \
205+
tar -xf /tmp/nvshmem.tar.xz -C /opt/nvshmem --strip-components=1 && \
206+
rm /tmp/nvshmem.tar.xz && \
207+
rm -rf /opt/nvshmem/lib/bin /opt/nvshmem/lib/share
208+
RUN --mount=type=bind,from=deepep-downloader,source=/git/DeepEP,target=/workspace,rw \
209+
if [ -f /wheels/.deepep_skipped ]; then exit 0; fi && \
210+
. /opt/arch_flags.sh && \
211+
export NVSHMEM_DIR=/opt/nvshmem && \
212+
export CMAKE_PREFIX_PATH=/opt/nvshmem/lib/cmake:$CMAKE_PREFIX_PATH && \
213+
/opt/build.sh
214+
181215
FROM builder-base AS nixl-builder
182216
RUN apt-get -qq update && \
183217
apt-get -q install --no-install-recommends --no-upgrade -y \
@@ -235,6 +269,16 @@ RUN --mount=type=bind,from=lmcache-builder,source=/wheels,target=/tmp/wheels \
235269
RUN --mount=type=bind,from=deepgemm-builder,source=/wheels,target=/tmp/wheels \
236270
python3 -m pip install --no-cache-dir /tmp/wheels/*.whl -c /tmp/constraints.txt
237271

272+
RUN --mount=type=bind,from=deepep-builder,source=/wheels,target=/tmp/wheels \
273+
if ls /tmp/wheels/*.whl >/dev/null 2>&1; then \
274+
python3 -m pip install --no-cache-dir /tmp/wheels/*.whl -c /tmp/constraints.txt; \
275+
else \
276+
echo "No DeepEP wheels found, skipping install"; \
277+
fi
278+
279+
COPY --link --from=deepep-builder /opt/nvshmem/lib /usr/local/lib/nvshmem
280+
ENV LD_LIBRARY_PATH=/usr/local/lib/nvshmem:$LD_LIBRARY_PATH
281+
238282
COPY --link --from=nixl-builder /opt/nixl /opt/nixl
239283
COPY --link --from=nixl-builder /usr/lib/python3/dist-packages/nixl.pth /usr/lib/python3/dist-packages/nixl.pth
240284

0 commit comments

Comments
 (0)