@@ -20,13 +20,12 @@ RUN --mount=type=cache,id=apt-dev,target=/var/cache/apt \
20
20
vim \
21
21
build-essential \
22
22
ccache \
23
- libjemalloc -dev \
23
+ libgoogle-perftools -dev \
24
24
numactl \
25
25
cmake \
26
26
libjpeg-dev \
27
27
pybind11-dev \
28
28
libpng-dev \
29
- pybind11-dev \
30
29
&& rm -rf /var/lib/apt/lists/*
31
30
RUN /usr/sbin/update-ccache-symlinks
32
31
RUN 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
42
41
/opt/conda/bin/conda clean -ya
43
42
44
43
FROM dev-base AS build
44
+ ARG IPEX_VERSION=v1.8.0
45
+ ARG PYTORCH_VERSION=v1.8.0
45
46
COPY --from=conda /opt/conda /opt/conda
46
- ARG TORCHVISION_VERSION=0.6
47
47
RUN --mount=type=cache,target=/opt/ccache \
48
- pip install torchvision ==${TORCHVISION_VERSION }+cpu --no-deps \
48
+ pip3 install torch ==${PYTORCH_VERSION }+cpu torchvision \
49
49
-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 && \
52
51
cd intel-extension-for-pytorch && git submodule sync && \
53
52
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 *
61
55
62
56
FROM dev-base as dev
63
57
COPY --from=build /opt/conda /opt/conda
@@ -67,6 +61,5 @@ ARG KMP_BLOCKTIME=1
67
61
ENV KMP_BLOCKTIME ${KMP_BLOCKTIME}
68
62
ARG KMP_HW_SUBSET=1T
69
63
ENV 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"
72
65
ENV LD_LIBRARY_PATH "/opt/conda/lib/python3.8/site-packages/lib/"
0 commit comments