-
Notifications
You must be signed in to change notification settings - Fork 119
Reintroduce "Parallelise perm_aggreg" w/ bugfix #3121
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
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.
Feels legitimate to me, althrough my knowledge of Rust is still limited.
let mut z: Vec<F> = witness | ||
.par_iter() | ||
.zip(self.column_evaluations.permutation_coefficients8.par_iter()) | ||
.map(|(w_i, perm_coeffs8_i)| { |
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 would keep the name s
instead of perm_coeffs
as it is the one in the comment, it’s shorter and it make sense if you know plonk
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 wanted to rename for clarity, I was confused by s
(thought it was shifts), and it's consistent with the general effort to use more self-descriptive variable names...
let z_prefolded: Vec<F> = witness | ||
.par_iter() | ||
.zip(self.cs.shift.par_iter()) | ||
.map(|(w_i, shift_i)| { | ||
let mut output_vec: Vec<_> = vec![F::one(); 1]; | ||
for (j, w_i_j) in w_i.iter().enumerate().take(n - 1) { | ||
output_vec.push(*w_i_j + (self.cs.sid[j] * beta * shift_i) + gamma); | ||
} | ||
output_vec | ||
}) | ||
.reduce_with(|mut l, r| { | ||
for i in 0..n { | ||
l[i] *= &r[i]; | ||
} | ||
l | ||
}) | ||
.unwrap(); |
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 could probably be unified with the code of z
.
Merging this. The PR passes mina tests now and I'm fairly sure it works -- even though |
The commit was reverted here #3105 due to the indices bug, which is fixed in this PR.
mina
PR: MinaProtocol/mina#16812