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

ifft_lower #379

Merged
merged 1 commit into from
Mar 4, 2024
Merged

ifft_lower #379

merged 1 commit into from
Mar 4, 2024

Conversation

spapinistarkware
Copy link
Contributor

@spapinistarkware spapinistarkware commented Feb 22, 2024

This change is Reviewable

@spapinistarkware spapinistarkware force-pushed the spapini/02-20-avx_ifft3 branch from ca4bb5c to e031117 Compare March 3, 2024 12:49
@spapinistarkware spapinistarkware force-pushed the spapini/02-21-ifft_lower branch from 06dd0af to 54fd21a Compare March 3, 2024 12:49
@spapinistarkware spapinistarkware force-pushed the spapini/02-20-avx_ifft3 branch from e031117 to 57cfc06 Compare March 3, 2024 12:56
@spapinistarkware spapinistarkware force-pushed the spapini/02-21-ifft_lower branch from 54fd21a to 7ea6c55 Compare March 3, 2024 12:56
@ilyalesokhin-starkware
Copy link
Collaborator

src/core/backend/avx512/fft.rs line 88 at r1 (raw file):

        ifft_vecwise_loop(values, twiddle_dbl, fft_layers - VECWISE_FFT_BITS, index_h);
        for layer in (VECWISE_FFT_BITS..fft_layers).step_by(3) {
            match fft_layers - layer {

do you need a match at every layer?

why not
while fft_layers - layer > 3 {
..
}
match fft_layers - layer

Code quote:

        for layer in (VECWISE_FFT_BITS..fft_layers).step_by(3) {
            match fft_layers - layer {

@ilyalesokhin-starkware
Copy link
Collaborator

src/core/backend/avx512/fft.rs line 109 at r1 (raw file):

}

/// Runs the 5 first ifft layers across the entire array.

Suggestion:

Runs the first 5 ifft layers across the entire array.

@ilyalesokhin-starkware
Copy link
Collaborator

src/core/backend/avx512/fft.rs line 112 at r1 (raw file):

/// Parameters:
///   values - Pointer to the entire value array, aligned to 64 bytes.
///   twiddle_dbl - The doubles of the twiddle factors for each of the 5 ifft layers.

don't you have some alignement requirements for the twiddle factors?

Code quote:

twiddle_dbl - The doubles of the twiddle factors for each of the 5 ifft layers

@ilyalesokhin-starkware
Copy link
Collaborator

src/core/backend/avx512/fft.rs line 161 at r1 (raw file):

) {
    for m in 0..(1 << loop_bits) {
        let index = (index_h << loop_bits) + m;

Make this consistent with ifft_vecwise_loop

Suggestion:

 let index = (index_h << loop_bits) + index_l;

@ilyalesokhin-starkware
Copy link
Collaborator

src/core/backend/avx512/fft.rs line 248 at r1 (raw file):

    let r1 = sub_mod_p(val0, val1);

    // Extract the even and odd parts of r1 and twiddle_m_e_dbldbl, and spread as 8 64bit values.

?

Code quote:

twiddle_m_e_dbldb

Copy link
Collaborator

@ilyalesokhin-starkware ilyalesokhin-starkware 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 4 files at r1, all commit messages.
Reviewable status: 1 of 4 files reviewed, 5 unresolved discussions (waiting on @spapinistarkware)

Copy link
Contributor Author

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

Reviewable status: 1 of 4 files reviewed, 5 unresolved discussions (waiting on @ilyalesokhin-starkware)


src/core/backend/avx512/fft.rs line 112 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

don't you have some alignement requirements for the twiddle factors?

No. Perhaps this code could be a bit more efficient with the first and second twiddle layers, but I load them as values, withouth the efficient pointer loading (i.e. let rust deal with it).

Most fo the times I just ened to load a single M31, and broadcast it.

Copy link
Collaborator

@ilyalesokhin-starkware ilyalesokhin-starkware 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 4 files at r1.
Reviewable status: 3 of 4 files reviewed, 5 unresolved discussions

Copy link
Contributor Author

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

Reviewable status: 3 of 4 files reviewed, 4 unresolved discussions (waiting on @ilyalesokhin-starkware)


src/core/backend/avx512/fft.rs line 88 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

do you need a match at every layer?

why not
while fft_layers - layer > 3 {
..
}
match fft_layers - layer

Why is this better?


src/core/backend/avx512/fft.rs line 109 at r1 (raw file):

}

/// Runs the 5 first ifft layers across the entire array.

Done.


src/core/backend/avx512/fft.rs line 161 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

Make this consistent with ifft_vecwise_loop

Done.


src/core/backend/avx512/fft.rs line 248 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

?

Done.

@spapinistarkware spapinistarkware force-pushed the spapini/02-20-avx_ifft3 branch from 57cfc06 to 90a4940 Compare March 3, 2024 15:56
@spapinistarkware spapinistarkware force-pushed the spapini/02-21-ifft_lower branch from 7ea6c55 to 887603e Compare March 3, 2024 15:56
@ilyalesokhin-starkware
Copy link
Collaborator

src/core/backend/avx512/fft.rs line 88 at r1 (raw file):

Previously, spapinistarkware (Shahar Papini) wrote…

Why is this better?

it makes it clear that match happens only at the last layer both for the reader and the compiler

@spapinistarkware spapinistarkware force-pushed the spapini/02-20-avx_ifft3 branch 2 times, most recently from d7b75c1 to 9afa4c2 Compare March 4, 2024 09:24
@spapinistarkware spapinistarkware force-pushed the spapini/02-21-ifft_lower branch from 887603e to 50b6cbb Compare March 4, 2024 09:24
Copy link
Contributor Author

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

Reviewable status: 3 of 4 files reviewed, 1 unresolved discussion (waiting on @ilyalesokhin-starkware)


src/core/backend/avx512/fft.rs line 88 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

it makes it clear that match happens only at the last layer both for the reader and the compiler

Done.

Copy link
Collaborator

@ilyalesokhin-starkware ilyalesokhin-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:

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

Copy link

graphite-app bot commented Mar 4, 2024

Merge activity

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/starkware-libs/stwo/379)
<!-- Reviewable:end -->
@spapinistarkware spapinistarkware force-pushed the spapini/02-20-avx_ifft3 branch from 9afa4c2 to 0bd6f97 Compare March 4, 2024 09:53
@spapinistarkware spapinistarkware force-pushed the spapini/02-21-ifft_lower branch from 50b6cbb to fc239c1 Compare March 4, 2024 09:54
@spapinistarkware spapinistarkware changed the base branch from spapini/02-20-avx_ifft3 to dev March 4, 2024 09:57
@graphite-app graphite-app bot merged commit fc239c1 into dev Mar 4, 2024
5 of 6 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.

2 participants