Skip to content

Conversation

markosg04
Copy link
Collaborator

@markosg04 markosg04 commented Aug 13, 2025

  • Optimizes linear_combination from 40s at 2^28 to ~1s
  • Optimizes the batch witness gen case to loop over trace once, about a 5x improvement on that computation
  • Improves parallelism for commitments, about 2x there at 2^26 but still needs work to extract maximal speedup (I suspect MSMs are causing a problem), seems to get worse at 2^28 interestingly
  • Overall seems to be a 15% improvement to prover time e2e

@markosg04 markosg04 requested a review from moodlezoup August 15, 2025 16:32
Copy link
Collaborator

@moodlezoup moodlezoup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a couple of nits

Comment on lines 31 to 28
OneHot(OneHotPolynomial<F>),
OneHot(Arc<OneHotPolynomial<F>>),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we avoid putting the Arc here (i.e. only introduce Arc when doing linear_combination?)

@markosg04 markosg04 requested a review from moodlezoup August 18, 2025 21:40
.polynomials
.par_iter()
.map(|label| polynomials_map.get(label).unwrap())
.map(|label| Arc::new(polynomials_map.get(label).unwrap().clone()))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we separate MultilinearPolynomial::linear_combination into two different functions:
RLCPolynomial::from_linear_combination(polynomials: Vec<Arc<MultilinearPolynomial<F>>>, coefficients: &[F]) and DensePolynomial::from_linear_combination(polynomials: &[&MultilinearPolynomial<F>], coefficients: &[F]), then we'd be able to avoid the clone here

@markosg04 markosg04 changed the title Feat: better parallelism and miscellaneous optimizations feat: better parallelism and miscellaneous optimizations Aug 20, 2025
@markosg04 markosg04 requested a review from moodlezoup August 20, 2025 19:24
@moodlezoup moodlezoup merged commit 6765db5 into main Aug 21, 2025
10 checks passed
@0xAndoroid 0xAndoroid deleted the feat/better-parallelism branch September 30, 2025 19:29
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