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

allocating batch inverse #977

Merged
merged 1 commit into from
Jan 14, 2025
Merged

Conversation

ohad-starkware
Copy link
Collaborator

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Collaborator Author

ohad-starkware commented Jan 12, 2025

@codecov-commenter
Copy link

codecov-commenter commented Jan 12, 2025

Codecov Report

Attention: Patch coverage is 97.72727% with 1 line in your changes missing coverage. Please review.

Project coverage is 92.32%. Comparing base (d05215c) to head (b0d17cb).
Report is 2 commits behind head on dev.

Files with missing lines Patch % Lines
...es/prover/src/core/backend/simd/very_packed_m31.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #977      +/-   ##
==========================================
- Coverage   92.38%   92.32%   -0.06%     
==========================================
  Files         105      105              
  Lines       14232    14228       -4     
  Branches    14232    14228       -4     
==========================================
- Hits        13148    13136      -12     
- Misses       1010     1018       +8     
  Partials       74       74              

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

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 all commit messages.
Reviewable status: 0 of 9 files reviewed, 1 unresolved discussion (waiting on @ohad-starkware)


crates/prover/src/core/backend/cpu/circle.rs line 175 at r2 (raw file):

            .zip(itwiddles.array_chunks_mut::<CHUNK_SIZE>())
            .for_each(|(src, dst)| {
                batch_inverse_in_place(src, dst);

I don't think we want the in_place suffix here.

Code quote:

batch_inverse_in_place

Copy link
Collaborator Author

@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 9 files reviewed, 1 unresolved discussion (waiting on @shaharsamocha7)


crates/prover/src/core/backend/cpu/circle.rs line 175 at r2 (raw file):

Previously, shaharsamocha7 wrote…

I don't think we want the in_place suffix here.

here or in general?
this can be made to use the chunked batch inverse after it's merged up the stack
I do need to expose both interfaces because we are batch inversing constant sized array so a -> vec interface is not sufficient

@ohad-starkware ohad-starkware changed the base branch from ohad/remove_field_ops to graphite-base/977 January 14, 2025 08:30
@ohad-starkware ohad-starkware force-pushed the ohad/allocating_batch_inverse branch from 9633c54 to 8aee306 Compare January 14, 2025 08:31
@ohad-starkware ohad-starkware changed the base branch from graphite-base/977 to dev January 14, 2025 08:31
@ohad-starkware ohad-starkware force-pushed the ohad/allocating_batch_inverse branch from 8aee306 to 7bc346b Compare January 14, 2025 08:31
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 9 files at r2.
Reviewable status: 5 of 9 files reviewed, 4 unresolved discussions (waiting on @ohad-starkware)


crates/prover/src/core/fields/mod.rs line 39 at r2 (raw file):

/// Assumes dst is initialized and of the same length as column.
fn batch_inverse_classic<T: FieldExpOps>(column: &[T], dst: &mut [T]) {

Consider to state somehow that this is relevant for the in_place variant

Suggestion:

/// Assumes dst is initialized and of the same length as column.
fn batch_inverse_in_place_slow<T: FieldExpOps>(column: &[T], dst: &mut [T]) {

crates/prover/src/core/fields/mod.rs line 99 at r2 (raw file):

// TODO(Ohad): chunks, parallelize.
pub fn batch_inverse<F: FieldExpOps>(column: &[F]) -> Vec<F> {

Can we test this instead of directly batch_inverse_in_place?

Code quote:

pub fn batch_inverse<F: FieldExpOps>(column: &[F]) -> Vec<F> {

crates/prover/src/core/backend/cpu/mod.rs line 109 at r2 (raw file):

    }

    // TODO(Ohad): remove.

why?

Code quote:

// TODO(Ohad): remove.

crates/prover/src/core/backend/cpu/quotients.rs line 135 at r2 (raw file):

    }

    CM31::invert_many(&denominators)

rename as discussed

Code quote:

CM31::invert_many

Copy link
Collaborator Author

@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: 5 of 9 files reviewed, 4 unresolved discussions (waiting on @ohad-starkware and @shaharsamocha7)


crates/prover/src/core/backend/cpu/mod.rs line 109 at r2 (raw file):

Previously, shaharsamocha7 wrote…

why?

weird location for this test


crates/prover/src/core/backend/cpu/quotients.rs line 135 at r2 (raw file):

Previously, shaharsamocha7 wrote…

rename as discussed

Done.


crates/prover/src/core/fields/mod.rs line 39 at r2 (raw file):

Previously, shaharsamocha7 wrote…

Consider to state somehow that this is relevant for the in_place variant

it's a subroutine (not pub)


crates/prover/src/core/fields/mod.rs line 99 at r2 (raw file):

Previously, shaharsamocha7 wrote…

Can we test this instead of directly batch_inverse_in_place?

done.

@ohad-starkware ohad-starkware force-pushed the ohad/allocating_batch_inverse branch from 7bc346b to 3ae5d1d Compare January 14, 2025 11:33
@ohad-starkware ohad-starkware force-pushed the ohad/allocating_batch_inverse branch from 3ae5d1d to b0d17cb Compare January 14, 2025 14:09
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 1 of 9 files at r2, 6 of 6 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ohad-starkware)

@ohad-starkware ohad-starkware merged commit aa3c697 into dev Jan 14, 2025
17 of 19 checks passed
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.

4 participants