Skip to content

update ipex Dockerfile to use no-patch version #170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ RUN --mount=type=cache,id=apt-dev,target=/var/cache/apt \
vim \
build-essential \
ccache \
libjemalloc-dev \
libgoogle-perftools-dev \
numactl \
cmake \
libjpeg-dev \
pybind11-dev \
libpng-dev \
pybind11-dev \
&& rm -rf /var/lib/apt/lists/*
RUN /usr/sbin/update-ccache-symlinks
RUN mkdir /opt/ccache && ccache --set-config=cache_dir=/opt/ccache
Expand All @@ -42,22 +41,17 @@ RUN curl -fsSL -v -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Mini
/opt/conda/bin/conda clean -ya

FROM dev-base AS build
ARG IPEX_VERSION=v1.8.0
ARG PYTORCH_VERSION=v1.8.0
COPY --from=conda /opt/conda /opt/conda
ARG TORCHVISION_VERSION=0.6
RUN --mount=type=cache,target=/opt/ccache \
pip install torchvision==${TORCHVISION_VERSION}+cpu --no-deps \
pip3 install torch==${PYTORCH_VERSION}+cpu torchvision \
-f https://download.pytorch.org/whl/torch_stable.html && \
pip install lark-parser hypothesis && \
git clone https://github.com/intel/intel-extension-for-pytorch && \
git clone -b ${IPEX_VERSION} --single-branch https://github.com/intel/intel-extension-for-pytorch && \
cd intel-extension-for-pytorch && git submodule sync && \
git submodule update --init --recursive && \
git clone https://github.com/pytorch/pytorch && \
cd pytorch && git checkout v1.7.0 && git submodule sync && \
git submodule update --init --recursive && \
git apply ../torch_patches/xpu-1.7.patch && \
USE_MKLDNN=1 USE_CUDA=0 USE_NNPACK=0 USE_CUDNN=0 \
CMAKE_PREFIX_PATH="$(dirname $(which conda))/../" pip install -v . && \
cd .. && pip install -v . && rm -rf *
pip3 install -r requirements.txt && \
pip3 install -v . && rm -rf *

FROM dev-base as dev
COPY --from=build /opt/conda /opt/conda
Expand All @@ -67,6 +61,5 @@ ARG KMP_BLOCKTIME=1
ENV KMP_BLOCKTIME ${KMP_BLOCKTIME}
ARG KMP_HW_SUBSET=1T
ENV KMP_HW_SUBSET ${KMP_HW_SUBSET}
ENV MALLOC_CONF "oversize_threshold:1,background_thread:true,metadata_thp:auto,dirty_decay_ms:-1,muzzy_decay_ms:-1"
ENV LD_PRELOAD "/opt/conda/lib/libiomp5.so /usr/lib/x86_64-linux-gnu/libjemalloc.so"
ENV LD_PRELOAD "/opt/conda/lib/libiomp5.so /usr/lib/x86_64-linux-gnu/libtcmalloc.so"
ENV LD_LIBRARY_PATH "/opt/conda/lib/python3.8/site-packages/lib/"
3 changes: 2 additions & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@

```console
$ cd $DOCKERFILE_DIR
$ DOCKER_BUILDKIT=1 docker build -t intel-extension-for-pytorch:test .
$ 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 .
$ docker run intel-extension-for-pytorch:test python -c "import torch;import intel_pytorch_extension as ipex;print('torch:', torch.__version__,' ipex:',ipex.__version__)"
```