diff --git a/pytorch/Dockerfile b/pytorch/Dockerfile index 0a68ac587..1a5b497d0 100644 --- a/pytorch/Dockerfile +++ b/pytorch/Dockerfile @@ -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 . @@ -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 . @@ -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 @@ -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/* diff --git a/pytorch/README.md b/pytorch/README.md index de9a45b3e..53adcb1d8 100644 --- a/pytorch/README.md +++ b/pytorch/README.md @@ -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] | @@ -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 ``` --- @@ -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 @@ -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. @@ -308,6 +310,7 @@ 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] | @@ -315,8 +318,9 @@ The images below additionally include [Jupyter Notebook](https://jupyter.org/) s | 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 @@ -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 @@ -419,6 +424,7 @@ It is the image user's responsibility to ensure that any use of The images below [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 diff --git a/pytorch/docker-compose.yaml b/pytorch/docker-compose.yaml index 75d2e8d2f..838ee5cb0 100644 --- a/pytorch/docker-compose.yaml +++ b/pytorch/docker-compose.yaml @@ -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 @@ -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: diff --git a/pytorch/tests/tests.yaml b/pytorch/tests/tests.yaml index d903cece9..21aeeadcf 100644 --- a/pytorch/tests/tests.yaml +++ b/pytorch/tests/tests.yaml @@ -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}: @@ -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 diff --git a/pytorch/xpu-requirements.txt b/pytorch/xpu-requirements.txt index 73129f9d6..5d7d2e8ac 100644 --- a/pytorch/xpu-requirements.txt +++ b/pytorch/xpu-requirements.txt @@ -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