initial RIOT-rs port of the ml-kem benchmark#11
Open
kaspar030 wants to merge 1 commit into
Open
Conversation
keks
reviewed
Sep 12, 2024
keks
left a comment
Member
There was a problem hiding this comment.
Thank you for the port! I haven't been able to run this so far as I don't have the hardware. I did leave two questions on things that looked "off" to me, but I am not familiar with laze and RIOT, so I might be missing some context.
Comment on lines
+16
to
+17
| debug = true | ||
| lto = false |
Member
There was a problem hiding this comment.
Is there a reason we have debug info on and link time optimizations off?
| info!("Generating 1 key pairs"); | ||
|
|
||
| let ticks = benchmark(1, || { | ||
| let _ = mlkem::generate_key_pair(randomness_gen); |
Member
There was a problem hiding this comment.
Should these maybe be black-boxed so the calls are not optimized away? Same for the other calls in the benchmark closures.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is an initial take on the benchmarks ported to RIOT-rs.
I only did the ml-kem for now.
The README.md provides instructions. I tested this on nrf52840dk only, it should run as-is on all the RIOT-rs Cortex-M devices (Rpi Pico, the nrf, nrf5340, some Nucleos). Cortex-M only for now because that's what we have a
benchmark()implementation for.Not that our
benchmark()is currently using the SysTick. It is very accurate but tops out at 2**24 clock cycles (returning an error), so I've had to reduce the number of iterations to 1.Interestingly, using this port compared to the
libcrux-nrf52840, runtime seems to be double. That might well be my Systick US_PER_TICK factor. I was just assuming the nrf in our config runs at 80MHz, which might not actually be true. 😇