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

Initialize logups automatically when first used. #879

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

Alon-Ti
Copy link
Contributor

@Alon-Ti Alon-Ti commented Nov 12, 2024

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

Alon-Ti commented Nov 12, 2024

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 91.83673% with 8 lines in your changes missing coverage. Please review.

Project coverage is 91.81%. Comparing base (e6cd98e) to head (0c64f92).

Files with missing lines Patch % Lines
crates/prover/src/constraint_framework/expr.rs 0.00% 7 Missing ⚠️
crates/prover/src/constraint_framework/mod.rs 97.36% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                             Coverage Diff                             @@
##           alont/generalize-gen-interaction-trace1     #879      +/-   ##
===========================================================================
+ Coverage                                    91.79%   91.81%   +0.02%     
===========================================================================
  Files                                           92       92              
  Lines                                        12714    12721       +7     
  Branches                                     12714    12721       +7     
===========================================================================
+ Hits                                         11671    11680       +9     
+ Misses                                         932      930       -2     
  Partials                                       111      111              

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

@Alon-Ti Alon-Ti marked this pull request as ready for review November 12, 2024 10:15
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.

Reviewable status: 0 of 23 files reviewed, 2 unresolved discussions (waiting on @Alon-Ti)


a discussion (no related file):
Can you split this pr in any way?
It is both move a lot of code and do non-trivial changes such that write_frac also initialize the logup


a discussion (no related file):
I also think that we could extract some function from write_frac code macro to make it more clear

Copy link
Collaborator

@ohad-starkware ohad-starkware 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: 0 of 23 files reviewed, 6 unresolved discussions (waiting on @Alon-Ti and @shaharsamocha7)


crates/prover/src/constraint_framework/component.rs line 85 at r1 (raw file):

    info: InfoEvaluator,
    total_sum: SecureField,
    claimed_sum: Option<ClaimedPrefixSum>,

use logup sums

Code quote:

    total_sum: SecureField,
    claimed_sum: Option<ClaimedPrefixSum>,

crates/prover/src/constraint_framework/component.rs line 172 at r1 (raw file):

        let trace_domain = CanonicCoset::new(self.eval.log_size());

        println!("n polys: {}", trace.polys[0].len());

crates/prover/src/constraint_framework/logup.rs line 69 at r1 (raw file):

            prev_col_cumsum: E::EF::zero(),
            cur_frac: None,
            is_finalized: true,

?


crates/prover/src/constraint_framework/logup.rs line 94 at r1 (raw file):

impl<E: EvalAtRow> Drop for LogupAtRow<E> {
    fn drop(&mut self) {
        // assert!(self.is_finalized, "LogupAtRow was not finalized");

why?

@Alon-Ti Alon-Ti force-pushed the alont/generalize-gen-interaction-trace1 branch from e6cd98e to 670e588 Compare November 13, 2024 07:45
@Alon-Ti Alon-Ti force-pushed the alont/generalize-gen-interaction-trace2 branch from 0c64f92 to f7312e5 Compare November 13, 2024 07:45
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: 0 of 25 files reviewed, 6 unresolved discussions (waiting on @ohad-starkware and @shaharsamocha7)


a discussion (no related file):

Previously, shaharsamocha7 wrote…

Can you split this pr in any way?
It is both move a lot of code and do non-trivial changes such that write_frac also initialize the logup

I don't think so, making components initialize the logup means you have to pass all the params to all of them.


crates/prover/src/constraint_framework/component.rs line 85 at r1 (raw file):

Previously, ohad-starkware (Ohad) wrote…

use logup sums

Done.


crates/prover/src/constraint_framework/logup.rs line 69 at r1 (raw file):

Previously, ohad-starkware (Ohad) wrote…

?

A logup starts finalized until it's used, when it becomes not finalized until finalize_logup is called. This is required for component that don't have logups.


crates/prover/src/constraint_framework/logup.rs line 94 at r1 (raw file):

Previously, ohad-starkware (Ohad) wrote…

why?

Done.


crates/prover/src/constraint_framework/component.rs line 172 at r1 (raw file):

        let trace_domain = CanonicCoset::new(self.eval.log_size());

        println!("n polys: {}", trace.polys[0].len());

Done.

@Alon-Ti Alon-Ti force-pushed the alont/generalize-gen-interaction-trace1 branch from 670e588 to e57adf9 Compare November 13, 2024 09:25
@Alon-Ti Alon-Ti force-pushed the alont/generalize-gen-interaction-trace2 branch from f7312e5 to a8f6446 Compare November 13, 2024 09:25
Copy link
Collaborator

@ohad-starkware ohad-starkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: 0 of 25 files reviewed, 2 unresolved discussions (waiting on @Alon-Ti and @shaharsamocha7)

@Alon-Ti Alon-Ti force-pushed the alont/generalize-gen-interaction-trace2 branch from a8f6446 to 7d3d676 Compare November 14, 2024 09:33
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 92fe59a Previous: f6214d1 Ratio
iffts/simd ifft/21 6793284 ns/iter (± 171971) 3272897 ns/iter (± 88576) 2.08
iffts/simd ifft/22 14412912 ns/iter (± 444177) 6919803 ns/iter (± 229254) 2.08
iffts/simd ifft/26 289384225 ns/iter (± 4786646) 138289295 ns/iter (± 2389141) 2.09
iffts/simd ifft/27 631584378 ns/iter (± 21418987) 312325137 ns/iter (± 5094310) 2.02
iffts/simd ifft/28 1401620822 ns/iter (± 45218845) 647142081 ns/iter (± 16823986) 2.17
merkle throughput/simd merkle 33993531 ns/iter (± 918431) 14690867 ns/iter (± 434150) 2.31

This comment was automatically generated by workflow using github-action-benchmark.

CC: @shaharsamocha7

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 5 of 23 files at r1, 17 of 20 files at r2, 1 of 1 files at r3, 2 of 2 files at r4, all commit messages.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @Alon-Ti)


crates/prover/src/constraint_framework/info.rs line 26 at r4 (raw file):

