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

Add GKR implementation of Grand Product lookups #620

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

andrewmilson
Copy link
Contributor

@andrewmilson andrewmilson commented May 8, 2024

This change is Reviewable

@codecov-commenter
Copy link

codecov-commenter commented May 8, 2024

Codecov Report

Attention: Patch coverage is 92.72727% with 16 lines in your changes missing coverage. Please review.

Project coverage is 92.56%. Comparing base (778d86c) to head (9883b66).

Files Patch % Lines
crates/prover/src/core/lookups/gkr_prover.rs 91.57% 8 Missing ⚠️
crates/prover/src/core/lookups/gkr_verifier.rs 92.64% 2 Missing and 3 partials ⚠️
crates/prover/src/core/backend/cpu/lookups/gkr.rs 94.64% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@                            Coverage Diff                             @@
##           05-08-Implement_GkrOps_for_CPU_backend     #620      +/-   ##
==========================================================================
+ Coverage                                   89.77%   92.56%   +2.78%     
==========================================================================
  Files                                          72       72              
  Lines                                        9379     9589     +210     
  Branches                                     9379     9589     +210     
==========================================================================
+ Hits                                         8420     8876     +456     
+ Misses                                        887      634     -253     
- Partials                                       72       79       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@andrewmilson andrewmilson changed the base branch from andrew/dev/lookups/gkr to 05-08-Implement_GkrOps_for_CPU_backend May 8, 2024 16:46
@andrewmilson andrewmilson force-pushed the 05-08-Implement_GkrOps_for_CPU_backend branch from c359474 to 3c5a3fc Compare May 16, 2024 16:48
@andrewmilson andrewmilson force-pushed the 05-08-Add_GKR_implementation_of_Grand_Product_lookups branch from 95cfa41 to bde8a85 Compare May 16, 2024 16:48
@andrewmilson andrewmilson force-pushed the 05-08-Implement_GkrOps_for_CPU_backend branch from 3c5a3fc to a014862 Compare May 19, 2024 14:35
@andrewmilson andrewmilson force-pushed the 05-08-Add_GKR_implementation_of_Grand_Product_lookups branch from bde8a85 to 164390d Compare May 19, 2024 14:35
@andrewmilson andrewmilson force-pushed the 05-08-Implement_GkrOps_for_CPU_backend branch from a014862 to 66728bd Compare May 20, 2024 14:56
@andrewmilson andrewmilson force-pushed the 05-08-Add_GKR_implementation_of_Grand_Product_lookups branch from 164390d to 79b3a34 Compare May 20, 2024 14:56
@andrewmilson andrewmilson force-pushed the 05-08-Implement_GkrOps_for_CPU_backend branch from 66728bd to 753aad2 Compare May 24, 2024 19:14
@andrewmilson andrewmilson force-pushed the 05-08-Add_GKR_implementation_of_Grand_Product_lookups branch from 79b3a34 to 386d3c8 Compare May 25, 2024 01:24
@andrewmilson andrewmilson force-pushed the 05-08-Implement_GkrOps_for_CPU_backend branch from 753aad2 to fbd5d23 Compare June 13, 2024 03:40
@andrewmilson andrewmilson force-pushed the 05-08-Add_GKR_implementation_of_Grand_Product_lookups branch from 386d3c8 to 36695ff Compare June 13, 2024 03:40
@andrewmilson andrewmilson force-pushed the 05-08-Implement_GkrOps_for_CPU_backend branch from fbd5d23 to 5705279 Compare June 13, 2024 04:09
@andrewmilson andrewmilson force-pushed the 05-08-Add_GKR_implementation_of_Grand_Product_lookups branch from 36695ff to c3b7a95 Compare June 13, 2024 04:09
@andrewmilson andrewmilson marked this pull request as ready for review June 13, 2024 04:10
@andrewmilson andrewmilson force-pushed the 05-08-Implement_GkrOps_for_CPU_backend branch from 5705279 to 38cef08 Compare June 13, 2024 15:36
@andrewmilson andrewmilson force-pushed the 05-08-Add_GKR_implementation_of_Grand_Product_lookups branch from c3b7a95 to 162fdcc Compare June 13, 2024 15:36
@andrewmilson andrewmilson force-pushed the 05-08-Implement_GkrOps_for_CPU_backend branch from 38cef08 to 778d86c Compare June 13, 2024 15:45
@andrewmilson andrewmilson force-pushed the 05-08-Add_GKR_implementation_of_Grand_Product_lookups branch from 162fdcc to 9883b66 Compare June 13, 2024 15:45
@andrewmilson andrewmilson force-pushed the 05-08-Implement_GkrOps_for_CPU_backend branch from 778d86c to 158add9 Compare June 19, 2024 03:08
@andrewmilson andrewmilson force-pushed the 05-08-Add_GKR_implementation_of_Grand_Product_lookups branch from 9883b66 to da2a0e9 Compare June 19, 2024 03:08
@andrewmilson andrewmilson force-pushed the 05-08-Implement_GkrOps_for_CPU_backend branch from 158add9 to 40a1a18 Compare June 19, 2024 03:10
@andrewmilson andrewmilson force-pushed the 05-08-Add_GKR_implementation_of_Grand_Product_lookups branch from da2a0e9 to 2a62b8c Compare June 19, 2024 03:10
@andrewmilson andrewmilson force-pushed the 05-08-Implement_GkrOps_for_CPU_backend branch from 40a1a18 to 8a53b70 Compare June 20, 2024 13:50
Copy link
Collaborator

