Skip to content

Continuous Benchmarking using Github Actions #2134

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

pablo-gf
Copy link
Contributor

@pablo-gf pablo-gf commented May 5, 2025

This PR aims to provide a new benchmarking approach for liboqs. It uses the Continuous Benchmarking action from Marketplace, like the mlkem-native repository. For speed benchmarking of the current algorithms in the library, 3 new files are included:

  • scripts/parse_liboqs_speed.py : Retrieves the benchmarking data from speed_kem and speed_sig and outputs it in a json file that matches the format required by the continuous benchmarking action.

  • workflows/kem-bench.yml: Iterates through the different KEM algorithms executing the speed test and gathering its information using parse_liboqs_speed.py. It then pushes the output json file to a gh-pages branch using the Continuous Benchmarking action.

  • workflows/sig-bench.yml: Same kem-bench.yml but for signature algorithms.

To complete the benchmarking, it is required to create a new gh-pages branch so that the workflows generate and continuously update a Github page with the visualization of the benchmarking results. I have adapted the html file to include some additional features here . I can include these changes once the new gh-pages branch for liboqs is set up. You can see an example of what the final output should look like here.

Let me know if you have any questions or suggestions!

  • Does this PR change the input/output behaviour of a cryptographic algorithm (i.e., does it change known answer test values)? (If so, a version bump will be required from x.y.z to x.(y+1).0.)
  • Does this PR change the list of algorithms available -- either adding, removing, or renaming? Does this PR otherwise change an API? (If so, PRs in fully supported downstream projects dependent on these, i.e., oqs-provider will also need to be ready for review and merge by the time this is merged.)

pablo-gf added 3 commits May 5, 2025 16:23
Signed-off-by: Pablo Gutiérrez Félix <[email protected]>
Signed-off-by: Pablo Gutiérrez Félix <[email protected]>
Copy link
Member

@SWilson4 SWilson4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your patience, @pablo-gf! I've taken a look at the GitHub warnings; I think I have an idea how to resolve each of them.

on:
workflow_dispatch:
push:
branches: [main]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like this to be triggered via the commit-to-main.ymll file so that it fits in with the rest of our CI.


jobs:
build:
runs-on: ubuntu-latest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually we'll want to have this working on multiple runners. How scalable is the approach taken here?

I walked through the PQCP setup with Matthias and Ry last week; once open-quantum-safe/tsc#180 lands we'll be able to work with a similar setup.

Copy link
Contributor Author

@pablo-gf pablo-gf May 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SWilson4 Initially, my idea would be to create another matrix for the different runners that we will be using for benchmarking, but of course any ideas are welcome. I am not too familiar working with external runners, but we could follow a similar approach as https://github.com/pq-code-package/mlkem-native, where there are different workflows depending on the runner selected, and they all call an action which executes the benchmarking.

Also, I fixed your other comments. Let me know if you have any other feedback!

@dstebila
Copy link
Member

I think it would be good if the build & configuration information that's currently in the expandable "Latest commit build information" is displayed directly at the top of the page.

In the pop-ups that show when you hover over a datapoint, it looks like all the commits have been authored by you. Is that placeholder information? Or should something else be showing here?

Signed-off-by: Pablo Gutiérrez <[email protected]>
@pablo-gf
Copy link
Contributor Author

@dstebila I have added the build information at the top, let me know if that works: https://pablo-gf.github.io/liboqs/dev/bench/. As for your second comment, that is placeholder information. The idea is that those pop-ups will contain the details of each commit made to the library starting from the first commit after this continuous benchmarking framework is deployed.

@dstebila
Copy link
Member

@dstebila I have added the build information at the top, let me know if that works: https://pablo-gf.github.io/liboqs/dev/bench/. As for your second comment, that is placeholder information. The idea is that those pop-ups will contain the details of each commit made to the library starting from the first commit after this continuous benchmarking framework is deployed.

Looks good, thanks!

Signed-off-by: Pablo Gutiérrez <[email protected]>
@pablo-gf
Copy link
Contributor Author

@SWilson4 I fixed the security warnings that popped-up after my last commit. Let me know if you have any comments or suggestions. As I mentioned at the beginning, to make the entire process work we would also need to create a new gh-pages branch so that the workflows generate and continuously update a Github page with the visualization of the benchmarking results.

@SWilson4
Copy link
Member

Thanks for the updates, @pablo-gf! Are you able to merge this branch into main of your fork so we can test the commit-to-main flow and see if it's working as expected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants