-
Notifications
You must be signed in to change notification settings - Fork 2
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
Adding telescope benchmarks #55
base: main
Are you sure you want to change the base?
Conversation
de0fb2a
to
88d69ab
Compare
@tolikzinovyev @curiecrypt @djetchev Should we remove the benchmarks checking the variance of the number of repetitions (the Some local tests showed me that we would need to reduce |
Removing the benchmark sounds reasonable! |
I find @tolikzinovyev idea the best. What do you think @curiecrypt @djetchev ? |
I will not have time to review this PR before Monday, unfortunately, since it is a pretty large. |
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.
Nice usage of advanced criterion features. Left high-level comments.
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.
I think it seems pretty good and mature. I left a few comments and could go for another round after the conversations are resolved.
14f4fb0
to
3fdfe36
Compare
9f13518
to
e27b0d4
Compare
b540e25
to
a54996e
Compare
63a4cef
to
07fc567
Compare
350cc03
to
f422cdb
Compare
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.
LGTM 👍
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.
The code structure, benchmarks duration and variable names have definitely improved, thank you!
src/centralized_telescope/wrapper.rs
Outdated
@@ -8,7 +8,8 @@ use crate::utils::types::Element; | |||
/// The main centralized Telescope struct with prove and verify functions. | |||
#[derive(Debug, Clone, Copy)] | |||
pub struct Wrapper { | |||
setup: Setup, | |||
/// Centralized telescope internal parameters | |||
pub setup: Setup, |
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.
I think this shouldn't be public. Instead of calling CentralizedTelescope::create()
, we can run parameter derivation and use CentralizedTelescope::create_unsafe()
.
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.
The problem is accessing setup from the wrapper and not creating an unsafe wrapper from some user parameters.
I removed the pub access and added a getter function in the wrapper
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.
I don't understand. Why not use CentralizedTelescope::create_unsafe()
instead of modifying Wrapper
? I would prefer to leave the public interface unchanged.
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.
Just to be clear, I changed back the setup to private which now is unchanged.
The benches/centralized_telescope/utils.rs
file comprises the setup
function that calls the setup and returns both the dataset to bench on and a wrapper instance.
This function is used directly, with no changes in benches\...\proving_time.rs
, and we call prove
on the wrapper.
In the step_bench
however, we need to call the bench
function. As the function bench
is defined in algorithm (outside the wrapper), it takes a setup as input. The setup was already done beforehand, and it seems more natural to extract the setup
from the wrapper than compute it another time.
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.
You could return Setup
in benches/centralized_telescope/utils.rs setup()
instead of CentralizedTelescope
?
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.
The getters have already been merged in another PR as @curiecrypt needed them for the examples.
As such, the two ways are equivalent.
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.
It looks quite mature. I just added a few minor comments.
I suggest merging it asap and dealing with the minor issues later.
55ace81
to
13fcb6c
Compare
13fcb6c
to
2c0111d
Compare
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.
LGTM 👍
2c0111d
to
deb480b
Compare
/// } | ||
/// let (setps, proof_opt) = Proof::bench(set_size, ¶ms, &prover_set); | ||
/// ``` | ||
pub fn bench(set_size: u64, params: &Params, prover_set: &[Element]) -> (u64, Option<Proof>) { |
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.
Something happened to the internal
module. I think the long documentation above is not necessary since this function is not supposed to be used.
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.
We cannot have internal modules in a impl unfortunately. As the function needs to be accessed, it is public hence I added the doc for public functions.
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.
I see. Then suggest replace the long function doc with "Alba's proving algorithm used for benchmarking, returning a proof if found as well as the number of steps done when generating it. Only for internal usage. Do not use." since it's not meant to be used publicly.
aa596ec
to
e4a3b75
Compare
e4a3b75
to
f91b110
Compare
Content
Relates to #54
Depends on #105