Skip to content

Commit 73dc19b

Browse files
committed
[CI] Unifying Dockerfiles for ARM and X86 Builds
Signed-off-by: Kebe <[email protected]>
1 parent 378d33c commit 73dc19b

File tree

5 files changed

+23
-67
lines changed

5 files changed

+23
-67
lines changed

.github/workflows/lint-and-deploy.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ permissions:
77

88
jobs:
99
lint-and-deploy:
10-
runs-on: ubuntu-latest
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, ubuntu-24.04-arm]
1114
steps:
1215
- name: Checkout
1316
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

docker/Dockerfile.arm

Lines changed: 0 additions & 62 deletions
This file was deleted.

docker/Dockerfile.cpu

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,23 @@ RUN --mount=type=cache,target=/root/.cache/uv \
5151
--mount=type=bind,src=requirements/common.txt,target=requirements/common.txt \
5252
--mount=type=bind,src=requirements/cpu.txt,target=requirements/cpu.txt \
5353
uv pip install --upgrade pip && \
54-
uv pip install -r requirements/cpu.txt
54+
uv pip install -r requirements/cpu.txt && \
55+
uv pip install py-cpuinfo # Use this to gather CPU info and optimize based on ARM Neoverse cores
5556

56-
ENV LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4:/opt/venv/lib/libiomp5.so:$LD_PRELOAD"
57+
ARG TARGETARCH
58+
ENV TARGETARCH=${TARGETARCH}
59+
60+
RUN if [ "$TARGETARCH" = "arm64" ]; then \
61+
LIBTCMALLOC_PATH="/usr/lib/aarch64-linux-gnu/libtcmalloc_minimal.so.4"; \
62+
else \
63+
LIBTCMALLOC_PATH="/usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4:/opt/venv/lib/libiomp5.so"; \
64+
fi && \
65+
echo "export LD_PRELOAD=$LIBTCMALLOC_PATH" >> ~/.bashrc
66+
67+
# Ensure that the LD_PRELOAD environment variable for export is in effect.
68+
SHELL ["/bin/bash", "-c"]
69+
70+
ENV LD_PRELOAD=${LD_PRELOAD}
5771

5872
RUN echo 'ulimit -c 0' >> ~/.bashrc
5973

docs/getting_started/installation/cpu/arm.inc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Testing has been conducted on AWS Graviton3 instances for compatibility.
3333
# --8<-- [end:pre-built-images]
3434
# --8<-- [start:build-image-from-source]
3535
```bash
36-
docker build -f docker/Dockerfile.arm \
36+
docker build -f docker/Dockerfile.cpu \
3737
--tag vllm-cpu-env .
3838

3939
# Launching OpenAI server

requirements/cpu.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ setuptools>=77.0.3,<80.0.0
1010
--extra-index-url https://download.pytorch.org/whl/cpu
1111
torch==2.6.0+cpu; platform_machine == "x86_64" # torch>2.6.0+cpu has performance regression on x86 platform, see https://github.com/pytorch/pytorch/pull/151218
1212
torch==2.7.0; platform_system == "Darwin"
13-
torch==2.7.0; platform_machine == "ppc64le" or platform_machine == "aarch64"
13+
torch==2.7.0; platform_machine == "ppc64le"
14+
torch==2.6.0; platform_machine == "aarch64" # for arm64 CPUs, torch 2.7.0 has a issue: https://github.com/vllm-project/vllm/issues/17960
1415

1516
# required for the image processor of minicpm-o-2_6, this must be updated alongside torch
1617
torchaudio; platform_machine != "ppc64le" and platform_machine != "s390x"

0 commit comments

Comments
 (0)