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

Removed batching from LogupAtRow. #817

Merged
merged 1 commit into from
Sep 15, 2024
Merged

Conversation

Alon-Ti
Copy link
Contributor

@Alon-Ti Alon-Ti commented Sep 3, 2024

This change is Reviewable

Copy link
Contributor Author

Alon-Ti commented Sep 3, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @Alon-Ti and the rest of your teammates on Graphite Graphite

@Alon-Ti Alon-Ti marked this pull request as ready for review September 3, 2024 13:06
@Alon-Ti Alon-Ti force-pushed the alont/eliminate-logup-batching branch from 8ceb385 to 7820538 Compare September 9, 2024 07:15
@codecov-commenter
Copy link

codecov-commenter commented Sep 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.58%. Comparing base (215b1cd) to head (c9d43aa).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #817      +/-   ##
==========================================
- Coverage   92.60%   92.58%   -0.03%     
==========================================
  Files          89       89              
  Lines       12055    12017      -38     
  Branches    12055    12017      -38     
==========================================
- Hits        11164    11126      -38     
  Misses        784      784              
  Partials      107      107              

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

@Alon-Ti Alon-Ti force-pushed the alont/eliminate-logup-batching branch from 7820538 to eeb96b0 Compare September 9, 2024 07:23
Copy link
Collaborator

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 6 files at r1, 3 of 3 files at r2, all commit messages.
Reviewable status: 5 of 6 files reviewed, 3 unresolved discussions (waiting on @Alon-Ti)


crates/prover/src/constraint_framework/logup.rs line 34 at r2 (raw file):

    /// The evaluation of the last cumulative sum column.
    pub prev_col_cumsum: E::EF,
    cur_frac: Option<Fraction<E::EF, E::EF>>,

Why not initialize with (zero(), one())?
and remove the Option

Code quote:

cur_frac: Option<Fraction<E::EF, E::EF>>,

crates/prover/src/examples/blake/scheduler/constraints.rs line 45 at r2 (raw file):

    // TODO(spapini): Support multiplicities.
    // TODO(spapini): Change to -1.

Can we fix those todos or remove the lookup if not needed?

Code quote:

    // TODO(spapini): Support multiplicities.
    // TODO(spapini): Change to -1.

crates/prover/src/examples/poseidon/mod.rs line 188 at r2 (raw file):

        // Provide state lookups.
        let final_state_denom: E::EF = lookup_elements.combine(&state);
        // (1 / denom1) - (1 / denom1) = (denom1 - denom0) / (denom0 * denom1).

(1 / denom1) - (1 / denom1) = 0

Suggestion:

// (1 / denom0) - (1 / denom1) = (denom1 - denom0) / (denom0 * denom1).

@Alon-Ti Alon-Ti force-pushed the alont/eliminate-logup-batching branch 2 times, most recently from 7af40e8 to 58aba4b Compare September 9, 2024 14:33
Copy link
Contributor Author

@Alon-Ti Alon-Ti left a comment

Choose a reason for hiding this comment

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

Reviewable status: 5 of 7 files reviewed, 3 unresolved discussions (waiting on @shaharsamocha7)


crates/prover/src/constraint_framework/logup.rs line 34 at r2 (raw file):

Previously, shaharsamocha7 wrote…

Why not initialize with (zero(), one())?
and remove the Option

Because of the finalize logic I only add a constraint on the next call for each frac, I need a way to identify the uninitialized state anyway, checking if there was a previous frac does that.


crates/prover/src/examples/blake/scheduler/constraints.rs line 45 at r2 (raw file):

Previously, shaharsamocha7 wrote…

Can we fix those todos or remove the lookup if not needed?

I'm not sure, I just mechanically converted the lookups. Let's go over all spapini TODOs next week to see what should be done now and change ownership.


crates/prover/src/examples/poseidon/mod.rs line 188 at r2 (raw file):

Previously, shaharsamocha7 wrote…

(1 / denom1) - (1 / denom1) = 0

Done.

Copy link
Collaborator

@shaharsamocha7 shaharsamocha7 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 1 files at r4, all commit messages.
Reviewable status: 5 of 7 files reviewed, 1 unresolved discussion (waiting on @Alon-Ti)


crates/prover/src/examples/blake/xor_table/constraints.rs line 30 at r4 (raw file):

        let frac_chunks: [Fraction<E::EF, E::EF>; 1 << (2 * EXPAND_BITS)] =
            std::array::from_fn(|i| {
                let (i, j) = ((i >> EXPAND_BITS) as u32, (i % (1 << EXPAND_BITS)) as u32);

@andrewmilson Do you have another alternative?
This is pretty awful :(

Code quote:

        let frac_chunks: [Fraction<E::EF, E::EF>; 1 << (2 * EXPAND_BITS)] =
            std::array::from_fn(|i| {
                let (i, j) = ((i >> EXPAND_BITS) as u32, (i % (1 << EXPAND_BITS)) as u32);

@Alon-Ti Alon-Ti force-pushed the alont/eliminate-logup-batching branch from 58aba4b to e6fc31c Compare September 15, 2024 09:54
@Alon-Ti Alon-Ti force-pushed the alont/eliminate-logup-batching branch from e6fc31c to c9d43aa Compare September 15, 2024 09:58
Copy link
Collaborator

@shaharsamocha7 shaharsamocha7 left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r5, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Alon-Ti)

@Alon-Ti Alon-Ti merged commit f787197 into dev Sep 15, 2024
16 checks passed
jarnesino pushed a commit to jarnesino/stwo that referenced this pull request Sep 17, 2024
jarnesino pushed a commit to jarnesino/stwo that referenced this pull request Sep 17, 2024
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.

3 participants