Skip to content

Commit fde1902

Browse files
authored
Merge branch 'master' into align-third-party-tests
2 parents a75b609 + 367e74e commit fde1902

23 files changed

+904
-126
lines changed
Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
name: Test oneMKL interfaces
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
permissions: read-all
10+
11+
env:
12+
CHANNELS: '-c dppy/label/dev -c https://software.repos.intel.com/python/conda/ -c conda-forge --override-channels'
13+
TEST_ENV_NAME: 'test_onemkl_interfaces'
14+
RERUN_TESTS_ON_FAILURE: 'true'
15+
RUN_TESTS_MAX_ATTEMPTS: 2
16+
BUILD_DEP_PKGS: >-
17+
mkl-devel-dpcpp
18+
tbb-devel
19+
dpctl
20+
onedpl-devel
21+
setuptools
22+
python
23+
numpy">=2.0"
24+
cython
25+
cmake
26+
ninja
27+
scikit-build
28+
29+
jobs:
30+
test_by_tag:
31+
name: Run on ['${{ matrix.os }}', python='${{ matrix.python }}'] with oneMKL tag
32+
33+
strategy:
34+
matrix:
35+
python: ['3.12']
36+
os: [ubuntu-22.04] # windows-2019 - no DFT support for Windows in oneMKL
37+
38+
permissions:
39+
# Needed to cancel any previous runs that are not completed for a given workflow
40+
actions: write
41+
42+
runs-on: ${{ matrix.os }}
43+
44+
defaults:
45+
run:
46+
shell: ${{ matrix.os == 'windows-2019' && 'cmd /C CALL {0}' || 'bash -el {0}' }}
47+
48+
continue-on-error: false
49+
50+
steps:
51+
- name: Cancel Previous Runs
52+
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
53+
with:
54+
access_token: ${{ github.token }}
55+
56+
- name: Checkout DPNP repo
57+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
58+
with:
59+
fetch-depth: 0
60+
61+
- name: Setup miniconda
62+
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
63+
with:
64+
miniforge-version: latest
65+
use-mamba: 'true'
66+
channels: conda-forge
67+
conda-remove-defaults: 'true'
68+
python-version: ${{ matrix.python }}
69+
activate-environment: ${{ env.TEST_ENV_NAME }}
70+
71+
# Sometimes `mamba install ...` fails due to slow download speed rate, so disable the check in mamba
72+
- name: Disable speed limit check in mamba
73+
run: echo "MAMBA_NO_LOW_SPEED_LIMIT=1" >> $GITHUB_ENV
74+
75+
- name: Install dpnp build dependencies
76+
run: |
77+
mamba install ${{ env.DPCPP_PKG }} ${{ env.BUILD_DEP_PKGS }} ${{ env.CHANNELS }}
78+
env:
79+
DPCPP_PKG: ${{ matrix.os == 'windows-2019' && 'dpcpp_win-64 vs_win-64=2017.9' || 'dpcpp_linux-64' }}
80+
81+
- name: Conda info
82+
run: |
83+
mamba info
84+
mamba list
85+
86+
- name: Build and install DPNP package
87+
run: |
88+
python scripts/build_locally.py --onemkl-interfaces --verbose
89+
90+
- name: Smoke test
91+
run: |
92+
python -m dpctl -f
93+
python -c "import dpnp; print(dpnp.__version__)"
94+
95+
- name: Install pytest
96+
run: |
97+
mamba install pytest ${{ env.CHANNELS }}
98+
99+
- name: Run tests
100+
if: env.RERUN_TESTS_ON_FAILURE != 'true'
101+
run: |
102+
python -m pytest -ra --pyargs dpnp.tests
103+
env:
104+
SYCL_CACHE_PERSISTENT: 1
105+
106+
- name: ReRun tests on Linux
107+
if: env.RERUN_TESTS_ON_FAILURE == 'true'
108+
id: run_tests
109+
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
110+
with:
111+
timeout_minutes: 10
112+
max_attempts: ${{ env.RUN_TESTS_MAX_ATTEMPTS }}
113+
retry_on: any
114+
command: |
115+
. $CONDA/etc/profile.d/conda.sh
116+
. $CONDA/etc/profile.d/mamba.sh
117+
mamba activate ${{ env.TEST_ENV_NAME }}
118+
119+
python -m pytest -ra --pyargs dpnp.tests
120+
env:
121+
SYCL_CACHE_PERSISTENT: 1
122+
123+
test_by_branch:
124+
name: Run on ['${{ matrix.os }}', python='${{ matrix.python }}'] with oneMKL develop branch
125+
126+
strategy:
127+
matrix:
128+
python: ['3.12']
129+
os: [ubuntu-22.04] # windows-2019 - no DFT support for Windows in oneMKL
130+
131+
permissions:
132+
# Needed to cancel any previous runs that are not completed for a given workflow
133+
actions: write
134+
135+
runs-on: ${{ matrix.os }}
136+
137+
defaults:
138+
run:
139+
shell: ${{ matrix.os == 'windows-2019' && 'cmd /C CALL {0}' || 'bash -el {0}' }}
140+
141+
continue-on-error: true
142+
143+
env:
144+
onemkl-source-dir: '${{ github.workspace }}/onemkl/'
145+
146+
steps:
147+
- name: Cancel Previous Runs
148+
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
149+
with:
150+
access_token: ${{ github.token }}
151+
152+
- name: Checkout DPNP repo
153+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
154+
with:
155+
fetch-depth: 0
156+
157+
- name: Checkout oneMKL repo
158+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
159+
with:
160+
repository: 'oneapi-src/oneMKL'
161+
ref: 'develop'
162+
path: ${{ env.onemkl-source-dir }}
163+
fetch-depth: 0
164+
165+
- name: oneMKL ls info
166+
run: |
167+
ls -la ${{ env.onemkl-source-dir }}
168+
169+
- name: Setup miniconda
170+
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
171+
with:
172+
miniforge-version: latest
173+
use-mamba: 'true'
174+
channels: conda-forge
175+
conda-remove-defaults: 'true'
176+
python-version: ${{ matrix.python }}
177+
activate-environment: ${{ env.TEST_ENV_NAME }}
178+
179+
# Sometimes `mamba install ...` fails due to slow download speed rate, so disable the check in mamba
180+
- name: Disable speed limit check in mamba
181+
run: echo "MAMBA_NO_LOW_SPEED_LIMIT=1" >> $GITHUB_ENV
182+
183+
- name: Install dpnp build dependencies
184+
run: |
185+
mamba install ${{ env.DPCPP_PKG }} ${{ env.BUILD_DEP_PKGS }} ${{ env.CHANNELS }}
186+
env:
187+
DPCPP_PKG: ${{ matrix.os == 'windows-2019' && 'dpcpp_win-64 vs_win-64=2017.9' || 'dpcpp_linux-64' }}
188+
189+
- name: Conda info
190+
run: |
191+
mamba info
192+
mamba list
193+
194+
- name: Build and install DPNP package
195+
run: |
196+
python scripts/build_locally.py --onemkl-interfaces --onemkl-interfaces-dir=${{ env.onemkl-source-dir }} --verbose
197+
198+
- name: Smoke test
199+
run: |
200+
python -m dpctl -f
201+
python -c "import dpnp; print(dpnp.__version__)"
202+
203+
- name: Install pytest
204+
run: |
205+
mamba install pytest ${{ env.CHANNELS }}
206+
207+
- name: Run tests
208+
if: env.RERUN_TESTS_ON_FAILURE != 'true'
209+
run: |
210+
python -m pytest -ra --pyargs dpnp.tests
211+
env:
212+
SYCL_CACHE_PERSISTENT: 1
213+
214+
- name: ReRun tests on Linux
215+
if: env.RERUN_TESTS_ON_FAILURE == 'true'
216+
id: run_tests
217+
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
218+
with:
219+
timeout_minutes: 10
220+
max_attempts: ${{ env.RUN_TESTS_MAX_ATTEMPTS }}
221+
retry_on: any
222+
command: |
223+
. $CONDA/etc/profile.d/conda.sh
224+
. $CONDA/etc/profile.d/mamba.sh
225+
mamba activate ${{ env.TEST_ENV_NAME }}
226+
227+
python -m pytest -ra --pyargs dpnp.tests
228+
env:
229+
SYCL_CACHE_PERSISTENT: 1

.github/workflows/conda-package.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ env:
1313
# Follow oneAPI installation instruction for conda, since intel channel is not longer available
1414
# CHANNELS: '-c dppy/label/dev -c intel -c conda-forge --override-channels'
1515
CHANNELS: '-c dppy/label/dev -c https://software.repos.intel.com/python/conda/ -c conda-forge --override-channels'
16-
CONDA_BUILD_VERSION: '24.9.0'
16+
CONDA_BUILD_VERSION: '24.11.1'
1717
CONDA_INDEX_VERSION: '0.5.0'
1818
RERUN_TESTS_ON_FAILURE: 'true'
1919
RUN_TESTS_MAX_ATTEMPTS: 2
@@ -182,14 +182,15 @@ jobs:
182182
id: run_tests_linux
183183
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
184184
with:
185-
shell: bash
186185
timeout_minutes: 10
187186
max_attempts: ${{ env.RUN_TESTS_MAX_ATTEMPTS }}
188187
retry_on: any
189188
command: |
190189
. $CONDA/etc/profile.d/conda.sh
191-
conda activate ${{ env.TEST_ENV_NAME }}
192-
pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
190+
. $CONDA/etc/profile.d/mamba.sh
191+
mamba activate ${{ env.TEST_ENV_NAME }}
192+
193+
python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
193194
194195
test_windows:
195196
name: Test ['windows-2019', python='${{ matrix.python }}']
@@ -317,13 +318,11 @@ jobs:
317318
id: run_tests_win
318319
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
319320
with:
320-
shell: cmd
321321
timeout_minutes: 15
322322
max_attempts: ${{ env.RUN_TESTS_MAX_ATTEMPTS }}
323323
retry_on: any
324-
command: >-
325-
mamba activate ${{ env.TEST_ENV_NAME }}
326-
& pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
324+
command: |
325+
python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
327326
328327
upload:
329328
name: Upload ['${{ matrix.os }}', python='${{ matrix.python }}']

.github/workflows/cron-run-tests.yaml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: Run tests suite
2+
on:
3+
# For Branch-Protection check. Only the default branch is supported. See
4+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
5+
branch_protection_rule:
6+
# To guarantee Maintained check is occasionally updated. See
7+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
8+
schedule:
9+
- cron: '28 2 * * *'
10+
workflow_dispatch:
11+
12+
permissions: read-all
13+
14+
env:
15+
PACKAGE_NAME: dpnp
16+
CHANNELS: '-c dppy/label/dev -c https://software.repos.intel.com/python/conda/ -c conda-forge --override-channels'
17+
TEST_ENV_NAME: test
18+
RERUN_TESTS_ON_FAILURE: 'true'
19+
RUN_TESTS_MAX_ATTEMPTS: 2
20+
21+
jobs:
22+
test:
23+
name: Test ['${{ matrix.runner }}', python='${{ matrix.python }}']
24+
25+
runs-on: ${{ matrix.runner }}
26+
27+
defaults:
28+
run:
29+
shell: ${{ matrix.runner == 'windows-2019' && 'cmd /C CALL {0}' || 'bash -el {0}' }}
30+
31+
permissions:
32+
# Needed to cancel any previous runs that are not completed for a given workflow
33+
actions: write
34+
35+
strategy:
36+
matrix:
37+
python: ['3.9', '3.10', '3.11', '3.12']
38+
runner: [ubuntu-22.04, ubuntu-24.04, windows-2019]
39+
40+
continue-on-error: false
41+
42+
steps:
43+
- name: Cancel Previous Runs
44+
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
45+
with:
46+
access_token: ${{ github.token }}
47+
48+
- name: Setup miniconda
49+
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3.1.0
50+
with:
51+
miniforge-version: latest
52+
use-mamba: 'true'
53+
channels: conda-forge
54+
conda-remove-defaults: 'true'
55+
python-version: ${{ matrix.python }}
56+
activate-environment: ${{ env.TEST_ENV_NAME }}
57+
58+
- name: Install dpnp
59+
run: |
60+
mamba install ${{ env.PACKAGE_NAME }} pytest ${{ env.CHANNELS }}
61+
env:
62+
MAMBA_NO_LOW_SPEED_LIMIT: 1
63+
64+
- name: List installed packages
65+
run: mamba list
66+
67+
- name: Activate OCL CPU RT
68+
if: matrix.runner == 'windows-2019'
69+
shell: pwsh
70+
run: |
71+
$script_path="$env:CONDA_PREFIX\Scripts\set-intel-ocl-icd-registry.ps1"
72+
if (Test-Path $script_path) {
73+
&$script_path
74+
} else {
75+
Write-Warning "File $script_path was NOT found!"
76+
}
77+
# Check the variable assisting OpenCL CPU driver to find TBB DLLs which are not located where it expects them by default
78+
$cl_cfg="$env:CONDA_PREFIX\Library\lib\cl.cfg"
79+
Get-Content -Tail 5 -Path $cl_cfg
80+
81+
- name: Smoke test
82+
run: |
83+
python -m dpctl -f
84+
python -c "import dpnp; print(dpnp.__version__)"
85+
86+
- name: Run tests
87+
if: env.RERUN_TESTS_ON_FAILURE != 'true'
88+
run: |
89+
python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
90+
env:
91+
SYCL_CACHE_PERSISTENT: 1
92+
93+
- name: ReRun tests on Linux
94+
if: env.RERUN_TESTS_ON_FAILURE == 'true' && matrix.runner != 'windows-2019'
95+
id: run_tests_linux
96+
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
97+
with:
98+
timeout_minutes: 10
99+
max_attempts: ${{ env.RUN_TESTS_MAX_ATTEMPTS }}
100+
retry_on: any
101+
command: |
102+
. $CONDA/etc/profile.d/conda.sh
103+
. $CONDA/etc/profile.d/mamba.sh
104+
mamba activate ${{ env.TEST_ENV_NAME }}
105+
106+
python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
107+
env:
108+
SYCL_CACHE_PERSISTENT: 1
109+
110+
- name: ReRun tests on Windows
111+
if: env.RERUN_TESTS_ON_FAILURE == 'true' && matrix.runner == 'windows-2019'
112+
id: run_tests_win
113+
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
114+
with:
115+
timeout_minutes: 15
116+
max_attempts: ${{ env.RUN_TESTS_MAX_ATTEMPTS }}
117+
retry_on: any
118+
command: |
119+
python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
120+
env:
121+
SYCL_CACHE_PERSISTENT: 1

0 commit comments

Comments
 (0)