From 72e67eedbb2f5e1f940cc8239a41905f179a534f Mon Sep 17 00:00:00 2001 From: Lilac09 <74996885+Zhengjin-Wang@users.noreply.github.com> Date: Thu, 1 Feb 2024 09:53:53 +0800 Subject: [PATCH] Add speculative support in docker (#10058) * add speculative environment * add speculative environment * add speculative environment --- docker/llm/inference/cpu/docker/Dockerfile | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/docker/llm/inference/cpu/docker/Dockerfile b/docker/llm/inference/cpu/docker/Dockerfile index 154e2129..b3af6553 100644 --- a/docker/llm/inference/cpu/docker/Dockerfile +++ b/docker/llm/inference/cpu/docker/Dockerfile @@ -47,6 +47,26 @@ RUN env DEBIAN_FRONTEND=noninteractive apt-get update && \ pip install --upgrade transformers_stream_generator einops && \ # Copy vLLM-Serving cp -r ./BigDL/python/llm/example/CPU/vLLM-Serving/ ./vLLM-Serving && \ - rm -rf ./BigDL + rm -rf ./BigDL && \ +# Install miniconda + curl -LO "https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh" && \ + bash Miniconda3-latest-Linux-x86_64.sh -b && \ + rm -f Miniconda3-latest-Linux-x86_64.sh && \ +# Install environment for speculative + /root/miniconda3/condabin/conda init bash && \ + /bin/bash -c "source /root/.bashrc" && \ + /root/miniconda3/condabin/conda create -n bigdl-speculative-py39 -y python=3.9 +SHELL ["/root/miniconda3/condabin/conda", "run", "-n", "bigdl-speculative-py39", "/bin/bash", "-c"] +RUN cd /llm && \ + pip3 install --no-cache-dir --upgrade torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu && \ + pip install --pre --upgrade bigdl-llm[all] && \ + wget https://raw.githubusercontent.com/intel/intel-extension-for-pytorch/0c63936d7a6740679987920367ae2e0cdb375b2e/scripts/compile_bundle.sh && \ + sed -i 's/VER_IPEX=main/VER_IPEX=0c63936d7a6740679987920367ae2e0cdb375b2e/g' "compile_bundle.sh" && \ + bash compile_bundle.sh && \ + cd ./intel-extension-for-pytorch && \ + pip install -r requirements.txt && \ + pip install transformers==4.36.2 && \ + pip install transformers_stream_generator && \ + rm -rf llvm-project llvm-release intel-extension-for-pytorch compile_bundle.sh ENTRYPOINT ["/bin/bash"] \ No newline at end of file