-
Notifications
You must be signed in to change notification settings - Fork 26
312 lines (262 loc) · 9.82 KB
/
check-onemath.yaml
File metadata and controls
312 lines (262 loc) · 9.82 KB
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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
name: Test oneAPI Math Library (oneMath)
on:
push:
branches:
- master
pull_request:
permissions: read-all
env:
environment-file: 'environments/environment.yml'
environment-file-name: 'environment.yml'
environment-file-loc: '${{ github.workspace }}/environments'
build-with-oneapi-env: 'environments/build_with_oneapi.yml'
dpctl-pkg-env: 'environments/dpctl_pkg.yml'
oneapi-pkgs-env: 'environments/oneapi_pkgs.yml'
test-pkg-env: 'environments/test.yml'
test-env-name: 'test_onemath'
rerun-tests-on-failure: 'true'
rerun-tests-max-attempts: 2
rerun-tests-timeout: 20
jobs:
build_env_file:
name: Build conda env file
permissions:
# Needed to cancel any previous runs that are not completed for a given workflow
actions: write
runs-on: 'ubuntu-latest'
timeout-minutes: 5
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@d07a454dad7609a92316b57b23c9ccfd4f59af66 # 0.13.1
with:
access_token: ${{ github.token }}
- name: Checkout DPNP repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Install conda-merge tool
uses: BSFishy/pip-action@8f2d471d809dc20b6ada98c91910b6ae6243f318 # v1
with:
packages: conda-merge
- name: Merge conda env files
run: |
conda-merge ${{ env.dpctl-pkg-env }} \
${{ env.oneapi-pkgs-env }} \
${{ env.build-with-oneapi-env }} \
${{ env.test-pkg-env }} > ${{ env.environment-file }}
cat ${{ env.environment-file }}
- name: Upload artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ env.environment-file-name }}
path: ${{ env.environment-file }}
test_by_tag:
name: Run tests with OneMath tag
needs: build_env_file
strategy:
fail-fast: false
matrix:
python: ['3.13'] # no dpctl package on PyPI with enabled python 3.14 support
os: [ubuntu-22.04] # windows-2022 - no DFT support for Windows in oneMKL
runs-on: ${{ matrix.os }}
timeout-minutes: 120
defaults:
run:
shell: ${{ matrix.os == 'windows-2022' && 'cmd /C CALL {0}' || 'bash -el {0}' }}
steps:
- name: Checkout DPNP repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Download artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ env.environment-file-name }}
path: ${{ env.environment-file-loc }}
- name: Setup miniconda
id: setup_miniconda
continue-on-error: true
uses: conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0
with:
miniforge-version: latest
use-mamba: 'true'
conda-remove-defaults: 'true'
python-version: ${{ matrix.python }}
environment-file: ${{ env.environment-file }}
activate-environment: ${{ env.test-env-name }}
- name: ReSetup miniconda
if: steps.setup_miniconda.outcome == 'failure'
uses: conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0
with:
miniforge-version: latest
use-mamba: 'true'
conda-remove-defaults: 'true'
python-version: ${{ matrix.python }}
environment-file: ${{ env.environment-file }}
activate-environment: ${{ env.test-env-name }}
- name: Conda info
run: |
mamba info
mamba list
- name: Build and install DPNP package
run: |
python scripts/build_locally.py --onemath --verbose
- name: Smoke test
run: |
python -m dpctl -f
python -c "import dpnp; print(dpnp.__version__)"
- name: Run tests
if: env.rerun-tests-on-failure != 'true'
run: |
python -m pytest -ra --pyargs dpnp.tests
env:
SKIP_TENSOR_TESTS: 1
SYCL_CACHE_PERSISTENT: 1
- name: Run tensor tests
if: env.rerun-tests-on-failure != 'true'
run: |
python -m pytest -ra --pyargs dpnp.tests.tensor
env:
SYCL_CACHE_PERSISTENT: 1
- name: ReRun tests on Linux
if: env.rerun-tests-on-failure == 'true'
id: run_tests
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
with:
timeout_minutes: ${{ env.rerun-tests-timeout }}
max_attempts: ${{ env.rerun-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:
SKIP_TENSOR_TESTS: 1
SYCL_CACHE_PERSISTENT: 1
- name: ReRun tensor tests on Linux
if: env.rerun-tests-on-failure == 'true'
id: run_tensor_tests
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: ${{ env.rerun-tests-timeout }}
max_attempts: ${{ env.rerun-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.tensor
env:
SYCL_CACHE_PERSISTENT: 1
test_by_branch:
name: Run tests with oneMath develop branch
needs: build_env_file
strategy:
fail-fast: false
matrix:
python: ['3.13'] # no dpctl package on PyPI with enabled python 3.14 support
os: [ubuntu-22.04] # windows-2022 - no DFT support for Windows in oneMKL
runs-on: ${{ matrix.os }}
timeout-minutes: 60
defaults:
run:
shell: ${{ matrix.os == 'windows-2022' && 'cmd /C CALL {0}' || 'bash -el {0}' }}
env:
onemkl-source-dir: '${{ github.workspace }}/onemkl/'
steps:
- name: Checkout DPNP repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Download artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ env.environment-file-name }}
path: ${{ env.environment-file-loc }}
- name: Checkout oneMKL repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.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
id: setup_miniconda
continue-on-error: true
uses: conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0
with:
miniforge-version: latest
use-mamba: 'true'
conda-remove-defaults: 'true'
python-version: ${{ matrix.python }}
environment-file: ${{ env.environment-file }}
activate-environment: ${{ env.test-env-name }}
- name: ReSetup miniconda
if: steps.setup_miniconda.outcome == 'failure'
uses: conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0
with:
miniforge-version: latest
use-mamba: 'true'
conda-remove-defaults: 'true'
python-version: ${{ matrix.python }}
environment-file: ${{ env.environment-file }}
activate-environment: ${{ env.test-env-name }}
- name: Conda info
run: |
mamba info
mamba list
- name: Build and install DPNP package
run: |
python scripts/build_locally.py --onemath --onemath-dir=${{ env.onemkl-source-dir }} --verbose
- name: Smoke test
run: |
python -m dpctl -f
python -c "import dpnp; print(dpnp.__version__)"
- name: Run tests
if: env.rerun-tests-on-failure != 'true'
run: |
python -m pytest -ra --pyargs dpnp.tests
env:
SKIP_TENSOR_TESTS: 1
SYCL_CACHE_PERSISTENT: 1
- name: Run tensor tests
if: env.rerun-tests-on-failure != 'true'
run: |
python -m pytest -ra --pyargs dpnp.tests.tensor
env:
SYCL_CACHE_PERSISTENT: 1
- name: ReRun tests on Linux
if: env.rerun-tests-on-failure == 'true'
id: run_tests
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
with:
timeout_minutes: ${{ env.rerun-tests-timeout }}
max_attempts: ${{ env.rerun-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:
SKIP_TENSOR_TESTS: 1
SYCL_CACHE_PERSISTENT: 1
- name: ReRun tensor tests on Linux
if: env.rerun-tests-on-failure == 'true'
id: run_tensor_tests_branch
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: ${{ env.rerun-tests-timeout }}
max_attempts: ${{ env.rerun-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.tensor
env:
SYCL_CACHE_PERSISTENT: 1