Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
5 changes: 5 additions & 0 deletions .buildkite/release-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,10 @@ steps:
queue: arm64_cpu_queue_release
commands:
- "aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/q9t5s3a7"
# TODO(arpera):
# Remove BUILD_NIXL=true once NIXL has a wheel built against torch 2.15
# For details: https://github.com/vllm-project/vllm/pull/60090
# Tracking issue report: https://github.com/ai-dynamo/nixl/issues/2297
- |
DOCKER_BUILDKIT=1 docker buildx build --load \
$(bash .buildkite/scripts/docker-build-metadata-args.sh cu134) \
Expand All @@ -366,6 +370,7 @@ steps:
--build-arg torch_cuda_arch_list="${CUDA_ARCH_AARCH64}" \
--build-arg INSTALL_KV_CONNECTORS=true \
--build-arg INSTALL_RUBIN_PRERELEASE=true \
--build-arg BUILD_NIXL=true \
--build-arg TRITON_INSTALL_FROM_SOURCE_REPO=https://github.com/triton-lang/triton.git \
--build-arg TRITON_INSTALL_FROM_SOURCE_REVISION=3f6e41132b5edf639bfb872ad73d4688765e08b8 \
--build-arg RUN_WHEEL_CHECK=false \
Expand Down
42 changes: 42 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ ARG UV_KEYRING_PROVIDER=${PIP_KEYRING_PROVIDER}
# Flag enables built-in KV-connector dependency libs into docker images
ARG INSTALL_KV_CONNECTORS=false

# Flag builds NIXL, including its NIXL EP extension for the installed PyTorch,
# from source and installs it in place of the nixl packages from the KV-connector
# requirements
ARG BUILD_NIXL=false

#################### BASE BUILD IMAGE ####################
# prepare basic build environment
FROM ${BUILD_BASE_IMAGE} AS base
Expand Down Expand Up @@ -548,6 +553,24 @@ RUN --mount=type=cache,target=/opt/uv/cache \
(cd "${TRITON_WORKSPACE}/dist" \
&& sha256sum build-state > wheel.sha256); \
fi

# Build NIXL and its NIXL EP extension against the PyTorch installed here when
# requested. The wheels are installed by the final image, which has no compiler.
ARG BUILD_NIXL
COPY tools/install_nixl_from_source_ubuntu.py /tmp/install_nixl_from_source.py
RUN --mount=type=bind,source=requirements,target=/tmp/vllm-requirements,ro \
set -eux; \
NIXL_WORKSPACE=/tmp/nixl_workspace; \
mkdir -p "${NIXL_WORKSPACE}/dist"; \
if [ "${BUILD_NIXL}" = "true" ]; then \
dnf install -y --setopt=install_weak_deps=False autoconf automake libtool; \
dnf clean all; \
rm -rf /var/cache/dnf; \
NIXL_REQUIREMENTS_FILE=/tmp/vllm-requirements/kv_connectors.txt \
WHEELS_CACHE_HOME="${NIXL_WORKSPACE}/dist" \
MAX_JOBS="${max_jobs:-}" \
python3 /tmp/install_nixl_from_source.py --skip-system-deps --build-only; \
fi
#################### EXTENSIONS BUILD IMAGE ####################

#################### WHEEL BUILD IMAGE ####################
Expand Down Expand Up @@ -1260,6 +1283,25 @@ RUN --mount=type=cache,target=/opt/uv/cache \
/tmp/install_triton_from_source.sh \
/tmp/triton-source-wheel.sha256

