diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index 8d2e7ee2a4..266aef5a8d 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,15 @@ jobs: continue-on-error: ${{ matrix.experimental }} env: workdir: '${{ github.workspace }}' - CHANNELS: -c intel -c conda-forge --override-channels 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 + run: | + echo ${{ env.CHANNELS }} - name: Download artifact uses: actions/download-artifact@v4 with: @@ -280,7 +291,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 +431,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 +500,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 +586,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: 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,