-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: Add automated benchmarking workflow #1365
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
04d1c39
Add automated benchmarking workflow
daniel-mills-cqc 3e5f9ea
Rename jobs
daniel-mills-cqc 96f6314
Remove tket checkout
daniel-mills-cqc 870d02f
Remove mac os 12 compatability
daniel-mills-cqc 938082a
Revert "Remove mac os 12 compatability"
daniel-mills-cqc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
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/ | ||
|
||
compile-and-compare: | ||
name: Compile and compare | ||
runs-on: macos-14 | ||
needs: build_wheels | ||
|
||
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 | ||
|
||
- name: Checkout pytket-benchmarking-store | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: CQCL/pytket-benchmarking-store | ||
path: pytket-benchmarking-store | ||
|
||
- name: Perform Compilation | ||
run: | | ||
pytket_benchmarking compile QiskitIBMQ pytket-benchmarking-store/benchmarking_circuits/quantum_volume automated_benchmarks_compiled | ||
pytket_benchmarking compile PytketIBMQ pytket-benchmarking-store/benchmarking_circuits/quantum_volume automated_benchmarks_compiled | ||
|
||
- name: Save compiled circuits | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: automated_benchmarks_compiled | ||
path: automated_benchmarks_compiled/ | ||
|
||
- name: Calculate percentage better | ||
run: echo "RETURN_TEST=$(pytket_benchmarking percentage-better pytket-benchmarking-store/benchmarking_circuits/quantum_volume automated_benchmarks_compiled 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 }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be necessary as we're testing on
macos-14
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind saying a little bit more about that. I'm afraid I'm not so familiar with the steps required to build the wheels.
I tried removing these two lines but see that the build then fails. I'm not sure if I should have expected that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, that's a surprise. Ah well, we can keep the lines there, it's not an issue.