-
Notifications
You must be signed in to change notification settings - Fork 558
323 lines (295 loc) · 10.7 KB
/
interface-unit-tests.yml
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
313
314
315
316
317
318
319
320
321
322
323
name: Unit Test - All Interfaces
on:
workflow_call:
inputs:
branch:
description: The PennyLane branch to checkout and run unit tests for
required: true
type: string
jax_version:
description: The version of JAX to install for any job that requires JAX
required: false
type: string
default: 0.4.16
tensorflow_version:
description: The version of TensorFlow to install for any job that requires TensorFlow
required: false
type: string
default: 2.13.0
pytorch_version:
description: The version of PyTorch to install for any job that requires PyTorch
required: false
type: string
default: 2.0.0
pytest_coverage_flags:
description: PyTest Coverage flags to pass to all jobs
required: false
type: string
default: --cov=pennylane --cov-report=term-missing --cov-report=xml --no-flaky-report -p no:warnings --tb=native
jobs:
torch-tests:
strategy:
matrix:
python-version:
- '3.9'
- '3.11'
uses: ./.github/workflows/unit-test.yml
with:
job_name: torch-tests (${{ matrix.python-version }})
branch: ${{ inputs.branch }}
coverage_artifact_name: core-interfaces-coverage-torch-${{ matrix.python-version }}
python_version: ${{ matrix.python-version }}
install_jax: false
install_tensorflow: false
install_pytorch: true
pytorch_version: ${{ inputs.pytorch_version }}
install_pennylane_lightning_master: true
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_markers: torch and not qcut and not finite-diff and not param-shift
autograd-tests:
strategy:
matrix:
python-version:
- '3.9'
- '3.10'
- '3.11'
uses: ./.github/workflows/unit-test.yml
with:
job_name: autograd-tests (${{ matrix.python-version }})
branch: ${{ inputs.branch }}
coverage_artifact_name: core-interfaces-coverage-autograd-${{ matrix.python-version }}
python_version: ${{ matrix.python-version }}
install_jax: false
install_tensorflow: false
install_pytorch: false
install_pennylane_lightning_master: true
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_markers: autograd and not qcut and not finite-diff and not param-shift
tf-tests:
strategy:
matrix:
group:
- '1'
- '2'
python-version:
- '3.9'
- '3.10'
uses: ./.github/workflows/unit-test.yml
with:
job_name: tf-tests (${{ matrix.group }}, ${{ matrix.python-version }})
branch: ${{ inputs.branch }}
coverage_artifact_name: core-interfaces-coverage-tf-${{ matrix.python-version }}-${{ matrix.group }}
python_version: ${{ matrix.python-version }}
install_jax: false
install_tensorflow: true
tensorflow_version: ${{ inputs.tensorflow_version }}
keras_version: ${{ inputs.tensorflow_version }}
install_pytorch: false
install_pennylane_lightning_master: true
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_markers: tf and not qcut and not finite-diff and not param-shift
pytest_additional_args: --splits 2 --group ${{ matrix.group }}
additional_pip_packages: pytest-split
jax-tests:
strategy:
matrix:
group:
- '1'
- '2'
python-version:
- '3.9'
- '3.11'
uses: ./.github/workflows/unit-test.yml
with:
job_name: jax-tests (${{ matrix.group }}, ${{ matrix.python-version }})
branch: ${{ inputs.branch }}
coverage_artifact_name: core-interfaces-coverage-jax-${{ matrix.python-version }}-${{ matrix.group }}
python_version: ${{ matrix.python-version }}
install_jax: true
jax_version: ${{ inputs.jax_version }}
install_tensorflow: false
install_pytorch: false
install_pennylane_lightning_master: true
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_markers: jax and not qcut and not finite-diff and not param-shift
pytest_additional_args: --splits 2 --group ${{ matrix.group }}
additional_pip_packages: pytest-split
core-tests:
strategy:
matrix:
group:
- '1'
- '2'
python-version:
- '3.9'
- '3.10'
- '3.11'
uses: ./.github/workflows/unit-test.yml
with:
job_name: core-tests (${{ matrix.group }}, ${{ matrix.python-version }})
branch: ${{ inputs.branch }}
coverage_artifact_name: core-interfaces-coverage-core-${{ matrix.python-version }}-${{ matrix.group }}
python_version: ${{ matrix.python-version }}
install_jax: false
install_tensorflow: false
install_pytorch: false
install_pennylane_lightning_master: true
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_markers: core and not qcut and not finite-diff and not param-shift
pytest_additional_args: --splits 2 --group ${{ matrix.group }}
additional_pip_packages: pytest-split
all-interfaces-tests:
uses: ./.github/workflows/unit-test.yml
with:
job_name: all-interfaces-tests
branch: ${{ inputs.branch }}
coverage_artifact_name: all-interfaces-coverage
python_version: 3.9
install_jax: true
jax_version: ${{ inputs.jax_version }}
install_tensorflow: true
tensorflow_version: ${{ inputs.tensorflow_version }}
keras_version: ${{ inputs.tensorflow_version }}
install_pytorch: true
pytorch_version: ${{ inputs.pytorch_version }}
install_pennylane_lightning_master: false
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_markers: all_interfaces
zx-tests:
uses: ./.github/workflows/unit-test.yml
with:
job_name: zx-tests
branch: ${{ inputs.branch }}
coverage_artifact_name: zx-coverage
python_version: 3.9
install_jax: false
install_tensorflow: false
install_pytorch: false
install_pennylane_lightning_master: false
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_markers: zx
additional_pip_packages: git+https://github.com/Quantomatic/pyzx.git@master
qcut-tests:
uses: ./.github/workflows/unit-test.yml
with:
job_name: qcut-tests
branch: ${{ inputs.branch }}
coverage_artifact_name: qcut-coverage
python_version: 3.9
install_jax: true
jax_version: ${{ inputs.jax_version }}
install_tensorflow: true
tensorflow_version: ${{ inputs.tensorflow_version }}
keras_version: ${{ inputs.tensorflow_version }}
install_pytorch: true
pytorch_version: ${{ inputs.pytorch_version }}
install_pennylane_lightning_master: false
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_markers: qcut
additional_pip_packages: kahypar==1.1.7 opt_einsum
qchem-tests:
uses: ./.github/workflows/unit-test.yml
with:
job_name: qchem-tests
branch: ${{ inputs.branch }}
coverage_artifact_name: qchem-coverage
python_version: 3.9
install_jax: false
install_tensorflow: false
install_pytorch: false
install_pennylane_lightning_master: false
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_markers: qchem
additional_pip_packages: openfermionpyscf basis-set-exchange
gradients-tests:
strategy:
matrix:
config:
- suite: finite-diff
- suite: param-shift
uses: ./.github/workflows/unit-test.yml
with:
job_name: gradients-tests (${{ matrix.config.suite }})
branch: ${{ inputs.branch }}
coverage_artifact_name: gradients-${{ matrix.config.suite }}-coverage
python_version: 3.9
install_jax: true
jax_version: ${{ inputs.jax_version }}
install_tensorflow: true
tensorflow_version: ${{ inputs.tensorflow_version }}
keras_version: ${{ inputs.tensorflow_version }}
install_pytorch: true
pytorch_version: ${{ inputs.pytorch_version }}
install_pennylane_lightning_master: false
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_markers: ${{ matrix.config.suite }}
data-tests:
uses: ./.github/workflows/unit-test.yml
with:
job_name: data-tests
branch: ${{ inputs.branch }}
coverage_artifact_name: data-coverage
python_version: '3.10'
install_jax: false
install_tensorflow: false
install_pytorch: false
install_pennylane_lightning_master: false
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_markers: data
additional_pip_packages: h5py
device-tests:
strategy:
matrix:
config:
- device: default.qubit.legacy
shots: None
- device: default.qubit.legacy
shots: 10000
# - device: default.qubit.tf
# shots: None
- device: default.qubit.autograd
shots: None
- device: default.mixed
shots: None
uses: ./.github/workflows/unit-test.yml
with:
job_name: device-tests (${{ matrix.config.device }}, ${{ matrix.config.shots }})
branch: ${{ inputs.branch }}
coverage_artifact_name: devices-coverage-${{ matrix.config.device }}-${{ matrix.config.shots }}
python_version: 3.9
install_jax: ${{ contains(matrix.config.device, 'jax') }}
jax_version: ${{ inputs.jax_version }}
install_tensorflow: ${{ contains(matrix.config.device, 'tf') }}
tensorflow_version: ${{ inputs.tensorflow_version }}
keras_version: ${{ inputs.tensorflow_version }}
install_pytorch: ${{ contains(matrix.config.device, 'torch') }}
pytorch_version: ${{ inputs.pytorch_version }}
install_pennylane_lightning_master: false
pytest_test_directory: pennylane/devices/tests
pytest_coverage_flags: ${{ inputs.pytest_coverage_flags }}
pytest_additional_args: --device=${{ matrix.config.device }} --shots=${{ matrix.config.shots }}
upload-to-codecov:
runs-on: ubuntu-latest
needs:
- torch-tests
- autograd-tests
- tf-tests
- jax-tests
- core-tests
- all-interfaces-tests
- zx-tests
- qcut-tests
- qchem-tests
- gradients-tests
- data-tests
- device-tests
steps:
# Checkout repo so Codecov action is able to resolve git HEAD reference
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}
- name: Down Coverage Artifacts
uses: actions/download-artifact@v3
- name: Upload to Codecov
uses: codecov/codecov-action@v3