73 lines
3.7 KiB
Docker
73 lines
3.7 KiB
Docker
FROM intel/oneapi-basekit:2024.0.1-devel-ubuntu22.04
|
|
|
|
ARG http_proxy
|
|
ARG https_proxy
|
|
|
|
ENV TZ=Asia/Shanghai
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV USE_XETLA=OFF
|
|
ENV SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1
|
|
|
|
COPY chat.py /llm/chat.py
|
|
COPY benchmark.sh /llm/benchmark.sh
|
|
|
|
# Disable pip's cache behavior
|
|
ARG PIP_NO_CACHE_DIR=false
|
|
|
|
RUN wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | tee /usr/share/keyrings/intel-oneapi-archive-keyring.gpg > /dev/null && \
|
|
echo "deb [signed-by=/usr/share/keyrings/intel-oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main " | tee /etc/apt/sources.list.d/oneAPI.list && \
|
|
chmod 644 /usr/share/keyrings/intel-oneapi-archive-keyring.gpg && \
|
|
rm /etc/apt/sources.list.d/intel-graphics.list && \
|
|
wget -O- https://repositories.intel.com/graphics/intel-graphics.key | gpg --dearmor | tee /usr/share/keyrings/intel-graphics.gpg > /dev/null && \
|
|
echo "deb [arch=amd64,i386 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/graphics/ubuntu jammy arc" | tee /etc/apt/sources.list.d/intel.gpu.jammy.list && \
|
|
chmod 644 /usr/share/keyrings/intel-graphics.gpg && \
|
|
apt-get update && \
|
|
apt-get install -y curl wget git gnupg gpg-agent && \
|
|
# Install PYTHON 3.11 and IPEX-LLM[xpu]
|
|
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \
|
|
env DEBIAN_FRONTEND=noninteractive apt-get update && \
|
|
apt install libunwind8-dev vim less -y && \
|
|
apt-get install -y python3.11 git curl wget && \
|
|
rm /usr/bin/python3 && \
|
|
ln -s /usr/bin/python3.11 /usr/bin/python3 && \
|
|
ln -s /usr/bin/python3 /usr/bin/python && \
|
|
apt-get install -y python3-pip python3.11-dev python3-wheel python3.11-distutils && \
|
|
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
|
|
# Install FastChat from source requires PEP 660 support
|
|
python3 get-pip.py && \
|
|
rm get-pip.py && \
|
|
pip install --upgrade requests argparse urllib3 && \
|
|
pip install --pre --upgrade ipex-llm[xpu] --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/ && \
|
|
# Fix Trivy CVE Issues
|
|
pip install transformers==4.36.2 && \
|
|
pip install transformers_stream_generator einops tiktoken && \
|
|
# Install opencl-related repos
|
|
apt-get update && \
|
|
apt-get install -y intel-opencl-icd intel-level-zero-gpu level-zero && \
|
|
# Install related libary of chat.py
|
|
pip install --upgrade colorama && \
|
|
# Download all-in-one benchmark and examples
|
|
git clone https://github.com/intel-analytics/ipex-llm && \
|
|
cp -r ./ipex-llm/python/llm/dev/benchmark/ ./benchmark && \
|
|
cp -r ./ipex-llm/python/llm/example/GPU/HF-Transformers-AutoModels/Model ./examples && \
|
|
# Install vllm dependencies
|
|
pip install --upgrade fastapi && \
|
|
pip install --upgrade "uvicorn[standard]" && \
|
|
# Download vLLM-Serving
|
|
cp -r ./ipex-llm/python/llm/example/GPU/vLLM-Serving/ ./vLLM-Serving && \
|
|
# Install related library of benchmarking
|
|
pip install pandas omegaconf && \
|
|
chmod +x /llm/benchmark.sh && \
|
|
# Download Deepspeed-AutoTP
|
|
cp -r ./ipex-llm/python/llm/example/GPU/Deepspeed-AutoTP/ ./Deepspeed-AutoTP && \
|
|
# Install related library of Deepspeed-AutoTP
|
|
pip install oneccl_bind_pt==2.1.100 --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/ && \
|
|
pip install git+https://github.com/microsoft/DeepSpeed.git@ed8aed5 && \
|
|
pip install git+https://github.com/intel/intel-extension-for-deepspeed.git@0eb734b && \
|
|
pip install mpi4py && \
|
|
apt-get update && \
|
|
apt-get install -y google-perftools && \
|
|
ln -s /usr/local/lib/python3.11/dist-packages/ipex_llm/libs/libtcmalloc.so /lib/libtcmalloc.so && \
|
|
rm -rf ./ipex-llm
|
|
|
|
WORKDIR /llm/
|