@spapinistarkware spapinistarkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 8 files at r1, all commit messages.
Reviewable status: 1 of 11 files reviewed, 4 unresolved discussions (waiting on @andrewmilson and @shaharsamocha7)


crates/prover/src/core/backend/cpu/lookups/gkr.rs line 32 at r3 (raw file):

        claim: SecureField,
    ) -> UnivariatePoly<SecureField> {
        let k = h.n_variables();

n_variables or n_vars

Suggestion:

n_variables

crates/prover/src/core/backend/cpu/lookups/gkr.rs line 35 at r3 (raw file):

        let n_terms = 1 << (k - 1);
        let eq_evals = h.eq_evals;
        let y = eq_evals.y();

What's this? Rename or doc.


crates/prover/src/core/backend/cpu/lookups/gkr.rs line 51 at r3 (raw file):

                    let rhs0 = input_layer[(n_terms + i) * 2];
                    let rhs1 = input_layer[(n_terms + i) * 2 + 1];

Suggestion:

                    // Input polynomial at points (r,0,bits(i),1), ...
                    let inp_at_r0i0 = input_layer[i * 2];
                    let inp_at_r0i1 = input_layer[i * 2 + 1];

                    let inp_at_r1i0 = input_layer[(n_terms + i) * 2];
                    let inp_at_r1i1 = input_layer[(n_terms + i) * 2 + 1];
                    
                    let inp_at_r2i0 = (inp_at_r1i0.double() - inp_at_r0i0);
                    let inp_at_r2i1 = (inp_at_r0i1.double() - inp_at_r0i1);

crates/prover/src/core/backend/cpu/lookups/gkr.rs line 54 at r3 (raw file):

                    let product2 = (rhs0.double() - lhs0) * (rhs1.double() - lhs1);
                    let product0 = lhs0 * lhs1;

Suggestion:

                    // Product polynomial prod(x) = inp(x,0)*inp(x,1)
                    //   at points (r,0,bits(i)), ...
                    let prod_at_r0i = inp_at_r0i0 * inp_at_r0i1;
                    let prod_t_r2i = inp_at_r2i0 * inp_at_r2i1;

Base automatically changed from 05-08-Implement_GkrOps_for_CPU_backend to dev June 20, 2024 15:01
@andrewmilson andrewmilson force-pushed the 05-08-Add_GKR_implementation_of_Grand_Product_lookups branch from 2a62b8c to b375f43 Compare June 20, 2024 15:12
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.

None yet

3 participants