Skip to content

Commit c8f879f

Browse files
committed
Enable Intel ARC gpu test for vllm openvino.
Signed-off-by: senhui2intel <[email protected]>
1 parent 96a1207 commit c8f879f

File tree

2 files changed

+51
-30
lines changed

2 files changed

+51
-30
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# The vLLM Dockerfile is used to construct vLLM image that can be directly used
2+
# to run the OpenAI compatible server.
3+
# Based on https://github.com/vllm-project/vllm/blob/main/Dockerfile.openvino
4+
# add Intel ARC support package
5+
6+
FROM ubuntu:22.04 AS dev
7+
8+
RUN apt-get update -y && \
9+
apt-get install -y \
10+
git python3-pip \
11+
ffmpeg libsm6 libxext6 libgl1 \
12+
gpg-agent wget
13+
14+
RUN wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | gpg --yes --dearmor --output /usr/share/keyrings/intel-graphics.gpg && \
15+
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu jammy/lts/2350 unified" | \
16+
tee /etc/apt/sources.list.d/intel-gpu-jammy.list &&\
17+
apt update -y &&\
18+
apt install -y \
19+
intel-opencl-icd intel-level-zero-gpu level-zero \
20+
intel-media-va-driver-non-free libmfx1 libmfxgen1 libvpl2 \
21+
libegl-mesa0 libegl1-mesa libegl1-mesa-dev libgbm1 libgl1-mesa-dev libgl1-mesa-dri \
22+
libglapi-mesa libgles2-mesa-dev libglx-mesa0 libigdgmm12 libxatracker2 mesa-va-drivers \
23+
mesa-vdpau-drivers mesa-vulkan-drivers va-driver-all vainfo hwinfo clinfo
24+
25+
WORKDIR /workspace
26+
27+
RUN git clone -b v0.6.3.post1 https://github.com/vllm-project/vllm.git
28+
29+
#ARG GIT_REPO_CHECK=0
30+
#RUN --mount=type=bind,source=.git,target=.git \
31+
# if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh ; fi
32+
33+
# install build requirements
34+
RUN PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu" python3 -m pip install -r /workspace/vllm/requirements-build.txt
35+
# build vLLM with OpenVINO backend
36+
RUN PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu" VLLM_TARGET_DEVICE="openvino" python3 -m pip install /workspace/vllm/
37+
38+
#COPY examples/ /workspace/vllm/examples
39+
#COPY benchmarks/ /workspace/vllm/benchmarks
40+
41+
42+
CMD ["/bin/bash"]
43+

tests/llms/test_llms_text-generation_vllm_langchain_openvino_on_intel_arc.sh

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,49 +5,28 @@
55
set -x
66

77
WORKPATH="$( cd "$( dirname "$0" )" && pwd )"
8+
DOCKER_FILE="$WORKPATH"/../../comps/llms/text-generation/vllm/langchain/dependency/Dockerfile.openvino_arc
89

910
# Define variables
1011
port=5033
1112
RENDER_GROUP_ID=110
12-
HF_MODEL_FIR=$HOME/hf_model
1313
DOCKER_IMAGE="vllm-openvino:comps"
1414
CONTAINER_NAME="test-comps-vllm-openvino-container"
15+
HF_CACHE_DIR=$HOME/.cache/huggingface
1516

1617
function build_container() {
17-
cd $WORKPATH
18-
git clone https://github.com/vllm-project/vllm.git vllm-openvino
19-
cd ./vllm-openvino
20-
21-
git reset --hard 067e77f9a87c3466fce41c8fe8710fddc69ec26c # resolve circular import issue
22-
23-
# Add ARC drive to dockerfile
24-
sed -i '9r /dev/stdin' Dockerfile.openvino << EndOfMessage
25-
RUN apt-get install -y gpg-agent wget
26-
RUN wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | gpg --yes --dearmor --output /usr/share/keyrings/intel-graphics.gpg && \\
27-
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu jammy/lts/2350 unified" | \\
28-
tee /etc/apt/sources.list.d/intel-gpu-jammy.list && \\
29-
apt-get update -y && \\
30-
apt-get install -y \\
31-
intel-opencl-icd intel-level-zero-gpu level-zero \\
32-
intel-media-va-driver-non-free libmfx1 libmfxgen1 libvpl2 \\
33-
libegl-mesa0 libegl1-mesa libegl1-mesa-dev libgbm1 libgl1-mesa-dev libgl1-mesa-dri \\
34-
libglapi-mesa libgles2-mesa-dev libglx-mesa0 libigdgmm12 libxatracker2 mesa-va-drivers \\
35-
mesa-vdpau-drivers mesa-vulkan-drivers va-driver-all vainfo hwinfo clinfo
36-
EndOfMessage
37-
3818
docker build --no-cache -t $DOCKER_IMAGE \
39-
-f Dockerfile.openvino \
19+
-f $DOCKER_FILE \
4020
. \
4121
--build-arg https_proxy=$https_proxy \
4222
--build-arg http_proxy=$http_proxy
23+
4324
if [ $? -ne 0 ]; then
4425
echo "vllm-openvino built fail"
4526
exit 1
4627
else
4728
echo "vllm-openvino built successful"
4829
fi
49-
cd $WORKPATH
50-
rm -rf vllm-openvino
5130
}
5231

5332
# Function to start Docker container
@@ -58,14 +37,14 @@ start_container() {
5837
--ipc=host \
5938
-e HTTPS_PROXY=$https_proxy \
6039
-e HTTP_PROXY=$https_proxy \
61-
-v $HF_MODEL_FIR:/hf_model \
40+
-v $HF_CACHE_DIR:/root/.cache/huggingface \
6241
--device=/dev/dri:/dev/dri \
63-
--group-add $RENDER_GROUP_ID
42+
--group-add $RENDER_GROUP_ID \
6443
vllm-openvino:comps /bin/bash -c "\
6544
export VLLM_OPENVINO_DEVICE=GPU && \
6645
export VLLM_OPENVINO_ENABLE_QUANTIZED_WEIGHTS=ON && \
6746
python3 -m vllm.entrypoints.openai.api_server \
68-
--model /hf_model/neural-chat-7b-v3-3 \
47+
--model Intel/neural-chat-7b-v3-3 \
6948
--host 0.0.0.0 \
7049
--port $port \
7150
--max_model_len 8192"
@@ -131,8 +110,7 @@ function test_api_endpoint {
131110
# Main function
132111
main() {
133112

134-
# use local image to skip slow network connection
135-
# build_container
113+
build_container
136114
start_container
137115

138116
# Sleep to allow the container to start up fully

0 commit comments

Comments
 (0)