-
Notifications
You must be signed in to change notification settings - Fork 202
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
Parallelize Lagrange constraints evaluation #317
Parallelize Lagrange constraints evaluation #317
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.
Great job! Thank you! I left some comments and improvement suggestions inline.
Overall, I'm not sure I like creating a separate constraint evaluator specifically for LogUp-GKR, but I think once the inline comments are addressed, we can merge this structure to see how it impacts the overall proof generation performance. Then, we can think of a way to refactor it.
fn evaluate_fragment_full<T: TraceLde<E>>( | ||
&self, | ||
trace: &T, | ||
domain: &StarkDomain<A::BaseField>, | ||
fragment: &mut EvaluationTableFragment<E>, | ||
trans_constraints_divisors: &LagrangeKernelTransitionConstraintsDivisor<E>, | ||
boundary_divisors_inv: &[E], | ||
s_col_constraint_divisor: &[E::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.
Related to the above 2 comments, I'm wondering if it would be better to move trans_constraints_divisors
, boundary_divisors_inv
, and s_col_constraint_divisor
into self.logup_gkr_constraints_evaluator
. This way, we won't need to pass them as parameters here and it would also encapsulate LogUp-GKR-related code better.
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 agree. In the current implementation, it would make sense to have LogUpGkrConstraintsDivisors
be part of
of LogUpGkrConstraintEvaluator
. The only issue with making this work is that requires a StarkDomain
for its creation and I couldn't come up with a clean way to make it work.
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.
This is because when we create a new evaluator, we don't pass the domain into the constructor, right? I think we can probably refactor this. Let's create an issue for this.
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.
Done
d48e5a4
to
dc4d876
Compare
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.
Looks good! Thank you! I left two small comments inline.
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.
Looks good! Thank you!
Builds on #315 and supersedes #316 .
The PR proposes a new constraint evaluator that is specific to when LogUp-GKR is enabled.
This has also the advantage of closing #306 .