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 bit_reverse for SIMD backend #600

Merged
merged 2 commits into from
May 15, 2024

Conversation

andrewmilson
Copy link
Contributor

@andrewmilson andrewmilson commented May 2, 2024

This change is Reviewable

@codecov-commenter
Copy link

codecov-commenter commented May 2, 2024

Codecov Report

Attention: Patch coverage is 98.90110% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 91.27%. Comparing base (8ed4d95) to head (da34ddc).

Files Patch % Lines
crates/prover/src/core/backend/simd/bit_reverse.rs 98.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #600      +/-   ##
==========================================
+ Coverage   91.18%   91.27%   +0.08%     
==========================================
  Files          75       76       +1     
  Lines        9375     9466      +91     
  Branches     9375     9466      +91     
==========================================
+ Hits         8549     8640      +91     
- Misses        756      757       +1     
+ Partials       70       69       -1     

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

@andrewmilson andrewmilson force-pushed the 04-30-Implement_FieldOps_for_SIMD_backend branch from aca433d to 6d71f67 Compare May 2, 2024 16:29
@andrewmilson andrewmilson force-pushed the 05-02-Add_bit_reverse_for_SIMD_backend branch from 738f4bf to c8d160c Compare May 2, 2024 16:29
@andrewmilson andrewmilson force-pushed the 04-30-Implement_FieldOps_for_SIMD_backend branch from 6d71f67 to 455686c Compare May 2, 2024 16:30
@andrewmilson andrewmilson force-pushed the 05-02-Add_bit_reverse_for_SIMD_backend branch from c8d160c to 5f8512f Compare May 2, 2024 16:30
@andrewmilson andrewmilson force-pushed the 04-30-Implement_FieldOps_for_SIMD_backend branch from 455686c to ea02309 Compare May 2, 2024 16:34
@andrewmilson andrewmilson force-pushed the 05-02-Add_bit_reverse_for_SIMD_backend branch from 5f8512f to 2774e5b Compare May 2, 2024 16:34
@andrewmilson andrewmilson force-pushed the 04-30-Implement_FieldOps_for_SIMD_backend branch from ea02309 to 567e20c Compare May 2, 2024 19:23
@andrewmilson andrewmilson force-pushed the 05-02-Add_bit_reverse_for_SIMD_backend branch from 2774e5b to 2e79a5f Compare May 2, 2024 19:24
@andrewmilson andrewmilson force-pushed the 04-30-Implement_FieldOps_for_SIMD_backend branch from 567e20c to b6daa79 Compare May 2, 2024 20:08
@andrewmilson andrewmilson force-pushed the 05-02-Add_bit_reverse_for_SIMD_backend branch from 2e79a5f to 2febca8 Compare May 2, 2024 20:08
@andrewmilson andrewmilson force-pushed the 04-30-Implement_FieldOps_for_SIMD_backend branch from b6daa79 to 0f31f09 Compare May 2, 2024 20:34
@andrewmilson andrewmilson force-pushed the 05-02-Add_bit_reverse_for_SIMD_backend branch from 2febca8 to 83d24e0 Compare May 2, 2024 20:34
@andrewmilson andrewmilson force-pushed the 04-30-Implement_FieldOps_for_SIMD_backend branch from 0f31f09 to 9509a53 Compare May 6, 2024 19:16
@andrewmilson andrewmilson force-pushed the 05-02-Add_bit_reverse_for_SIMD_backend branch from 83d24e0 to 545100b Compare May 6, 2024 19:16
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, 2 unresolved discussions (waiting on @andrewmilson)


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

Previously, andrewmilson (Andrew Milson) wrote…

Tried to make this file as close of a direct copy of backend/avx512/bit_reverse.rs. Most of the changes are just switching types i.e. __m512i replaced with u32x16

Ty, those comments are helpful


crates/prover/src/core/backend/simd/bit_reverse.rs line 94 at r2 (raw file):

            0b11100, 0b01101, 0b11101, 0b01110, 0b11110, 0b01111, 0b11111,
        ])
    };

Remove?

Code quote:

    // L is an input to _mm512_permutex2var_epi32, and it is used to
    // interleave the first half of a with the first half of b.
    const _L: u32x16 = unsafe {
        core::mem::transmute([
            0b00000, 0b10000, 0b00001, 0b10001, 0b00010, 0b10010, 0b00011, 0b10011, 0b00100,
            0b10100, 0b00101, 0b10101, 0b00110, 0b10110, 0b00111, 0b10111,
        ])
    };
    // H is an input to _mm512_permutex2var_epi32, and it is used to interleave the second half
    // interleave the second half of a with the second half of b.
    const _H: u32x16 = unsafe {
        core::mem::transmute([
            0b01000, 0b11000, 0b01001, 0b11001, 0b01010, 0b11010, 0b01011, 0b11011, 0b01100,
            0b11100, 0b01101, 0b11101, 0b01110, 0b11110, 0b01111, 0b11111,
        ])
    };

Copy link
Contributor Author

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


crates/prover/src/core/backend/simd/bit_reverse.rs line 94 at r2 (raw file):

Previously, shaharsamocha7 wrote…

Remove?

They get removed in the next PR https://reviewable.io/reviews/starkware-libs/stwo/594

@andrewmilson andrewmilson force-pushed the 04-30-Implement_FieldOps_for_SIMD_backend branch from 9509a53 to 8db394e Compare May 7, 2024 18:50
@andrewmilson andrewmilson force-pushed the 05-02-Add_bit_reverse_for_SIMD_backend branch from 545100b to 8c4703f Compare May 7, 2024 18:50
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 r3, all commit messages.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @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 2 of 2 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @andrewmilson)

Copy link
Contributor

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

:lgtm:

Reviewed 1 of 2 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @andrewmilson)

@andrewmilson andrewmilson force-pushed the 04-30-Implement_FieldOps_for_SIMD_backend branch from 0990999 to d79b8b3 Compare May 10, 2024 21:11
@andrewmilson andrewmilson force-pushed the 05-02-Add_bit_reverse_for_SIMD_backend branch from 42b44b6 to db1d83a Compare May 10, 2024 21:11
@andrewmilson andrewmilson force-pushed the 04-30-Implement_FieldOps_for_SIMD_backend branch from d79b8b3 to aa87739 Compare May 11, 2024 02:40
@andrewmilson andrewmilson force-pushed the 05-02-Add_bit_reverse_for_SIMD_backend branch from db1d83a to adcb5b9 Compare May 11, 2024 02:41
@andrewmilson andrewmilson force-pushed the 04-30-Implement_FieldOps_for_SIMD_backend branch from aa87739 to fd674a3 Compare May 15, 2024 04:34
@andrewmilson andrewmilson force-pushed the 05-02-Add_bit_reverse_for_SIMD_backend branch from adcb5b9 to 15e93af Compare May 15, 2024 04:34
@andrewmilson andrewmilson force-pushed the 04-30-Implement_FieldOps_for_SIMD_backend branch from fd674a3 to fbb8a0b Compare May 15, 2024 13:11
Base automatically changed from 04-30-Implement_FieldOps_for_SIMD_backend to dev May 15, 2024 13:15
@andrewmilson andrewmilson force-pushed the 05-02-Add_bit_reverse_for_SIMD_backend branch from 15e93af to da34ddc Compare May 15, 2024 13:15
@andrewmilson andrewmilson merged commit d13da83 into dev May 15, 2024
11 of 12 checks passed
@andrewmilson andrewmilson deleted the 05-02-Add_bit_reverse_for_SIMD_backend branch May 15, 2024 13:30
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