Skip to content

Commit 571e315

Browse files
authored
update ipex Dockerfile to use no-patch version (#170)
* update ipex Dockerfile to use no-patch version * explicit pytorch version
1 parent bf1cc08 commit 571e315

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

docker/Dockerfile

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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/*
3130
RUN /usr/sbin/update-ccache-symlinks
3231
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
4241
/opt/conda/bin/conda clean -ya
4342

4443
FROM dev-base AS build
44+
ARG IPEX_VERSION=v1.8.0
45+
ARG PYTORCH_VERSION=v1.8.0
4546
COPY --from=conda /opt/conda /opt/conda
46-
ARG TORCHVISION_VERSION=0.6
4747
RUN --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

6256
FROM dev-base as dev
6357
COPY --from=build /opt/conda /opt/conda
@@ -67,6 +61,5 @@ ARG KMP_BLOCKTIME=1
6761
ENV KMP_BLOCKTIME ${KMP_BLOCKTIME}
6862
ARG KMP_HW_SUBSET=1T
6963
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"
7265
ENV LD_LIBRARY_PATH "/opt/conda/lib/python3.8/site-packages/lib/"

docker/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010

1111
```console
1212
$ cd $DOCKERFILE_DIR
13-
$ DOCKER_BUILDKIT=1 docker build -t intel-extension-for-pytorch:test .
13+
$ DOCKER_BUILDKIT=1 docker build --build-arg IPEX_VERSION=v1.8.0 --build-arg PYTORCH_VERSION=v1.8.0 -t intel-extension-for-pytorch:test .
14+
$ docker run intel-extension-for-pytorch:test python -c "import torch;import intel_pytorch_extension as ipex;print('torch:', torch.__version__,' ipex:',ipex.__version__)"
1415
```

0 commit comments

Comments
 (0)