From a851cfd01f8ec32f8ca65ec566e03867ce98ad7f Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Fri, 12 Jul 2024 07:05:16 -0500 Subject: [PATCH 1/4] Replace use of intel channel, since it no longer works See https://www.intel.com/content/www/us/en/docs/oneapi/installation-guide-linux/2024-2/conda.html#GUID-BAA00723-86B2-4E54-9343-E817171F8A39 --- .github/workflows/conda-package.yml | 39 +++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index 8d2e7ee2a4..2ed0c7324a 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -14,6 +14,7 @@ env: TEST_ENV_NAME: test_dpctl VER_SCRIPT1: "import json; f = open('ver.json', 'r'); j = json.load(f); f.close(); " VER_SCRIPT2: "d = j['dpctl'][0]; print('='.join((d[s] for s in ('version', 'build'))))" + INTEL_CHANNEL: "https://software.repos.intel.com/python/conda/" jobs: build_linux: @@ -52,7 +53,7 @@ jobs: - name: Build conda package run: | # use bootstrap channel to pull NumPy linked with OpenBLAS - CHANNELS="-c dppy/label/bootstrap -c intel -c conda-forge --override-channels" + CHANNELS="-c dppy/label/bootstrap -c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels" VERSIONS="--python ${{ matrix.python }} --numpy 1.23" TEST="--no-test" conda build \ @@ -108,7 +109,7 @@ jobs: - name: Build conda package env: OVERRIDE_INTEL_IPO: 1 # IPO requires more resources that GH actions VM provides - run: conda build --no-test --python ${{ matrix.python }} -c intel -c conda-forge --override-channels conda-recipe + run: conda build --no-test --python ${{ matrix.python }} -c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels conda-recipe - name: Upload artifact uses: actions/upload-artifact@v4.3.4 with: @@ -130,10 +131,14 @@ jobs: experimental: [false] runner: [ubuntu-20.04] continue-on-error: ${{ matrix.experimental }} - env: - CHANNELS: -c intel -c conda-forge --override-channels steps: + - name: Construct channels line + run: | + echo "CHANNELS=-c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels" >> $GITHUB_ENV + - name: Display channels line + run: | + echo ${{ env.CHANNELS }} - name: Download artifact uses: actions/download-artifact@v4 with: @@ -221,9 +226,14 @@ jobs: continue-on-error: ${{ matrix.experimental }} env: workdir: '${{ github.workspace }}' - CHANNELS: -c intel -c conda-forge --override-channels steps: + - name: Construct channels line + run: | + echo "CHANNELS=-c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels" >> $env:GITHUB_ENV + - name: Display channels line + run: | + echo ${{ env.CHANNELS }} - name: Download artifact uses: actions/download-artifact@v4 with: @@ -280,7 +290,7 @@ jobs: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}- - name: Install opencl_rt shell: cmd /C CALL {0} - run: conda install -n ${{ env.TEST_ENV_NAME }} opencl_rt -c intel --override-channels + run: conda install -n ${{ env.TEST_ENV_NAME }} opencl_rt -c ${{ env.INTEL_CHANNEL }} --override-channels - name: Install dpctl shell: cmd /C CALL {0} run: | @@ -420,11 +430,16 @@ jobs: runner: [ubuntu-20.04] continue-on-error: ${{ matrix.experimental }} env: - CHANNELS: -c intel -c conda-forge --override-channels EXAMPLES_ENV_NAME: examples BUILD_ENV_NAME: build_env steps: + - name: Construct channels line + run: | + echo "CHANNELS="-c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels" >> $GITHUB_ENV + - name: Display channels line + run: | + echo ${{ env.CHANNELS }} - name: Install conda-index # Needed to be able to run conda index run: conda install conda-index -c conda-forge --override-channels @@ -484,7 +499,7 @@ jobs: shell: bash -l {0} run: | source $CONDA/etc/profile.d/conda.sh - CHANNELS="-c $GITHUB_WORKSPACE/channel -c dppy/label/dev -c intel -c conda-forge --override-channels" + CHANNELS="-c $GITHUB_WORKSPACE/channel -c dppy/label/dev -c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels" export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}") conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y ${CHANNELS} dpctl=${PACKAGE_VERSION} dpnp || exit 1 - name: Build and run examples of pybind11 extensions @@ -570,9 +585,13 @@ jobs: experimental: [false] runner: [ubuntu-20.04] continue-on-error: ${{ matrix.experimental }} - env: - CHANNELS: -c intel -c conda-forge --override-channels steps: + - name: Construct channels line + run: | + echo "CHANNELS="-c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels" >> $GITHUB_ENV + - name: Display channels line + run: | + echo ${{ env.CHANNELS }} - name: Checkout dpctl repo uses: actions/checkout@v4.1.7 with: From 36c798bae93354c6d185a2224425ffeca51d0187 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Fri, 12 Jul 2024 23:34:55 +0000 Subject: [PATCH 2/4] Fix superfluous quotation mark in constructing channel lines --- .github/workflows/conda-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index 2ed0c7324a..876d9ea526 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -436,7 +436,7 @@ jobs: steps: - name: Construct channels line run: | - echo "CHANNELS="-c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels" >> $GITHUB_ENV + echo "CHANNELS=-c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels" >> $GITHUB_ENV - name: Display channels line run: | echo ${{ env.CHANNELS }} @@ -588,7 +588,7 @@ jobs: steps: - name: Construct channels line run: | - echo "CHANNELS="-c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels" >> $GITHUB_ENV + echo "CHANNELS=-c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels" >> $GITHUB_ENV - name: Display channels line run: | echo ${{ env.CHANNELS }} From 435a25254b53e55cb0956ddef5e58e68e7ffd6f5 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Sat, 13 Jul 2024 11:57:24 -0500 Subject: [PATCH 3/4] Run 'construct channels line' step in pwsh --- .github/workflows/conda-package.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index 876d9ea526..266aef5a8d 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -229,6 +229,7 @@ jobs: steps: - name: Construct channels line + shell: pwsh run: | echo "CHANNELS=-c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels" >> $env:GITHUB_ENV - name: Display channels line From 0ad4493856df9e13d83d2f4289f32cac4e6a710f Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Sun, 14 Jul 2024 08:28:11 -0500 Subject: [PATCH 4/4] Undo mkl_umath patching in the test --- dpctl/tests/test_sycl_kernel_submit.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dpctl/tests/test_sycl_kernel_submit.py b/dpctl/tests/test_sycl_kernel_submit.py index 04a25335ac..31ae7713ff 100644 --- a/dpctl/tests/test_sycl_kernel_submit.py +++ b/dpctl/tests/test_sycl_kernel_submit.py @@ -18,6 +18,7 @@ """ import ctypes +import sys import numpy as np import pytest @@ -77,6 +78,14 @@ def test_create_program_from_source(ctype_str, dtype, ctypes_ctor): b_np = dpt.asnumpy(b) a_np = dpt.asnumpy(a) + if "mkl_umath" in sys.modules: + mod = sys.modules["mkl_umath"] + if hasattr(mod, "restore"): + # undo numpy umath patching to work around + # incorrect reference result on + # AMD EPYC 7763 64-Core Processor as observed in GH CI + mod.restore() + for r in ( [ n_elems,