diff --git a/docker/Dockerfile.cpu b/docker/Dockerfile.cpu index c2ce0e88f296..e185c00cb2fa 100644 --- a/docker/Dockerfile.cpu +++ b/docker/Dockerfile.cpu @@ -165,6 +165,23 @@ RUN --mount=type=cache,target=/root/.cache/uv \ --mount=type=cache,target=/vllm-workspace/.deps,sharing=locked \ VLLM_TARGET_DEVICE=cpu python3 setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38 +######################### TRITON-CPU BUILD IMAGE ######################### +FROM base AS vllm-triton-cpu-build + +WORKDIR /vllm-workspace + +RUN mkdir dist + +RUN --mount=type=cache,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/ccache \ + --mount=type=cache,target=/vllm-workspace/.deps,sharing=locked \ + if [ "$TARGETARCH" = "amd64" ] || [ "$VLLM_CPU_X86" != "0" ]; then \ + git clone --recurse-submodules "https://github.com/triton-lang/triton-cpu.git"; \ + cd triton-cpu; \ + git checkout "270e696d"; \ + uv build --wheel --out-dir=../dist; \ + fi + ######################### TEST DEPS ######################### FROM base AS vllm-test-deps @@ -257,7 +274,14 @@ WORKDIR /vllm-workspace RUN --mount=type=cache,target=/root/.cache/uv \ --mount=type=cache,target=/root/.cache/ccache \ --mount=type=bind,from=vllm-build,src=/vllm-workspace/dist,target=dist \ - uv pip install "$(realpath dist/*.whl)[audio,triton-cpu]" + uv pip install "$(realpath dist/*.whl)[audio]" + +RUN --mount=type=cache,target=/root/.cache/uv \ + --mount=type=cache,target=/root/.cache/ccache \ + --mount=type=bind,from=vllm-triton-cpu-build,src=/vllm-workspace/dist,target=dist \ + if [ "$TARGETARCH" = "amd64" ] || [ "$VLLM_CPU_X86" != "0" ]; then \ + uv pip install "$(realpath dist/*.whl)"; \ + fi # Add labels to document build configuration LABEL org.opencontainers.image.title="vLLM CPU" diff --git a/setup.py b/setup.py index a95ee3451b58..3221c1d1bc0e 100644 --- a/setup.py +++ b/setup.py @@ -1195,11 +1195,6 @@ def _read_requirements(filename: str) -> list[str]: "opentelemetry-exporter-otlp>=1.26.0", "opentelemetry-semantic-conventions-ai>=0.4.1", ], - "triton-cpu": [ - "triton @ " - "git+https://github.com/triton-lang/triton-cpu.git@270e696d ; " - "platform_machine == 'x86_64'", - ], # Remove after stable release }, cmdclass=cmdclass, package_data=package_data,