2024-04-02 13:07:30 +08:00
# This vLLM Dockerfile is used to construct image that can build and run vLLM on x86 CPU platform.
2024-06-04 01:39:50 +08:00
FROM ubuntu:22.04 AS cpu-test-1
2024-04-02 13:07:30 +08:00
RUN apt-get update -y \
2024-06-14 00:33:14 +08:00
&& apt-get install -y git wget vim numactl gcc-12 g++-12 python3 python3-pip libtcmalloc-minimal4 \
2024-04-02 13:07:30 +08:00
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 10 --slave /usr/bin/g++ g++ /usr/bin/g++-12
2024-06-14 00:33:14 +08:00
RUN echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4:$LD_PRELOAD' >> ~/.bashrc
RUN pip install https://intel-extension-for-pytorch.s3.amazonaws.com/ipex_dev/cpu/intel_extension_for_pytorch-2.3.100%2Bgit0eb3473-cp310-cp310-linux_x86_64.whl
2024-04-02 13:07:30 +08:00
RUN pip install --upgrade pip \
2024-06-05 00:57:51 +08:00
&& pip install wheel packaging ninja "setuptools>=49.4.0" numpy
2024-04-02 13:07:30 +08:00
2024-06-04 01:39:50 +08:00
FROM cpu-test-1 AS build
2024-04-02 13:07:30 +08:00
COPY ./ /workspace/vllm
WORKDIR /workspace/vllm
RUN pip install -v -r requirements-cpu.txt --extra-index-url https://download.pytorch.org/whl/cpu
RUN VLLM_TARGET_DEVICE = cpu python3 setup.py install
2024-05-24 00:08:58 +08:00
WORKDIR /workspace/
2024-06-14 00:33:14 +08:00
RUN ln -s /workspace/vllm/tests && ln -s /workspace/vllm/examples && ln -s /workspace/vllm/benchmarks
2024-06-04 01:39:50 +08:00
2024-04-02 13:07:30 +08:00
CMD [ "/bin/bash" ]