Skip to content

Commit 1a0e219

Browse files
Merge master into update_elementwise_docs
2 parents 72a0298 + 787e43b commit 1a0e219

File tree

6 files changed

+298
-15
lines changed

6 files changed

+298
-15
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: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ env:
1515
PACKAGE_NAME: dpnp
1616
CHANNELS: '-c dppy/label/dev -c https://software.repos.intel.com/python/conda/ -c conda-forge --override-channels'
1717
TEST_ENV_NAME: test
18+
RERUN_TESTS_ON_FAILURE: 'true'
19+
RUN_TESTS_MAX_ATTEMPTS: 2
1820

1921
jobs:
2022
test:
@@ -63,7 +65,7 @@ jobs:
6365
run: mamba list
6466

6567
- name: Activate OCL CPU RT
66-
if: ${{ matrix.runner }} == 'windows-2019'
68+
if: matrix.runner == 'windows-2019'
6769
shell: pwsh
6870
run: |
6971
$script_path="$env:CONDA_PREFIX\Scripts\set-intel-ocl-icd-registry.ps1"
@@ -82,7 +84,38 @@ jobs:
8284
python -c "import dpnp; print(dpnp.__version__)"
8385
8486
- name: Run tests
87+
if: env.RERUN_TESTS_ON_FAILURE != 'true'
8588
run: |
8689
python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
8790
env:
8891
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

.github/workflows/openssf-scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ jobs:
6868

6969
# Upload the results to GitHub's code scanning dashboard.
7070
- name: "Upload to code-scanning"
71-
uses: github/codeql-action/upload-sarif@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4
71+
uses: github/codeql-action/upload-sarif@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5
7272
with:
7373
sarif_file: results.sarif

CMakeLists.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,17 @@ if(_use_onemkl_interfaces)
114114
set(ENABLE_MKLGPU_BACKEND False)
115115
set(ENABLE_MKLCPU_BACKEND False)
116116
endif()
117-
FetchContent_Declare(
118-
onemkl_interfaces_library
119-
GIT_REPOSITORY https://github.com/oneapi-src/oneMKL.git
120-
GIT_TAG f2d2dcb4213a435bb60fbb88320c5f24892423ce
121-
)
117+
118+
if(DPNP_ONEMKL_INTERFACES_DIR)
119+
FetchContent_Declare(onemkl_interfaces_library SOURCE_DIR "${DPNP_ONEMKL_INTERFACES_DIR}")
120+
else()
121+
FetchContent_Declare(
122+
onemkl_interfaces_library
123+
GIT_REPOSITORY https://github.com/oneapi-src/oneMKL.git
124+
GIT_TAG 8f4312ef966420b9b8b4b82b9d5c22e2c91a1fe7 # v0.6
125+
)
126+
endif()
127+
122128
FetchContent_MakeAvailable(onemkl_interfaces_library)
123129
set(CMAKE_INSTALL_RPATH "${CMAKE_BINARY_DIR}/lib")
124130
endif()

0 commit comments

Comments
 (0)