A high-throughput and memory-efficient inference and serving engine for LLMs
[Docker] Fix CUTLASS DSL cu13 install order in Dockerfile (#45204)
Signed-off-by: Mohammad Miadh Angkad <176301910+mmangkad@users.noreply.github.com>
Mohammad Miadh Angkad committed
Jun 11, 2026 at 13:19 UTC
40e065e86a91b312f5b4b20921cde86fa0e577e3
1 file changed
+35
docker/Dockerfile
+35
@@ -218,6 +218,10 @@ COPY requirements/common.txt requirements/common.txt
218
COPY requirements/cuda.txt requirements/cuda.txt
219
COPY use_existing_torch.py use_existing_torch.py
220
COPY pyproject.toml pyproject.toml
221
+# nvidia-cutlass-dsl[cu13] installs -libs-base and -libs-cu13 wheels that
222
+# share paths with different content. uv can extract them in either order,
223
+# leaving base files that break CUDA 13 CuTe DSL JIT.
224
+# TODO(mmangkad): Remove this after NVIDIA/cutlass#3259 is fixed.
225
RUN --mount=type=cache,target=/opt/uv/cache \
226
if [ "$(echo $CUDA_VERSION | cut -d. -f1)" = "12" ]; then \
227
sed -i 's/^nvidia-cutlass-dsl\[cu13\]/nvidia-cutlass-dsl/' requirements/cuda.txt; \
@@ -234,6 +238,13 @@ RUN --mount=type=cache,target=/opt/uv/cache \
238
else \
239
uv pip install --python /opt/venv/bin/python3 -r requirements/cuda.txt \
240
--extra-index-url ${PYTORCH_CUDA_INDEX_BASE_URL}/cu$(echo $CUDA_VERSION | cut -d. -f1,2 | tr -d '.'); \
241
+ fi \
242
+ && if [ "$(echo $CUDA_VERSION | cut -d. -f1)" = "13" ]; then \
243
+ CUTLASS_DSL_VERSION=$(uv pip show --python /opt/venv/bin/python3 nvidia-cutlass-dsl 2>/dev/null | awk '/^Version:/{print $2}') && \
244
+ if [ -n "$CUTLASS_DSL_VERSION" ]; then \
245
+ uv pip install --python /opt/venv/bin/python3 --force-reinstall --no-deps \
246
+ "nvidia-cutlass-dsl-libs-cu13==${CUTLASS_DSL_VERSION}"; \
247
+ fi; \
248
fi
249
250
# Track PyTorch lib versions used during build and match in downstream instances.
@@ -745,6 +756,10 @@ ENV VLLM_ENABLE_CUDA_COMPATIBILITY=0
756
ARG PYTORCH_CUDA_INDEX_BASE_URL
757
COPY requirements/common.txt /tmp/common.txt
758
COPY requirements/cuda.txt /tmp/requirements-cuda.txt
759
+# nvidia-cutlass-dsl[cu13] installs -libs-base and -libs-cu13 wheels that
760
+# share paths with different content. uv can extract them in either order,
761
+# leaving base files that break CUDA 13 CuTe DSL JIT.
762
+# TODO(mmangkad): Remove this after NVIDIA/cutlass#3259 is fixed.
763
RUN --mount=type=cache,target=/opt/uv/cache \
764
if [ "$(echo $CUDA_VERSION | cut -d. -f1)" = "12" ]; then \
765
sed -i 's/^nvidia-cutlass-dsl\[cu13\]/nvidia-cutlass-dsl/' /tmp/requirements-cuda.txt; \
@@ -752,6 +767,13 @@ RUN --mount=type=cache,target=/opt/uv/cache \
767
fi && \
768
uv pip install --system -r /tmp/requirements-cuda.txt \
769
--extra-index-url ${PYTORCH_CUDA_INDEX_BASE_URL}/cu$(echo $CUDA_VERSION | cut -d. -f1,2 | tr -d '.') && \
770
+ if [ "$(echo $CUDA_VERSION | cut -d. -f1)" = "13" ]; then \
771
+ CUTLASS_DSL_VERSION=$(uv pip show --system nvidia-cutlass-dsl 2>/dev/null | awk '/^Version:/{print $2}') && \
772
+ if [ -n "$CUTLASS_DSL_VERSION" ]; then \
773
+ uv pip install --system --force-reinstall --no-deps \
774
+ "nvidia-cutlass-dsl-libs-cu13==${CUTLASS_DSL_VERSION}"; \
775
+ fi; \
776
+ fi && \
777
rm /tmp/requirements-cuda.txt /tmp/common.txt
778
779
# Install FlashInfer JIT cache (requires CUDA-version-specific index URL)
@@ -842,6 +864,19 @@ RUN --mount=type=bind,from=build,src=/tmp/ep_kernels_workspace/dist,target=/vllm
864
uv pip install --system ep_kernels/dist/*.whl --verbose \
865
--extra-index-url ${PYTORCH_CUDA_INDEX_BASE_URL}/cu$(echo $CUDA_VERSION | cut -d. -f1,2 | tr -d '.')
866
867
+# nvidia-cutlass-dsl[cu13] installs -libs-base and -libs-cu13 wheels that
868
+# share paths with different content. Force -libs-cu13 last after runtime
869
+# dependency installs so uv cannot leave base files behind.
870
+# TODO(mmangkad): Remove this after NVIDIA/cutlass#3259 is fixed.
871
+RUN --mount=type=cache,target=/opt/uv/cache \
872
+ if [ "$(echo $CUDA_VERSION | cut -d. -f1)" = "13" ]; then \
873
+ CUTLASS_DSL_VERSION=$(uv pip show --system nvidia-cutlass-dsl 2>/dev/null | awk '/^Version:/{print $2}') && \
874
+ if [ -n "$CUTLASS_DSL_VERSION" ]; then \
875
+ uv pip install --system --force-reinstall --no-deps \
876
+ "nvidia-cutlass-dsl-libs-cu13==${CUTLASS_DSL_VERSION}"; \
877
+ fi; \
878
+ fi
879
+
880
# Download FlashInfer precompiled cubins AFTER all pip installs are done.
881
# This must run after the vLLM wheel and EP kernels installs above, because
882
# those can reinstall/touch flashinfer packages. Downloading cubins earlier