-
Notifications
You must be signed in to change notification settings - Fork 36
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
Refactor Supernova benchmarks and config for CI #253
Conversation
af3f562
to
51ea08a
Compare
51ea08a
to
6c6fe76
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.
Very encouraging, and I'm ok with the type hackery for now.
benches/justfile
Outdated
gpu-bench-ci +benches: | ||
#!/bin/sh | ||
for bench in {{benches}}; do | ||
cargo criterion --bench $bench --features "cuda" --message-format=json > "$bench-{{commit}}".json | ||
cargo criterion --bench $bench --features "cuda,asm" --message-format=json > "$bench-{{commit}}".json |
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.
Are we sure all uses of this justfile are on x86_64? If not, the ASM feature will cause a panic here.
We may want to add at least a code comment, if not running arch
beforehand and doing the feature selection in function.
benches/common/supernova/bench.rs
Outdated
// we vary the number of constraints in the step circuit | ||
for &num_cons_in_augmented_circuit in num_cons().iter() { | ||
// number of constraints in the step circuit | ||
let num_cons = num_cons_in_augmented_circuit - NUM_CONS_VERIFIER_CIRCUIT_PRIMARY; |
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.
Yeah, so this is the problem: in bench mode, that substraction has wrapping semantics, and if a missed update of the cons numbers makes it wrap around, the benches will silently start eating up the bench machine's memory. We should do checked_sub(..).expect("constraint numbers out of date!!")
here
benches/common/supernova/mod.rs
Outdated
// This should match the value in test_supernova_recursive_circuit_pasta | ||
// TODO: This should also be a table matching the num_augmented_circuits in the below | ||
pub const NUM_CONS_VERIFIER_CIRCUIT_PRIMARY: usize = 9844; | ||
pub const NUM_SAMPLES: usize = 10; |
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.
Not-so-fun part: this number is meant to be meaningfully different for the nova and supernova use cases. We may want to document that.
This number is also a footgun waiting to happen, see my note on let num_cons = ...
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 is excellent, and much more secure, thanks a ton!
…-lang#253) * add rayon for prove_inner * version
* optimize ppsnark (lurk-lang#252) * optimize; check claims about Az,Bz,Cz * add rayon * Use rayon for computing evaluations in prove_helper in parallel (lurk-lang#253) * add rayon for prove_inner * version --------- Co-authored-by: Srinath Setty <[email protected]>
This PR refactors the Supernova benchmarks to reduce duplicated code and enables configuration of the constraint numbers used in the benchmarks via the
ARECIBO_NUM_CONS
env var.benches/common/supernova
. Thebench_snark_internal_with_arity
function is a bit hacky, as theS1, S2
trait bounds are required but unused by the recursive SNARK. There is surely a better trait solution but this seemed simplest for now.supernova-ci
benchmark to run theRecursiveSNARKSuperNova-2circuit
andCompressedSNARKSuperNova-Commitments-2circuit
with 16384/1038732 constraints to get a good idea of perf changes on each PR, and updates CI accordingly.quote!
-ing a vector of strings into a list of tokens and passing that to thecriterion_group!
targets, but it expected apath
specifier instead of anexpr
so this was unsuccessful. Other than this I couldn't think of a way to configure which targets to run besides feature configuration or the implemented solution of creating a new benchmark.