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

Mut chunks for VeryPacked Base and Secure columns. #842

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

Alon-Ti
Copy link
Contributor

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

This change is Reviewable

Copy link
Contributor Author

Alon-Ti commented Sep 18, 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 18, 2024 20:50
Copy link
Contributor Author

Alon-Ti commented Sep 18, 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

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 2 files at r1, all commit messages.
Reviewable status: 1 of 2 files reviewed, 3 unresolved discussions (waiting on @Alon-Ti)


crates/prover/src/core/backend/simd/column.rs line 223 at r1 (raw file):

    const N_ELEMS: usize = N_LANES * N_VERY_PACKED_ELEMS;
    pub fn at(&self, index: usize) -> BaseField {
        self.0[index / Self::N_ELEMS].to_array()[index % N_LANES]

I'm not sure it's correct.
Do we have tests for this code?

Suggestion:

self.0[index / Self::N_ELEMS].to_array()[index % self::N_ELEMS]

crates/prover/src/core/backend/simd/column.rs line 227 at r1 (raw file):

    pub fn set(&mut self, index: usize, value: BaseField) {
        let mut packed = self.0[index / Self::N_ELEMS].to_array();

Rename?

Suggestion:

let mut packed_as_array = self.0[index / Self::N_ELEMS].to_array();

crates/prover/src/core/backend/simd/column.rs line 519 at r1 (raw file):

            .iter()
            .flat_map(|x| x.to_array())
            .take(self.length)

Why do you need this? Don't you always want all the values?

Code quote:

.take(self.length)

@codecov-commenter
Copy link

codecov-commenter commented Sep 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 42 lines in your changes missing coverage. Please review.

Project coverage is 91.55%. Comparing base (cdf66f3) to head (44cfa96).
Report is 18 commits behind head on dev.

Files with missing lines Patch % Lines
crates/prover/src/core/backend/simd/column.rs 0.00% 36 Missing ⚠️
...es/prover/src/core/backend/simd/very_packed_m31.rs 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #842      +/-   ##
==========================================
- Coverage   91.86%   91.55%   -0.31%     
==========================================
  Files          89       89              
  Lines       12080    12135      +55     
  Branches    12080    12135      +55     
==========================================
+ Hits        11097    11110      +13     
- Misses        876      918      +42     
  Partials      107      107              
Flag Coverage Δ
91.55% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

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


crates/prover/src/core/backend/simd/column.rs line 220 at r1 (raw file):

pub struct VeryPackedBaseColumnMutSlice<'a>(pub &'a mut [VeryPackedBaseField]);

impl<'a> VeryPackedBaseColumnMutSlice<'a> {

This entire impl can be removed

Code quote:

impl<'a> VeryPackedBaseColumnMutSlice<'a> {

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: 1 of 2 files reviewed, 4 unresolved discussions (waiting on @shaharsamocha7)


crates/prover/src/core/backend/simd/column.rs line 220 at r1 (raw file):

Previously, shaharsamocha7 wrote…

This entire impl can be removed

Done.


crates/prover/src/core/backend/simd/column.rs line 223 at r1 (raw file):

Previously, shaharsamocha7 wrote…

I'm not sure it's correct.
Do we have tests for this code?

Removed.


crates/prover/src/core/backend/simd/column.rs line 227 at r1 (raw file):

Previously, shaharsamocha7 wrote…

Rename?

Removed.


crates/prover/src/core/backend/simd/column.rs line 519 at r1 (raw file):

Previously, shaharsamocha7 wrote…

Why do you need this? Don't you always want all the values?

That's specifically what length is for, so you can have vectors of length finer than whatever the packing is, the cpu impl would just save them at the correct length.

Copy link
Contributor Author

Alon-Ti commented Sep 22, 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

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 2 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Alon-Ti)

@Alon-Ti Alon-Ti merged commit ee8a9c6 into dev Sep 25, 2024
16 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.

3 participants