# Install source-built NIXL last, replacing the nixl packages installed above, so
# the image has a NIXL EP build for its PyTorch version. There is no GPU driver
# at build time, so check for the extension instead of importing it.
ARG BUILD_NIXL
RUN --mount=type=cache,target=/opt/uv/cache \
--mount=type=bind,from=extensions-build,source=/tmp/nixl_workspace/dist,target=/tmp/nixl-dist,ro \
set -eu; \
if [ "${BUILD_NIXL}" = "true" ]; then \
ls /tmp/nixl-dist/*.whl; \
uv pip uninstall --system nixl nixl-cu12 nixl-cu13; \

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would emphasise your attention on this particular step. Here I delete already installed nixl packages to use instead our own build of nixl. One important thing is that I remove nixl-cu12 package and then do NOT reinstall it again. For nixl and nixl-cu13 packages everything is fine -- I reinstall them from the source.
Here I just have no idea why vLLM by default installs both packages nixl-cu12 and nixl-cu13 if it is already known that we use cuda 13.4. If I understand right in that case we do not need nixl-cu12 and it's better to not have it installed to prevent from dependency conflicts and simply for smaller size.
If you have any explanation why we still DO need to install nixl-cu12 even though we are using cuda13.4, then please explain it to me in the comments here. Thank you!

@wangshangsam wangshangsam Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooops ... I just saw this message.

So, docker/Dockerfile is used to build nightly images with 3 different CUDA versions: 12.9, 13.0 and 13.4, and we should make sure all 3 works.

I can guess that installing both nixl-cu12 and nixl-cu13 was for this Dockerfile to build both 12.9 and 13.0 images back then, but why installing both instead of installing only the correct one, that was probably a mistake that haven't been caught so far.

uv pip install --system --no-deps /tmp/nixl-dist/*.whl; \
python3 -c "import glob, importlib.util as u, os, torch; \
spec = u.find_spec('nixl_ep_cu' + os.environ['CUDA_VERSION'].split('.')[0]); \
mm = ''.join(torch.__version__.split('.')[:2]); \
ext = glob.glob(os.path.join(spec.submodule_search_locations[0], 'nixl_ep_cpp_torch' + mm + '.*')) if spec else []; \
assert ext, 'NIXL EP has no build for torch ' + torch.__version__; \
print('NIXL EP extension:', ext[0])"; \
fi

ENV VLLM_USAGE_SOURCE production-docker-image
ENV VLLM_BUILD_COMMIT=${VLLM_BUILD_COMMIT:-unknown} \
VLLM_BUILD_PIPELINE=${VLLM_BUILD_PIPELINE:-local} \
Expand Down
3 changes: 3 additions & 0 deletions docker/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
"INSTALL_KV_CONNECTORS": {
"default": "false"
},
"BUILD_NIXL": {
"default": "false"
},
"SCCACHE_BUCKET_NAME": {
"default": "vllm-build-sccache"
},
Expand Down
5 changes: 5 additions & 0 deletions docs/contributing/dockerfile/dockerfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ The `extensions-build` stage can also produce an optional source-built Triton
wheel. `vllm-openai-base` installs that wheel after its other Python
dependencies so dependency resolution cannot restore an older Triton version.

With `BUILD_NIXL=true`, `extensions-build` also builds NIXL, including its NIXL
EP extension for the installed PyTorch, with `tools/install_nixl_from_source_ubuntu.py`.
`vllm-openai-base` then replaces the NIXL packages installed from the KV-connector
requirements with these wheels.

> <figure markdown="span">
> ![](../../assets/contributing/dockerfile-stages-dependency.png){ align="center" alt="query" width="100%" }
> </figure>
Expand Down
5 changes: 5 additions & 0 deletions docs/getting_started/installation/gpu.cuda.inc.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,11 @@ BuildKit does not automatically invalidate cached layers when a mutable Git
ref changes. Use `--no-cache-filter extensions-build` to refresh an empty,
branch, or tag revision.

Set `BUILD_NIXL=true` to build NIXL from source. NIXL's release wheels do not
include the NIXL EP extension for the PyTorch nightly used by the Rubin build.
The build uses the NIXL version pinned in `requirements/kv_connectors.txt` and
replaces the NIXL packages installed from the KV-connector requirements.

For `FINAL_BASE_IMAGE`, use the public, multi-arch
`nvidia/cuda:13.4.1-base-ubuntu24.04` image. Set `NCCL_VERSION` to 2.32.3 or
newer, the first NCCL release with Rubin (SM107) support.
Expand Down
Loading
Loading