mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-06-08 16:49:08 +08:00
s390x: Fix PyArrow build and add CPU test script for Buildkite CI (#16036)
Signed-off-by: Nishan Acharya <Nishan.Acharya@ibm.com>
This commit is contained in:
parent
9883a18859
commit
7b5ecf79bd
13
.buildkite/scripts/hardware_ci/run-cpu-test-s390x.sh
Executable file
13
.buildkite/scripts/hardware_ci/run-cpu-test-s390x.sh
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This script build the CPU docker image and run the offline inference inside the container.
|
||||||
|
# It serves a sanity check for compilation and basic model usage.
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
# Setup cleanup
|
||||||
|
remove_docker_container() { docker rm -f cpu-test || true; docker system prune -f; }
|
||||||
|
trap remove_docker_container EXIT
|
||||||
|
remove_docker_container
|
||||||
|
|
||||||
|
# Try building the docker image
|
||||||
|
docker build -t cpu-test -f docker/Dockerfile.s390x .
|
||||||
@ -58,7 +58,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
|
|||||||
cd ../../python && \
|
cd ../../python && \
|
||||||
export PYARROW_PARALLEL=4 && \
|
export PYARROW_PARALLEL=4 && \
|
||||||
export ARROW_BUILD_TYPE=release && \
|
export ARROW_BUILD_TYPE=release && \
|
||||||
uv pip install -r requirements/build.txt && \
|
uv pip install -r requirements-build.txt && \
|
||||||
python setup.py build_ext --build-type=$ARROW_BUILD_TYPE --bundle-arrow-cpp bdist_wheel
|
python setup.py build_ext --build-type=$ARROW_BUILD_TYPE --bundle-arrow-cpp bdist_wheel
|
||||||
|
|
||||||
FROM python-install AS numa-build
|
FROM python-install AS numa-build
|
||||||
@ -96,6 +96,22 @@ RUN --mount=type=cache,target=/root/.cache/uv \
|
|||||||
uv pip install -v torch==${TORCH_VERSION} --extra-index-url https://download.pytorch.org/whl/nightly/cpu && \
|
uv pip install -v torch==${TORCH_VERSION} --extra-index-url https://download.pytorch.org/whl/nightly/cpu && \
|
||||||
python setup.py bdist_wheel
|
python setup.py bdist_wheel
|
||||||
|
|
||||||
|
FROM python-install AS hf-xet-builder
|
||||||
|
# Install hf-xet
|
||||||
|
WORKDIR /tmp
|
||||||
|
ENV CARGO_HOME=/root/.cargo
|
||||||
|
ENV RUSTUP_HOME=/root/.rustup
|
||||||
|
ENV PATH="$CARGO_HOME/bin:$RUSTUP_HOME/bin:$PATH"
|
||||||
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||||
|
--mount=type=bind,from=rust,source=/root/.cargo,target=/root/.cargo,rw \
|
||||||
|
--mount=type=bind,from=rust,source=/root/.rustup,target=/root/.rustup,rw \
|
||||||
|
git clone https://github.com/huggingface/xet-core.git && \
|
||||||
|
cd xet-core/hf_xet/ && \
|
||||||
|
uv pip install maturin patchelf && \
|
||||||
|
python -m maturin build --release --out dist && \
|
||||||
|
mkdir -p /tmp/hf-xet/dist && \
|
||||||
|
cp dist/*.whl /tmp/hf-xet/dist/
|
||||||
|
|
||||||
# Final build stage
|
# Final build stage
|
||||||
FROM python-install AS vllm-cpu
|
FROM python-install AS vllm-cpu
|
||||||
ARG PYTHON_VERSION
|
ARG PYTHON_VERSION
|
||||||
@ -120,12 +136,15 @@ RUN --mount=type=cache,target=/root/.cache/uv \
|
|||||||
--mount=type=bind,from=rust,source=/root/.rustup,target=/root/.rustup,rw \
|
--mount=type=bind,from=rust,source=/root/.rustup,target=/root/.rustup,rw \
|
||||||
--mount=type=bind,from=pyarrow,source=/tmp/arrow/python/dist,target=/tmp/arrow-wheels \
|
--mount=type=bind,from=pyarrow,source=/tmp/arrow/python/dist,target=/tmp/arrow-wheels \
|
||||||
--mount=type=bind,from=torch-vision,source=/tmp/vision/dist,target=/tmp/vision-wheels/ \
|
--mount=type=bind,from=torch-vision,source=/tmp/vision/dist,target=/tmp/vision-wheels/ \
|
||||||
|
--mount=type=bind,from=hf-xet-builder,source=/tmp/hf-xet/dist,target=/tmp/hf-xet-wheels/ \
|
||||||
sed -i '/^torch/d' requirements/build.txt && \
|
sed -i '/^torch/d' requirements/build.txt && \
|
||||||
ARROW_WHL_FILE=$(ls /tmp/arrow-wheels/pyarrow-*.whl | head -n 1) && \
|
ARROW_WHL_FILE=$(ls /tmp/arrow-wheels/pyarrow-*.whl | head -n 1) && \
|
||||||
VISION_WHL_FILE=$(ls /tmp/vision-wheels/*.whl | head -n 1) && \
|
VISION_WHL_FILE=$(ls /tmp/vision-wheels/*.whl | head -n 1) && \
|
||||||
|
HF_XET_WHL_FILE=$(ls /tmp/hf-xet-wheels/*.whl | head -n 1) && \
|
||||||
uv pip install -v \
|
uv pip install -v \
|
||||||
$ARROW_WHL_FILE \
|
$ARROW_WHL_FILE \
|
||||||
$VISION_WHL_FILE \
|
$VISION_WHL_FILE \
|
||||||
|
$HF_XET_WHL_FILE \
|
||||||
--extra-index-url https://download.pytorch.org/whl/nightly/cpu \
|
--extra-index-url https://download.pytorch.org/whl/nightly/cpu \
|
||||||
--index-strategy unsafe-best-match \
|
--index-strategy unsafe-best-match \
|
||||||
-r requirements/build.txt \
|
-r requirements/build.txt \
|
||||||
@ -150,3 +169,4 @@ WORKDIR /home/vllm
|
|||||||
|
|
||||||
# Set the default entrypoint
|
# Set the default entrypoint
|
||||||
ENTRYPOINT ["python", "-m", "vllm.entrypoints.openai.api_server"]
|
ENTRYPOINT ["python", "-m", "vllm.entrypoints.openai.api_server"]
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user