Skip to content
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

update ipex layers to 2.1.40-xpu #305

Merged
merged 11 commits into from
Aug 14, 2024
18 changes: 4 additions & 14 deletions pytorch/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ ARG PYTHON_VERSION
ARG PYTHON_BASE=${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER}-${BASE_IMAGE_NAME}-${BASE_IMAGE_TAG}-${PACKAGE_OPTION}-py${PYTHON_VERSION}-base
FROM ${PYTHON_BASE} AS ipex-base-pip

ARG IPEX_VERSION
ARG PYTORCH_VERSION
ARG TORCHAUDIO_VERSION
ARG TORCHVISION_VERSION

WORKDIR /
COPY requirements.txt .

Expand All @@ -49,11 +44,6 @@ RUN python -m pip install --no-cache-dir -r requirements.txt && \

FROM ${PYTHON_BASE} AS ipex-base-idp

ARG IPEX_VERSION
ARG PYTORCH_VERSION
ARG TORCHAUDIO_VERSION
ARG TORCHVISION_VERSION

WORKDIR /
COPY requirements.txt .

Expand Down Expand Up @@ -158,8 +148,8 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/*

RUN wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | \
gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg
RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu jammy/lts/2350 unified" | \
gpg --dearmor --yes --output /usr/share/keyrings/intel-graphics.gpg
RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu jammy unified" | \
tee /etc/apt/sources.list.d/intel-gpu-jammy.list

ARG ICD_VER
Expand All @@ -171,8 +161,8 @@ RUN apt-get update && \
apt-get install -y --no-install-recommends --fix-missing \
intel-opencl-icd=${ICD_VER} \
intel-level-zero-gpu=${LEVEL_ZERO_GPU_VER} \
level-zero=${LEVEL_ZERO_VER} \
level-zero-dev=${LEVEL_ZERO_DEV_VER} && \
libze1=${LEVEL_ZERO_VER} \
libze-dev=${LEVEL_ZERO_DEV_VER} && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

Expand Down
18 changes: 12 additions & 6 deletions pytorch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ The images below include support for both CPU and GPU optimizations:

| Tag(s) | Pytorch | IPEX | Driver | Dockerfile |
| ---------------------- | -------- | -------------- | ------ | --------------- |
| `2.1.40-xpu` | [v2.1.0] | [v2.1.40+xpu] | [914] | [v0.4.0-Beta] |
| `2.1.30-xpu` | [v2.1.0] | [v2.1.30+xpu] | [803] | [v0.4.0-Beta] |
| `2.1.20-xpu` | [v2.1.0] | [v2.1.20+xpu] | [803] | [v0.3.4] |
| `2.1.10-xpu` | [v2.1.0] | [v2.1.10+xpu] | [736] | [v0.2.3] |
Expand All @@ -36,7 +37,7 @@ docker run -it --rm \
--device /dev/dri \
-v /dev/dri/by-path:/dev/dri/by-path \
--ipc=host \
intel/intel-extension-for-pytorch:2.1.30-xpu
intel/intel-extension-for-pytorch:2.1.40-xpu
```

---
Expand All @@ -45,8 +46,9 @@ The images below additionally include [Jupyter Notebook](https://jupyter.org/) s

| Tag(s) | Pytorch | IPEX | Driver | Jupyter Port | Dockerfile |
| --------------------- | -------- | ------------- | ------ | ------------ | --------------- |
| `2.1.20-xpu-pip-jupyter` | [v2.1.0] | [v2.1.20+xpu] | [803] | `8888` | [v0.3.4] |
| `2.1.10-xpu-pip-jupyter` | [v2.1.0] | [v2.1.10+xpu] | [736] | `8888` | [v0.2.3] |
| `2.1.40-xpu-pip-jupyter` | [v2.1.0] | [v2.1.40+xpu] | [914] | `8888` | [v0.4.0-Beta] |
| `2.1.20-xpu-pip-jupyter` | [v2.1.0] | [v2.1.20+xpu] | [803] | `8888` | [v0.3.4] |
| `2.1.10-xpu-pip-jupyter` | [v2.1.0] | [v2.1.10+xpu] | [736] | `8888` | [v0.2.3] |

### Run the XPU Jupyter Container

Expand All @@ -55,7 +57,7 @@ docker run -it --rm \
-p 8888:8888 \
--device /dev/dri \
-v /dev/dri/by-path:/dev/dri/by-path \
intel/intel-extension-for-pytorch:2.1.20-xpu-pip-jupyter
intel/intel-extension-for-pytorch:2.1.40-xpu-pip-jupyter
```

After running the command above, copy the URL (something like `http://127.0.0.1:$PORT/?token=***`) into your browser to access the notebook server.
Expand Down Expand Up @@ -308,15 +310,17 @@ The images below are built only with CPU and GPU optimizations and include [Inte

| Tag(s) | Pytorch | IPEX | Driver | Dockerfile |
| ---------------- | -------- | ------------ | -------- | ------ |
| `2.1.40-xpu-idp-base` | [v2.1.0] | [v2.1.40+xpu] | [914] | [v0.4.0-Beta] |
| `2.1.30-xpu-idp-base` | [v2.1.0] | [v2.1.30+xpu] | [803] | [v0.4.0-Beta] |
| `2.1.10-xpu-idp-base` | [v2.1.0] | [v2.1.10+xpu] | [736] | [v0.2.3] |

The images below additionally include [Jupyter Notebook](https://jupyter.org/) server:

| Tag(s) | Pytorch | IPEX | Driver | Jupyter Port | Dockerfile |
| --------------------- | -------- | ------------- | ------ | ------------ | --------------- |
| `2.1.20-xpu-idp-jupyter` | [v2.1.0] | [v2.1.20+xpu] | [803] | `8888` | [v0.3.4] |
| `2.1.10-xpu-idp-jupyter` | [v2.1.0] | [v2.1.10+xpu] | [736] | `8888` | [v0.2.3] |
| `2.1.40-xpu-idp-jupyter` | [v2.1.0] | [v2.1.40+xpu] | [914] | `8888` | [v0.4.0-Beta] |
| `2.1.20-xpu-idp-jupyter` | [v2.1.0] | [v2.1.20+xpu] | [803] | `8888` | [v0.3.4] |
| `2.1.10-xpu-idp-jupyter` | [v2.1.0] | [v2.1.10+xpu] | [736] | `8888` | [v0.2.3] |

## Build from Source

Expand Down Expand Up @@ -382,6 +386,7 @@ It is the image user's responsibility to ensure that any use of The images below
[v0.2.3]: https://github.com/intel/ai-containers/blob/v0.2.3/pytorch/Dockerfile
[v0.1.0]: https://github.com/intel/ai-containers/blob/v0.1.0/pytorch/Dockerfile

[v2.1.40+xpu]: https://github.com/intel/intel-extension-for-pytorch/releases/tag/v2.1.40%2Bxpu
[v2.1.30+xpu]: https://github.com/intel/intel-extension-for-pytorch/releases/tag/v2.1.30%2Bxpu
[v2.1.20+xpu]: https://github.com/intel/intel-extension-for-pytorch/releases/tag/v2.1.20%2Bxpu
[v2.1.10+xpu]: https://github.com/intel/intel-extension-for-pytorch/releases/tag/v2.1.10%2Bxpu
Expand Down Expand Up @@ -419,6 +424,7 @@ It is the image user's responsibility to ensure that any use of The images below
<!-- HuggingFace transformers releases -->
[v4.44.0]: https://github.com/huggingface/transformers/releases/tag/v4.44.0

[914]: https://dgpu-docs.intel.com/releases/stable_914_33_20240730.html
[803]: https://dgpu-docs.intel.com/releases/LTS_803.29_20240131.html
[736]: https://dgpu-docs.intel.com/releases/stable_736_25_20231031.html
[647]: https://dgpu-docs.intel.com/releases/stable_647_21_20230714.html
Expand Down
58 changes: 25 additions & 33 deletions pytorch/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,38 +94,34 @@ services:
xpu:
build:
args:
CCL_VER: ${CCL_VER:-2021.12.0-309}
DPCPP_VER: ${DPCPP_VER:-2024.1.0-963}
ICD_VER: ${ICD_VER:-23.43.27642.40-803~22.04}
IPEX_XPU_VERSION: ${IPEX_VERSION:-2.1.20}
LEVEL_ZERO_DEV_VER: ${LEVEL_ZERO_DEV_VER:-1.14.0-744~22.04}
LEVEL_ZERO_GPU_VER: ${LEVEL_ZERO_GPU_VER:-1.3.27642.40-803~22.04}
LEVEL_ZERO_VER: ${LEVEL_ZERO_VER:-1.14.0-744~22.04}
MKL_VER: ${MKL_VER:-2024.1.0-691}
CCL_VER: ${CCL_VER:-2021.13.1-31}
DPCPP_VER: ${DPCPP_VER:-2024.2.1-1079}
ICD_VER: ${ICD_VER:-24.22.29735.27-914~22.04}
LEVEL_ZERO_DEV_VER: ${LEVEL_ZERO_DEV_VER:-1.17.6-914~22.04}
LEVEL_ZERO_GPU_VER: ${LEVEL_ZERO_GPU_VER:-1.3.29735.27-914~22.04}
LEVEL_ZERO_VER: ${LEVEL_ZERO_VER:-1.17.6-914~22.04}
MKL_VER: ${MKL_VER:-2024.2.1-103}
NO_PROXY: ''
ONECCL_VERSION: ${ONECCL_VERSION:-2.1.300}
PACKAGE_OPTION: ${PACKAGE_OPTION:-pip}
PYTORCH_XPU_VERSION: ${PYTORCH_VERSION:-2.1.0}
TORCHVISION_XPU_VERSION: ${TORCHVISION_VERSION:-0.16.0}
labels:
dependency.apt.build-essential: true
dependency.apt.clinfo: true
dependency.apt.git: true
dependency.apt.gnupg2: true
dependency.apt.gpg-agent: true
dependency.apt.intel-level-zero-gpu: ${LEVEL_ZERO_GPU_VER:-1.3.27642.40-803~22.04}
dependency.apt.intel-oneapi-runtime-ccl: ${CCL_VER:-2021.12.0-309}
dependency.apt.intel-oneapi-runtime-dpcpp-cpp: ${DPCPP_VER:-2024.1.0-963}
dependency.apt.intel-oneapi-runtime-mkl: ${MKL_VER:-2024.1.0-691}
dependency.apt.intel-level-zero-gpu: ${LEVEL_ZERO_GPU_VER:-1.3.29735.27-914~22.04}
dependency.apt.intel-oneapi-runtime-ccl: ${CCL_VER:-2021.13.1-31}
dependency.apt.intel-oneapi-runtime-dpcpp-cpp: ${DPCPP_VER:-2024.2.1-1079}
dependency.apt.intel-oneapi-runtime-mkl: ${MKL_VER:-2024.2.1-103}
dependency.apt.intel-opencl-icd: ${ICD_VER:-23.43.27642.40-803~22.04}
dependency.apt.level-zero: ${LEVEL_ZERO_VER:-1.14.0-744~22.04}
dependency.apt.level-zero-dev: ${LEVEL_ZERO_DEV_VER:-1.14.0-744~22.04}
dependency.apt.level-zero: ${LEVEL_ZERO_VER:-1.17.6-914~22.04}
dependency.apt.level-zero-dev: ${LEVEL_ZERO_DEV_VER:-1.17.6-914~22.04}
dependency.apt.rsync: true
dependency.apt.unzip: true
dependency.idp.pip: false
org.opencontainers.base.name: "intel/python:3.10-core"
org.opencontainers.image.title: "Intel® Extension for PyTorch XPU Base Image"
org.opencontainers.image.version: ${IPEX_VERSION:-2.1.20}-xpu-${PACKAGE_OPTION:-pip}-base
org.opencontainers.image.version: ${IPEX_VERSION:-2.1.40}-xpu-${PACKAGE_OPTION:-pip}-base
target: ipex-xpu-base
command: >
python -c "import torch;print(torch.device('xpu'));import
Expand All @@ -135,33 +131,29 @@ services:
{ipex.xpu.get_device_properties(i)}') for i in
range(ipex.xpu.device_count())];"
extends: ipex-base
image: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.1.30xpu}-xpu-base
image: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.1.40xpu}-xpu-base
xpu-jupyter:
build:
args:
CCL_VER: ${CCL_VER:-2021.12.0-309}
DPCPP_VER: ${DPCPP_VER:-2024.1.0-963}
ICD_VER: ${ICD_VER:-23.43.27642.40-803~22.04}
IPEX_XPU_VERSION: ${IPEX_VERSION:-2.1.20}
LEVEL_ZERO_DEV_VER: ${LEVEL_ZERO_DEV_VER:-1.14.0-744~22.04}
LEVEL_ZERO_GPU_VER: ${LEVEL_ZERO_GPU_VER:-1.3.27642.40-803~22.04}
LEVEL_ZERO_VER: ${LEVEL_ZERO_VER:-1.14.0-744~22.04}
MKL_VER: ${MKL_VER:-2024.1.0-691}
CCL_VER: ${CCL_VER:-2021.13.1-31}
DPCPP_VER: ${DPCPP_VER:-2024.2.1-1079}
ICD_VER: ${ICD_VER:-24.22.29735.27-914~22.04}
LEVEL_ZERO_DEV_VER: ${LEVEL_ZERO_DEV_VER:-1.17.6-914~22.04}
LEVEL_ZERO_GPU_VER: ${LEVEL_ZERO_GPU_VER:-1.3.29735.27-914~22.04}
LEVEL_ZERO_VER: ${LEVEL_ZERO_VER:-1.17.6-914~22.04}
MKL_VER: ${MKL_VER:-2024.2.1-103}
NO_PROXY: ''
ONECCL_VERSION: ${ONECCL_VERSION:-2.1.200}
PACKAGE_OPTION: ${PACKAGE_OPTION:-pip}
PYTORCH_XPU_VERSION: ${PYTORCH_VERSION:-2.1.0}
TORCHVISION_XPU_VERSION: ${TORCHVISION_VERSION:-0.16.0}
labels:
dependency.python.pip: jupyter-requirements.txt
org.opencontainers.base.name: "intel/intel-optimized-pytorch:${IPEX_VERSION:-2.1.20}-xpu-${PACKAGE_OPTION:-pip}-base"
org.opencontainers.base.name: "intel/intel-optimized-pytorch:${IPEX_VERSION:-2.1.40}-xpu-${PACKAGE_OPTION:-pip}-base"
org.opencontainers.image.title: "Intel® Extension for PyTorch XPU Jupyter Image"
org.opencontainers.image.version: ${IPEX_VERSION:-2.1.20}-xpu-${PACKAGE_OPTION:-pip}-jupyter
org.opencontainers.image.version: ${IPEX_VERSION:-2.1.40}-xpu-${PACKAGE_OPTION:-pip}-jupyter
target: ipex-xpu-jupyter
command: >
bash -c "python -m jupyter --version"
extends: ipex-base
image: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.1.30xpu}-xpu-jupyter
image: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.1.40xpu}-xpu-jupyter
ports:
- 8888:8888
torchserve:
Expand Down
8 changes: 4 additions & 4 deletions pytorch/tests/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import-ipex-cpu-${PACKAGE_OPTION:-pip}:
img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.4.0}-base
cmd: python -c "import torch;import intel_extension_for_pytorch as ipex;print(f'torch {torch.__version__} ipex {ipex.__version__}')"
import-ipex-xpu-${PACKAGE_OPTION:-pip}:
img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.1.30xpu}-xpu-base
img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.1.40xpu}-xpu-base
cmd: python -c "import torch; import intel_extension_for_pytorch as ipex;[print(f'[{i}] {torch.xpu.get_device_properties(i)}') for i in range(torch.xpu.device_count())];"
device: ["/dev/dri"]
import-cpu-jupyter-${PACKAGE_OPTION:-pip}:
img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.4.0}-jupyter
cmd: python -m jupyter --version
import-xpu-jupyter-${PACKAGE_OPTION:-pip}:
img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.1.30xpu}-xpu-jupyter
img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.1.40xpu}-xpu-jupyter
cmd: python -m jupyter --version
device: ["/dev/dri"]
import-cpu-oneccl-${PACKAGE_OPTION:-pip}:
Expand All @@ -46,14 +46,14 @@ ipex-cpu-${PACKAGE_OPTION:-pip}:
- dst: /tests
src: $PWD/pytorch/tests
ipex-xpu-${PACKAGE_OPTION:-pip}:
img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.1.30xpu}-xpu-base
img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.1.40xpu}-xpu-base
cmd: python /tests/ipex-resnet50.py --ipex --device xpu
device: ["/dev/dri"]
volumes:
- dst: /tests
src: $PWD/pytorch/tests
ipex-xpu-jupyter-${PACKAGE_OPTION:-pip}:
img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.1.30xpu}-xpu-jupyter
img: ${REGISTRY}/${REPO}:b-${GITHUB_RUN_NUMBER:-0}-${BASE_IMAGE_NAME:-ubuntu}-${BASE_IMAGE_TAG:-22.04}-${PACKAGE_OPTION:-pip}-py${PYTHON_VERSION:-3.10}-ipex-${IPEX_VERSION:-2.1.40xpu}-xpu-jupyter
cmd: papermill --log-output /jupyter/xpu.ipynb -k python3
device: ["/dev/dri"]
notebook: True
Expand Down
15 changes: 8 additions & 7 deletions pytorch/xpu-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
torch==2.1.0.post2+cxx11.abi
torchvision==0.16.0.post2+cxx11.abi
torchaudio==2.1.0.post2+cxx11.abi
intel_extension_for_pytorch==2.1.30+xpu
oneccl_bind_pt==2.1.300+xpu
--extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
setuptools==71.1.0
torch==2.1.0.post3+cxx11.abi
torchvision==0.16.0.post3+cxx11.abi
torchaudio==2.1.0.post3+cxx11.abi
intel_extension_for_pytorch==2.1.40+xpu
oneccl_bind_pt==2.1.400+xpu
--extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us
setuptools==69.5.1
numpy==1.26.4
tylertitsworth marked this conversation as resolved.
Show resolved Hide resolved
Loading