-
Notifications
You must be signed in to change notification settings - Fork 147
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
Ns/bench zk cs ghl #1825
Ns/bench zk cs ghl #1825
Conversation
manual run of the bench workflow: https://github.com/zama-ai/tfhe-rs/actions/runs/12033323684/job/33547332621 |
3ea5bf7
to
bb3529f
Compare
ComputeLoad::Verify => "compute_load_verify", | ||
}; | ||
let bench_id = format!("{bench_name}::{param_name}_{bits}_bits_packed_{zk_load}"); | ||
let bench_id = format!("{bench_name}::{param_name}_{bits}_bits_packed_{load}_{bound:?}"); |
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.
debug formatting of bounds is ok for our format ?
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 will print "GHL" or "CS", which is ok as David confirmed
tfhe-zk-pok/benches/utils.rs
Outdated
#[allow(unused)] | ||
pub fn init_params_v2_ghl( | ||
test_params: PkeTestParameters, | ||
) -> ( |
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.
could be a single function taking the bound kind and then match in there, otherwise the caller needs to know how this works
tfhe-zk-pok/src/proofs/pke_v2.rs
Outdated
}) | ||
.checked_mul(B_squared + (sqr((d + 2) as u128) * (d + k) as u128) / 4) | ||
.unwrap_or_else(|| { | ||
panic!("Invalid parameters for zk_pok, B_squared: {B_squared}, d: {d}, k: {k}") |
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.
a clearer error message please
tfhe-zk-pok/src/proofs/pke_v2.rs
Outdated
// safely used for this | ||
assert!( | ||
m_bound <= 64, | ||
"Invalid parameters for zk_pok, B_squared: {B_squared}, d: {d}, k: {k}, m_bound: {m_bound} > 64" |
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.
same here for the m_bound could be "we only support 64 bits integer, the computed m parameter is {m_bound} bits > 64 bits"
ae567f8
to
d5838e0
Compare
8efd842
to
41cdebe
Compare
41cdebe
to
38c731f
Compare
PR content/description
Adds a bench to compare ghl and cs bounds for zk v2. Also add some limit tests for zk with extreme but supported values