-
Notifications
You must be signed in to change notification settings - Fork 48
206 lines (166 loc) · 6.47 KB
/
automatic_benchmarks.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
name: Automated Benchmarks
on:
pull_request:
branches:
- develop
workflow_dispatch:
jobs:
build_wheels:
name: Build macos wheels
runs-on: macos-14
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install conan
uses: turtlebrowser/[email protected]
- name: Set up conan
run: |
conan profile detect
DEFAULT_PROFILE_PATH=`conan profile path default`
PROFILE_PATH=./conan-profiles/macos-14
diff ${DEFAULT_PROFILE_PATH} ${PROFILE_PATH} || true
cp ${PROFILE_PATH} ${DEFAULT_PROFILE_PATH}
conan remote add tket-libs https://quantinuumsw.jfrog.io/artifactory/api/conan/tket1-libs --index 0
- name: Build tket C++
run: conan create tket --user tket --channel stable --build=missing -o boost/*:header_only=True -o tklog/*:shared=True -o tket/*:shared=True -tf ""
- name: Build wheel
run: |
conan create recipes/pybind11
conan create recipes/pybind11_json/all --version 0.2.13
cd pytket
# Ensure wheels are compatible with MacOS 12.0 and later:
export WHEEL_PLAT_NAME=macosx_12_0_arm64
python3.11 -m pip install -U pip build delocate
python3.11 -m build
delocate-wheel -v -w "$GITHUB_WORKSPACE/wheelhouse/" "dist/pytket-"*".whl"
- name: Save Wheel
uses: actions/upload-artifact@v4
with:
name: pytket_wheel
path: wheelhouse/
Write-Env-Var:
name: Write Env Var
runs-on: macos-14
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install pytket
pip install --pre --index-url https://github_actions:${{ secrets.PRIVATE_PYPI_PASS }}@cqcpythonrepository.azurewebsites.net/simple/ pytket_benchmarking
pip install typer
pip list
- name: Checkout tket
uses: actions/checkout@v4
with:
path: tket
- name: Checkout pytket-benchmarking-store
uses: actions/checkout@v4
with:
repository: CQCL/pytket-benchmarking-store
path: pytket-benchmarking-store
- name: Test write two to env variable
run: echo "RETURN_TEST=$(python tket/automated_benchmarking/automated_benchmarking.py return-test)" >> $GITHUB_ENV
- name: Test
run: echo $RETURN_TEST
- name: Test run benchmarks
run: python tket/automated_benchmarking/automated_benchmarking.py percentage-better pytket-benchmarking-store/benchmarking_circuits/quantum_volume temp_compiled QiskitIBMQ PytketIBMQ
- name: Test write result to env variable
run: echo "RETURN_TEST=$(python tket/automated_benchmarking/automated_benchmarking.py percentage-better pytket-benchmarking-store/benchmarking_circuits/quantum_volume temp_compiled QiskitIBMQ PytketIBMQ)" >> $GITHUB_ENV
- name: Test
run: echo $RETURN_TEST
env:
RETURN_TEST: ${{ env.RETURN_TEST }}
- name: Create comment
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body: ${{ env.RETURN_TEST }}
env:
RETURN_TEST: ${{ env.RETURN_TEST }}
- name: Create comment
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'The results of the benchmarking are... ${{ env.RETURN_TEST }}'
})
env:
RETURN_TEST: ${{ env.RETURN_TEST }}
Run-Benchmakrs:
name: Run Benchmarks
needs: build_wheels
runs-on: macos-14
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Download Wheel
uses: actions/download-artifact@v4
with:
name: pytket_wheel
- name: Install dependencies
run: |
pip install pytket-*.whl
pip install --pre --index-url https://github_actions:${{ secrets.PRIVATE_PYPI_PASS }}@cqcpythonrepository.azurewebsites.net/simple/ pytket_benchmarking
pip install typer
pip list
- name: Checkout tket
uses: actions/checkout@v4
with:
path: tket
- name: Checkout pytket-benchmarking-store
uses: actions/checkout@v4
with:
repository: CQCL/pytket-benchmarking-store
path: pytket-benchmarking-store
# - name: Test write result to env variable
# run: |
# echo "RETURN_TEST=$(python tket/automated_benchmarking/automated_benchmarking.py return-test)" >> $GITHUB_ENV
# - name: Test
# run: echo $RETURN_TEST
# - name: Test
# run: echo $RETURN_TEST
# env:
# RETURN_TEST: ${{ env.RETURN_TEST }}
- name: Compile
run: |
python tket/automated_benchmarking/automated_benchmarking.py --help
python tket/automated_benchmarking/automated_benchmarking.py compile --help
echo "RETURN_TEST=$(python tket/automated_benchmarking/automated_benchmarking.py automated_benchmarking/automated_benchmarking.py percentage-better ../pytket-benchmarking-store/benchmarking_circuits/quantum_volume automated_benchmarking/temp_compiled QiskitIBMQ PytketIBMQ)" >> $GITHUB_ENV
- name: Create comment
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body: ${{ env.RETURN_TEST }}
env:
RETURN_TEST: ${{ env.RETURN_TEST }}
- name: Create comment
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'The results of the benchmarking are... ${{ env.RETURN_TEST }}'
})
env:
RETURN_TEST: ${{ env.RETURN_TEST }}
- name: Save Compiled Circuits
uses: actions/upload-artifact@v4
with:
name: compiled_circuits
path: compiled_circuits/