    pub fn new(
        log_size: u32,
        preprocessed_columns: Vec<PreprocessedColumn>,

Why InfoEvaluator gets preprocessed_columns at all?
Shouldn't it be always empty at construction?

Code quote:

        preprocessed_columns: Vec<PreprocessedColumn>,

crates/prover/src/constraint_framework/logup.rs line 27 at r4 (raw file):

/// Should be used to eliminate padded rows for the logup sum.
pub type ClaimedPrefixSum = (SecureField, usize);
// (total_sum, claimed_sum)

Claimed_sum should be set to none if equal to total_sum

Code quote:

// (total_sum, claimed_sum)

crates/prover/src/constraint_framework/logup.rs line 69 at r4 (raw file):

            prev_col_cumsum: E::EF::zero(),
            cur_frac: None,
            is_finalized: true,

Write a comment that this is turned to false only at first use

Code quote:

is_finalized: true,

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

        })
        .to_vec();
    constant_trace.push(gen_is_first(column_bits::<ELEM_BITS, EXPAND_BITS>()));

I don't understand this

Code quote:

constant_trace.push(gen_is_first(column_bits::<ELEM_BITS, EXPAND_BITS>()));

crates/prover/src/constraint_framework/assert.rs line 32 at r4 (raw file):

            col_index: TreeVec::new(vec![0; trace.len()]),
            row,
            logup: LogupAtRow::new(INTERACTION_TRACE_IDX, logup_sums.0, logup_sums.1, log_size),

Should we change LogupAtRow to get LogupSums?
Can be done in another pr

Code quote:

LogupAtRow::new(INTERACTION_TRACE_IDX, logup_sums.0, logup_sums.1, log_size)

@Alon-Ti Alon-Ti force-pushed the alont/generalize-gen-interaction-trace1 branch 2 times, most recently from 8ee5f76 to 7374dae Compare November 17, 2024 07:43
@Alon-Ti Alon-Ti force-pushed the alont/generalize-gen-interaction-trace2 branch from 7d3d676 to 68b27b7 Compare November 17, 2024 07:43
@Alon-Ti Alon-Ti force-pushed the alont/generalize-gen-interaction-trace1 branch from 7374dae to 0bd5a53 Compare November 17, 2024 09:53
@Alon-Ti Alon-Ti force-pushed the alont/generalize-gen-interaction-trace2 branch from 68b27b7 to 599a366 Compare November 17, 2024 09:53
@Alon-Ti Alon-Ti force-pushed the alont/generalize-gen-interaction-trace1 branch from 0bd5a53 to fde3040 Compare November 17, 2024 11:00
@Alon-Ti Alon-Ti force-pushed the alont/generalize-gen-interaction-trace2 branch from 599a366 to cf2af5f Compare November 17, 2024 11:00
@Alon-Ti Alon-Ti changed the base branch from alont/generalize-gen-interaction-trace1 to graphite-base/879 November 17, 2024 15:16
@Alon-Ti Alon-Ti force-pushed the alont/generalize-gen-interaction-trace2 branch from cf2af5f to 52d362d Compare November 17, 2024 15:17
@Alon-Ti Alon-Ti changed the base branch from graphite-base/879 to dev November 17, 2024 15:17
@Alon-Ti Alon-Ti force-pushed the alont/generalize-gen-interaction-trace2 branch from 52d362d to 92fe59a Compare November 17, 2024 15:17
@Alon-Ti Alon-Ti merged commit 3a88b3a into dev Nov 18, 2024
18 of 20 checks passed
Copy link
Contributor Author

Alon-Ti commented Nov 18, 2024

Merge activity

  • Nov 18, 2:41 AM EST: A user merged this pull request with Graphite.

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.

5 participants