Skip to content

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

Merged
merged 2 commits into from
Apr 2, 2025

Conversation

volhovm
Copy link
Member

@volhovm volhovm commented Mar 31, 2025

The commit was reverted here #3105 due to the indices bug, which is fixed in this PR.

mina PR: MinaProtocol/mina#16812

Copy link
Contributor

@anne-laure-s anne-laure-s left a 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)| {
Copy link
Contributor

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

Copy link
Member Author

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...

Comment on lines +511 to +527
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();
Copy link
Contributor

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.

@volhovm
Copy link
Member Author

volhovm commented Apr 2, 2025

Merging this. The PR passes mina tests now and I'm fairly sure it works -- even though buildkite/mina-o-1-labs/pr/docker-rosetta-berkeley-bullseye-docker-image fails, it's due to another issue and is irrelevant to this PR.

@volhovm volhovm merged commit 137f513 into master Apr 2, 2025
8 checks passed
@volhovm volhovm deleted the volhovm/reintroduce-parallelise-perm-aggreg branch April 2, 2025 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants