Dockerfile.xpu 1.88 KB
Newer Older
1
FROM intel/deep-learning-essentials:2025.1.3-0-devel-ubuntu24.04 AS vllm-base
2

3
RUN rm /etc/apt/sources.list.d/intel-graphics.list
4

5
6
7
8
9
RUN apt clean && apt-get update -y && \
    apt-get install -y software-properties-common && \
    add-apt-repository ppa:deadsnakes/ppa && \
    apt-get install -y python3.10 python3.10-distutils && \
    curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10 && \
10
11
12
13
14
15
16
17
18
19
    apt-get install -y --no-install-recommends --fix-missing \
    curl \
    ffmpeg \
    git \
    libsndfile1 \
    libsm6 \
    libxext6 \
    libgl1 \
    lsb-release \
    numactl \
20
    python3.10-dev \
21
    wget
22

23
24
25
26

RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1

27
WORKDIR /workspace/vllm
28
29
COPY requirements/xpu.txt /workspace/vllm/requirements/xpu.txt
COPY requirements/common.txt /workspace/vllm/requirements/common.txt
30

31
RUN --mount=type=cache,target=/root/.cache/pip \
32
    pip install --no-cache-dir \
33
    -r requirements/xpu.txt
34

35
36
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib/"

37
COPY . .
38
ARG GIT_REPO_CHECK=0
39
40
RUN --mount=type=bind,source=.git,target=.git \
    if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh; fi
41
42

ENV VLLM_TARGET_DEVICE=xpu
43
ENV VLLM_WORKER_MULTIPROC_METHOD=spawn
44

45
46
RUN --mount=type=cache,target=/root/.cache/pip \
    --mount=type=bind,source=.git,target=.git \
47
    python3 setup.py install
48
49

CMD ["/bin/bash"]
50
51
52
53
54

FROM vllm-base AS vllm-openai

# install additional dependencies for openai api server
RUN --mount=type=cache,target=/root/.cache/pip \
55
    pip install accelerate hf_transfer pytest pytest_asyncio lm_eval[api] modelscope
56
57
58

ENV VLLM_USAGE_SOURCE production-docker-image \
    TRITON_XPU_PROFILE 1
youkaichao's avatar
youkaichao committed
59
60
# install development dependencies (for testing)
RUN python3 -m pip install -e tests/vllm_test_utils
61
ENTRYPOINT ["python3", "-m", "vllm.entrypoints.openai.api_server"]