Skip to content

Commit 8ebb04e

Browse files
committed
Merge branch 'master' into feature/enable-amd-builds
2 parents 45f3f28 + f646ac1 commit 8ebb04e

File tree

2 files changed

+39
-10
lines changed

2 files changed

+39
-10
lines changed

.github/workflows/conda-package.yml

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414
TEST_ENV_NAME: test_dpctl
1515
VER_SCRIPT1: "import json; f = open('ver.json', 'r'); j = json.load(f); f.close(); "
1616
VER_SCRIPT2: "d = j['dpctl'][0]; print('='.join((d[s] for s in ('version', 'build'))))"
17+
INTEL_CHANNEL: "https://software.repos.intel.com/python/conda/"
1718

1819
jobs:
1920
build_linux:
@@ -52,7 +53,7 @@ jobs:
5253
- name: Build conda package
5354
run: |
5455
# use bootstrap channel to pull NumPy linked with OpenBLAS
55-
CHANNELS="-c dppy/label/bootstrap -c intel -c conda-forge --override-channels"
56+
CHANNELS="-c dppy/label/bootstrap -c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels"
5657
VERSIONS="--python ${{ matrix.python }} --numpy 1.23"
5758
TEST="--no-test"
5859
conda build \
@@ -108,7 +109,7 @@ jobs:
108109
- name: Build conda package
109110
env:
110111
OVERRIDE_INTEL_IPO: 1 # IPO requires more resources that GH actions VM provides
111-
run: conda build --no-test --python ${{ matrix.python }} -c intel -c conda-forge --override-channels conda-recipe
112+
run: conda build --no-test --python ${{ matrix.python }} -c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels conda-recipe
112113
- name: Upload artifact
113114
uses: actions/upload-artifact@v4.3.4
114115
with:
@@ -130,10 +131,14 @@ jobs:
130131
experimental: [false]
131132
runner: [ubuntu-20.04]
132133
continue-on-error: ${{ matrix.experimental }}
133-
env:
134-
CHANNELS: -c intel -c conda-forge --override-channels
135134

136135
steps:
136+
- name: Construct channels line
137+
run: |
138+
echo "CHANNELS=-c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels" >> $GITHUB_ENV
139+
- name: Display channels line
140+
run: |
141+
echo ${{ env.CHANNELS }}
137142
- name: Download artifact
138143
uses: actions/download-artifact@v4
139144
with:
@@ -221,9 +226,15 @@ jobs:
221226
continue-on-error: ${{ matrix.experimental }}
222227
env:
223228
workdir: '${{ github.workspace }}'
224-
CHANNELS: -c intel -c conda-forge --override-channels
225229

226230
steps:
231+
- name: Construct channels line
232+
shell: pwsh
233+
run: |
234+
echo "CHANNELS=-c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels" >> $env:GITHUB_ENV
235+
- name: Display channels line
236+
run: |
237+
echo ${{ env.CHANNELS }}
227238
- name: Download artifact
228239
uses: actions/download-artifact@v4
229240
with:
@@ -280,7 +291,7 @@ jobs:
280291
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
281292
- name: Install opencl_rt
282293
shell: cmd /C CALL {0}
283-
run: conda install -n ${{ env.TEST_ENV_NAME }} opencl_rt -c intel --override-channels
294+
run: conda install -n ${{ env.TEST_ENV_NAME }} opencl_rt -c ${{ env.INTEL_CHANNEL }} --override-channels
284295
- name: Install dpctl
285296
shell: cmd /C CALL {0}
286297
run: |
@@ -420,11 +431,16 @@ jobs:
420431
runner: [ubuntu-20.04]
421432
continue-on-error: ${{ matrix.experimental }}
422433
env:
423-
CHANNELS: -c intel -c conda-forge --override-channels
424434
EXAMPLES_ENV_NAME: examples
425435
BUILD_ENV_NAME: build_env
426436

427437
steps:
438+
- name: Construct channels line
439+
run: |
440+
echo "CHANNELS=-c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels" >> $GITHUB_ENV
441+
- name: Display channels line
442+
run: |
443+
echo ${{ env.CHANNELS }}
428444
- name: Install conda-index
429445
# Needed to be able to run conda index
430446
run: conda install conda-index -c conda-forge --override-channels
@@ -484,7 +500,7 @@ jobs:
484500
shell: bash -l {0}
485501
run: |
486502
source $CONDA/etc/profile.d/conda.sh
487-
CHANNELS="-c $GITHUB_WORKSPACE/channel -c dppy/label/dev -c intel -c conda-forge --override-channels"
503+
CHANNELS="-c $GITHUB_WORKSPACE/channel -c dppy/label/dev -c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels"
488504
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
489505
conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y ${CHANNELS} dpctl=${PACKAGE_VERSION} dpnp || exit 1
490506
- name: Build and run examples of pybind11 extensions
@@ -570,9 +586,13 @@ jobs:
570586
experimental: [false]
571587
runner: [ubuntu-20.04]
572588
continue-on-error: ${{ matrix.experimental }}
573-
env:
574-
CHANNELS: -c intel -c conda-forge --override-channels
575589
steps:
590+
- name: Construct channels line
591+
run: |
592+
echo "CHANNELS=-c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels" >> $GITHUB_ENV
593+
- name: Display channels line
594+
run: |
595+
echo ${{ env.CHANNELS }}
576596
- name: Checkout dpctl repo
577597
uses: actions/checkout@v4.1.7
578598
with:

dpctl/tests/test_sycl_kernel_submit.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"""
1919

2020
import ctypes
21+
import sys
2122

2223
import numpy as np
2324
import pytest
@@ -77,6 +78,14 @@ def test_create_program_from_source(ctype_str, dtype, ctypes_ctor):
7778
b_np = dpt.asnumpy(b)
7879
a_np = dpt.asnumpy(a)
7980

81+
if "mkl_umath" in sys.modules:
82+
mod = sys.modules["mkl_umath"]
83+
if hasattr(mod, "restore"):
84+
# undo numpy umath patching to work around
85+
# incorrect reference result on
86+
# AMD EPYC 7763 64-Core Processor as observed in GH CI
87+
mod.restore()
88+
8089
for r in (
8190
[
8291
n_elems,

0 commit comments

Comments
 (0)