Skip to content
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

Merged

Conversation

Al-Kindi-0
Copy link
Contributor

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 .

Copy link
Collaborator

@irakliyk irakliyk left a 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.

Comment on lines 210 to 200
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],
) {
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@Al-Kindi-0 Al-Kindi-0 force-pushed the al-parallel-lagrange-constraint-eval-2 branch from d48e5a4 to dc4d876 Compare September 17, 2024 16:46
Copy link
Collaborator

@irakliyk irakliyk left a 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.

Copy link
Collaborator

@irakliyk irakliyk left a 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!

@irakliyk irakliyk merged commit 2713a95 into facebook:logup-gkr Sep 18, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants