@@ -20,13 +20,12 @@ RUN --mount=type=cache,id=apt-dev,target=/var/cache/apt \
2020 vim \
2121 build-essential \
2222 ccache \
23- libjemalloc -dev \
23+ libgoogle-perftools -dev \
2424 numactl \
2525 cmake \
2626 libjpeg-dev \
2727 pybind11-dev \
2828 libpng-dev \
29- pybind11-dev \
3029 && rm -rf /var/lib/apt/lists/*
3130RUN /usr/sbin/update-ccache-symlinks
3231RUN mkdir /opt/ccache && ccache --set-config=cache_dir=/opt/ccache
@@ -42,22 +41,17 @@ RUN curl -fsSL -v -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Mini
4241 /opt/conda/bin/conda clean -ya
4342
4443FROM dev-base AS build
44+ ARG IPEX_VERSION=v1.8.0
45+ ARG PYTORCH_VERSION=v1.8.0
4546COPY --from=conda /opt/conda /opt/conda
46- ARG TORCHVISION_VERSION=0.6
4747RUN --mount=type=cache,target=/opt/ccache \
48- pip install torchvision ==${TORCHVISION_VERSION }+cpu --no-deps \
48+ pip3 install torch ==${PYTORCH_VERSION }+cpu torchvision \
4949 -f https://download.pytorch.org/whl/torch_stable.html && \
50- pip install lark-parser hypothesis && \
51- git clone https://github.com/intel/intel-extension-for-pytorch && \
50+ git clone -b ${IPEX_VERSION} --single-branch https://github.com/intel/intel-extension-for-pytorch && \
5251 cd intel-extension-for-pytorch && git submodule sync && \
5352 git submodule update --init --recursive && \
54- git clone https://github.com/pytorch/pytorch && \
55- cd pytorch && git checkout v1.7.0 && git submodule sync && \
56- git submodule update --init --recursive && \
57- git apply ../torch_patches/xpu-1.7.patch && \
58- USE_MKLDNN=1 USE_CUDA=0 USE_NNPACK=0 USE_CUDNN=0 \
59- CMAKE_PREFIX_PATH="$(dirname $(which conda))/../" pip install -v . && \
60- cd .. && pip install -v . && rm -rf *
53+ pip3 install -r requirements.txt && \
54+ pip3 install -v . && rm -rf *
6155
6256FROM dev-base as dev
6357COPY --from=build /opt/conda /opt/conda
@@ -67,6 +61,5 @@ ARG KMP_BLOCKTIME=1
6761ENV KMP_BLOCKTIME ${KMP_BLOCKTIME}
6862ARG KMP_HW_SUBSET=1T
6963ENV KMP_HW_SUBSET ${KMP_HW_SUBSET}
70- ENV MALLOC_CONF "oversize_threshold:1,background_thread:true,metadata_thp:auto,dirty_decay_ms:-1,muzzy_decay_ms:-1"
71- ENV LD_PRELOAD "/opt/conda/lib/libiomp5.so /usr/lib/x86_64-linux-gnu/libjemalloc.so"
64+ ENV LD_PRELOAD "/opt/conda/lib/libiomp5.so /usr/lib/x86_64-linux-gnu/libtcmalloc.so"
7265ENV LD_LIBRARY_PATH "/opt/conda/lib/python3.8/site-packages/lib/"
0 commit comments