-
Notifications
You must be signed in to change notification settings - Fork 40
basefold commit & opening refactor & cleanup #843
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
Conversation
Extracted from #843 This PR retain nice property and clean up bunch of unnessesary bit reverse across mpcs basefold prover/verifier. The core idea is to retain raw message in even-odd fold, which match the sumcheck implementation parameter binding order.
2596174 to
bebe12e
Compare
bebe12e to
bd4fd5e
Compare
| pub struct RSCodeDefaultSpec {} | ||
|
|
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 we should change this to
pub RSCodeParams {
pub num_queries: usize,
pub log_blowup: usize,
pub log_basecode_msg_size: usize,
}
impl RSCodeParams {
pub fn standard_fast() -> Self {
standard_fri_params_with_100_bits_conjectured_security(1)
}
pub fn standard_with_100_bits_conjectured_security(log_blowup: usize) -> Self {
standard_fri_params_with_100_bits_conjectured_security(log_blowup)
}
}
impl Default for RSCodeParams {
fn default() -> Self {
Self::standard_fast()
}
}The rationale is that we can use different param for different scenarios. For example, the base layer we will log_blowup = 1 for maximal performance, while for the last layer in recursion we use log_blowup = 3 for minimal proof size.
| pub fn pcs_commit<E: ExtensionField, Pcs: PolynomialCommitmentScheme<E>>( | ||
| pp: &Pcs::ProverParam, | ||
| poly: &DenseMultilinearExtension<E>, | ||
| rmm: RowMajorMatrix<<E as ExtensionField>::BaseField>, |
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.
what's the difference between pcs_commit and pcs_batch_commit?
kunxian-xia
left a comment
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.
great job!
Follow up on #843 Clean up basefold sumcheck and unified devirgo sumcheck with ceno. Previously in #653 before/after change is insignificant, but after bunch of refactor and optimised other critical path, now the benchmark shows promising result. ### Change highlights - [x] switch to ceno sumcheck and break down basefold sumcheck into 2 phases > we can't directly use ceno sumcheck as blackbox because of FRI part in basefold. - [x] and use evaluation form as uni-variates - [x] clean up old sumcheck impl ### benchmark With e2e Fibonacci 2^20 ``` fibonacci_max_steps_1048576/prove_fibonacci/fibonacci_max_steps_1048576 time: [3.1789 s 3.2022 s 3.2274 s] change: [-14.457% -13.632% -12.780%] (p = 0.00 < 0.05) Performance has improved. ``` Fibonacci 2^21 ``` fibonacci_max_steps_2097152/prove_fibonacci/fibonacci_max_steps_2097152 time: [5.2820 s 5.3010 s 5.3207 s] change: [-16.128% -15.753% -15.306%] (p = 0.00 < 0.05) Performance has improved. ``` Fibonacci 2^22 ``` fibonacci_max_steps_4194304/prove_fibonacci/fibonacci_max_steps_4194304 time: [10.369 s 10.397 s 10.423 s] change: [-10.485% -10.041% -9.5790%] (p = 0.00 < 0.05) Performance has improved. ```
This PR take basefold mpcs as pilot to take new mpcs api in preparation for p3 library.
Change scope
coderandom code as we only need keep reed solomon encoding as our major use caseproof size
New design also introduce a minor optimisation to reduce 5% proof size : during opening phase, we open 2 value of merkle tree on leafs[j], leafs[j+ni], but one of the value can be carry over from previous layer interpolation result, thus prover can skip one of them. With that, we can make this check happened naturally with smaller size of proof.
e2e Latency
on AMD EPYC 32 cores
Fibonacci 2^20
Fibonacci 2^21
Fibonacci 2^22
on AMD 5800X 16 cores
Fibonacci 2^20
Fibonacci 2^21