Optimize LoRA Docker by Shrinking Image Size (#9110)
* modify dockerfile * modify dockerfile
This commit is contained in:
parent
388f688ef3
commit
1e78b0ac40
1 changed files with 13 additions and 1 deletions
|
|
@ -1,6 +1,12 @@
|
||||||
|
FROM ubuntu:20.04 as key-getter
|
||||||
ARG http_proxy
|
ARG http_proxy
|
||||||
ARG https_proxy
|
ARG https_proxy
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y curl gpg && \
|
||||||
|
curl -fsSL https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB | gpg --dearmor | tee /root/intel-oneapi-archive-keyring.gpg
|
||||||
|
|
||||||
|
|
||||||
FROM mpioperator/intel as builder
|
FROM mpioperator/intel as builder
|
||||||
|
|
||||||
ARG http_proxy
|
ARG http_proxy
|
||||||
|
|
@ -8,12 +14,17 @@ ARG https_proxy
|
||||||
ENV PIP_NO_CACHE_DIR=false
|
ENV PIP_NO_CACHE_DIR=false
|
||||||
ADD ./requirements.txt /ppml/requirements.txt
|
ADD ./requirements.txt /ppml/requirements.txt
|
||||||
|
|
||||||
|
# add public key
|
||||||
|
COPY --from=key-getter /root/intel-oneapi-archive-keyring.gpg /usr/share/keyrings/intel-oneapi-archive-keyring.gpg
|
||||||
|
RUN echo "deb [signed-by=/usr/share/keyrings/intel-oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main " > /etc/apt/sources.list.d/oneAPI.list
|
||||||
|
|
||||||
RUN mkdir /ppml/data && mkdir /ppml/model && \
|
RUN mkdir /ppml/data && mkdir /ppml/model && \
|
||||||
# install pytorch 2.0.1
|
# install pytorch 2.0.1
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
apt-get install -y python3-pip python3.9-dev python3-wheel git software-properties-common && \
|
apt-get install -y python3-pip python3.9-dev python3-wheel git software-properties-common && \
|
||||||
pip3 install --upgrade pip && \
|
pip3 install --upgrade pip && \
|
||||||
pip install torch==2.0.1 && \
|
export PIP_DEFAULT_TIMEOUT=100 && \
|
||||||
|
pip install --upgrade torch==2.0.1 --index-url https://download.pytorch.org/whl/cpu && \
|
||||||
# install ipex and oneccl
|
# install ipex and oneccl
|
||||||
pip install intel_extension_for_pytorch==2.0.100 && \
|
pip install intel_extension_for_pytorch==2.0.100 && \
|
||||||
pip install oneccl_bind_pt -f https://developer.intel.com/ipex-whl-stable && \
|
pip install oneccl_bind_pt -f https://developer.intel.com/ipex-whl-stable && \
|
||||||
|
|
@ -50,3 +61,4 @@ ADD ./lora_finetune.py /ppml/lora_finetune.py
|
||||||
|
|
||||||
RUN chown -R mpiuser /ppml
|
RUN chown -R mpiuser /ppml
|
||||||
USER mpiuser
|
USER mpiuser
|
||||||
|
ENTRYPOINT ["/bin/bash"]
|
||||||
Loading…
Reference in a new issue