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