forked from huggingface/optimum-intel
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.ipex
73 lines (63 loc) · 2.55 KB
/
Dockerfile.ipex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
ARG PLATFORM=cpu
FROM ubuntu:22.04 as cpu
WORKDIR /usr/src/
RUN --mount=type=cache,id=apt-dev,target=/var/cache/apt \
sh -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
ca-certificates \
git \
curl \
vim \
build-essential \
ccache \
libgoogle-perftools-dev \
numactl \
cmake \
libjpeg-dev \
pybind11-dev \
libpng-dev \
python3 \
python3-pip \
&& rm -rf /var/lib/apt/lists/*"
RUN /usr/sbin/update-ccache-symlinks
RUN mkdir /opt/ccache && ccache --set-config=cache_dir=/opt/ccache
ARG IPEX_VERSION=2.5.0
ARG PYTORCH_VERSION=2.5.1
ARG TORCHVISION_VERSION=0.20.1+cpu
ARG TORCHAUDIO_VERSION=2.5.1+cpu
RUN python3 -m pip install --no-cache-dir \
torch==${PYTORCH_VERSION}+cpu \
torchvision==${TORCHVISION_VERSION} \
torchaudio==${TORCHAUDIO_VERSION} \
--index-url https://download.pytorch.org/whl/cpu && \
python3 -m pip install intel-openmp -f https://download.pytorch.org/whl/torch_stable.html && \
python3 -m pip install intel-extension-for-pytorch==$IPEX_VERSION && \
python3 -m pip install oneccl_bind_pt --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/cpu/cn/ && \
python3 -m pip install --no-cache-dir py-libnuma
ARG KMP_BLOCKTIME=1
ENV KMP_BLOCKTIME=${KMP_BLOCKTIME}
ARG KMP_HW_SUBSET=1T
ENV KMP_HW_SUBSET=${KMP_HW_SUBSET}
ENV LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libtcmalloc.so"
FROM intel/intel-extension-for-pytorch:2.3.110-xpu as xpu
WORKDIR /usr/src/
RUN --mount=type=cache,id=apt-dev,target=/var/cache/apt \
sh -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
ca-certificates \
git \
curl \
vim \
ccache \
libgoogle-perftools-dev \
numactl \
libjpeg-dev \
pybind11-dev \
libpng-dev \
&& rm -rf /var/lib/apt/lists/*"
RUN wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | gpg --dearmor | tee /usr/share/keyrings/intel-graphics.gpg > /dev/null
RUN wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
| gpg --dearmor | tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null && echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | tee /etc/apt/sources.list.d/oneAPI.list
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt install -y intel-basekit xpu-smi cmake ninja-build pciutils
FROM ${PLATFORM}
COPY optimum optimum
COPY Makefile setup.cfg setup.py pyproject.toml README.md ./
RUN pip install .