-
Notifications
You must be signed in to change notification settings - Fork 153
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
Cleanup dense poly #151
Cleanup dense poly #151
Conversation
Dev on |
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.
One comment on allocation. Otherwise LGTM.
@@ -122,7 +122,7 @@ where | |||
fn batch(&self) -> Self::BatchedPolynomials { | |||
use rayon::prelude::*; | |||
let (batched_dim_read, (batched_final, batched_E, batched_flag)) = rayon::join( | |||
|| DensePolynomial::merge_dual(self.dim.as_ref(), self.read_cts.as_ref()), | |||
|| DensePolynomial::merge(&[self.dim.as_slice(), self.read_cts.as_slice()].concat()), |
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.
Can we drop the concat here?
I'm concerned that we're going to allocate a vector of length self.dim.len() + self.read_cts.len()
twice. Once after the .concat()
call and once in DensePolynomial::merge
. Recall that these are likely to be massive (2^28 -> 2^32).
LGTM |
Slowly preparing for generalizing the PCS, which would require switching to
MultilinearExtension
fromark-poly
and deprecating the customDensePolynomial
used now.This PR should be useful regardless of whether the above happens or not:
merge_dual
in favor of callingmerge
on the concatenated slicesextend
flag_msm
&sm_msm
) are not methods onDensePolynomial
but rather stand-alone functions. Moves them to themsm
module.