2025-03-19 01:29:25 -07:00
# oneapi 2025.0.2 docker base image use rolling 2448 package. https://dgpu-docs.intel.com/releases/packages.html?release=Rolling+2448.13&os=Ubuntu+22.04, and we don't need install driver manually.
FROM intel/deep-learning-essentials:2025.0.2-0-devel-ubuntu22.04 AS vllm-base
2024-06-18 02:01:25 +08:00
2025-03-19 01:29:25 -07:00
RUN rm /etc/apt/sources.list.d/intel-graphics.list
2024-06-18 02:01:25 +08:00
2024-09-27 23:45:50 -07:00
RUN apt-get update -y && \
apt-get install -y --no-install-recommends --fix-missing \
curl \
ffmpeg \
git \
libsndfile1 \
libsm6 \
libxext6 \
libgl1 \
lsb-release \
numactl \
python3 \
python3-dev \
python3-pip \
wget
2024-06-18 02:01:25 +08:00
WORKDIR /workspace/vllm
2025-03-08 17:44:35 +01:00
COPY requirements/xpu.txt /workspace/vllm/requirements/xpu.txt
COPY requirements/common.txt /workspace/vllm/requirements/common.txt
2024-06-18 02:01:25 +08:00
2024-09-23 18:44:26 +02:00
RUN --mount= type = cache,target= /root/.cache/pip \
2024-09-27 23:45:50 -07:00
pip install --no-cache-dir \
2025-03-08 17:44:35 +01:00
-r requirements/xpu.txt
2024-09-27 23:45:50 -07:00
2024-11-07 09:29:03 +08:00
ENV LD_LIBRARY_PATH = " $LD_LIBRARY_PATH :/usr/local/lib/ "
2024-10-17 19:25:06 +02:00
COPY . .
2025-03-11 10:11:47 -07:00
ARG GIT_REPO_CHECK = 0
2024-10-17 19:25:06 +02:00
RUN --mount= type = bind,source= .git,target= .git \
if [ " $GIT_REPO_CHECK " != 0 ] ; then bash tools/check_repo.sh; fi
2024-09-27 23:45:50 -07:00
ENV VLLM_TARGET_DEVICE = xpu
2024-06-18 02:01:25 +08:00
2024-09-23 18:44:26 +02:00
RUN --mount= type = cache,target= /root/.cache/pip \
--mount= type = bind,source= .git,target= .git \
2024-09-27 23:45:50 -07:00
python3 setup.py install
2024-06-18 02:01:25 +08:00
2025-03-11 10:11:47 -07:00
# Please refer xpu doc, we need manually install intel-extension-for-pytorch 2.6.10+xpu due to there are some conflict dependencies with torch 2.6.0+xpu
# FIXME: This will be fix in ipex 2.7. just leave this here for awareness.
RUN --mount= type = cache,target= /root/.cache/pip \
pip install intel-extension-for-pytorch= = 2.6.10+xpu \
--extra-index-url= https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
2024-06-18 02:01:25 +08:00
CMD [ "/bin/bash" ]
2024-09-27 23:45:50 -07:00
FROM vllm-base AS vllm-openai
# install additional dependencies for openai api server
RUN --mount= type = cache,target= /root/.cache/pip \
pip install accelerate hf_transfer 'modelscope!=1.15.0'
ENV VLLM_USAGE_SOURCE production-docker-image \
TRITON_XPU_PROFILE 1
2024-11-26 00:20:04 -08:00
# install development dependencies (for testing)
RUN python3 -m pip install -e tests/vllm_test_utils
2024-09-27 23:45:50 -07:00
ENTRYPOINT [ "python3" , "-m" , "vllm.entrypoints.openai.api_server" ]