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

Improve radix-2 FFTs #169

Merged
merged 27 commits into from
Jan 8, 2021
Merged

Improve radix-2 FFTs #169

merged 27 commits into from
Jan 8, 2021

Conversation

Pratyush
Copy link
Member

@Pratyush Pratyush commented Jan 7, 2021

Description

Improves radix-2 FFTs by moving to the algorithm described in https://github.com/kwantam/fffft. The implementation matches the one there almost verbatim, except for tweaks specific to ark-poly APIs. The speedups provided by this new algorithm are really nice: between 25-50% on even moderate sizes.


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (main)
  • Linked to Github issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Wrote unit tests
  • Updated relevant documentation in the code
  • Added a relevant changelog entry to the Pending section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

@Pratyush Pratyush requested a review from ValarDragon January 7, 2021 08:31
@weikengchen
Copy link
Member

Should we add rsw to the authors field of Cargo.toml of ff? Another potential place is the LICENSE file, but we never wrote down the copyright owner field in the license file.

@Pratyush
Copy link
Member Author

Pratyush commented Jan 7, 2021

@kwantam, how would you like to be credited? (fantastic work btw)

@ValarDragon
Copy link
Member

I think at minimum, there should be a header at the top of the file explaining it came from kwantam/fffft, and was written by kwantam, but just adapated to the arkworks traits

@kwantam
Copy link

kwantam commented Jan 8, 2021

Hi folks! Glad the code is useful, and thanks for the kind words!

Feel free to credit however makes sense for your project. The suggested comment at the top of a file with a pointer to the fffft repo/crate seems like a nice idea. If you list names in an authors file, my real name and/or GitHub user-id would be cool.

Cool work, by the way!

@weikengchen
Copy link
Member

Just out of severe curiosity, any story on the GitHub user-id kwantam? @kwantam

@kwantam
Copy link

kwantam commented Jan 8, 2021

Just out of severe curiosity, any story on the GitHub user-id kwantam? @kwantam

Not much of one---I figured that the correct spelling would be unavailable as a username, whereas a misspelling might not (and indeed it seems like that's usually the case). :)

Pratyush and others added 2 commits January 8, 2021 10:49
Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
@@ -54,7 +50,11 @@ impl<F: FftField> EvaluationDomain<F> for Radix2EvaluationDomain<F> {
/// having `num_coeffs` coefficients.
fn new(num_coeffs: usize) -> Option<Self> {
// Compute the size of our evaluation domain
let size = num_coeffs.next_power_of_two() as u64;
let size = if num_coeffs.is_power_of_two() {
Copy link
Member Author

Choose a reason for hiding this comment

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

This avoids bumping up to the next power of two in an edge case.

Copy link
Member

@weikengchen weikengchen left a comment

Choose a reason for hiding this comment

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

The code looks good. But it is good if @ValarDragon takes a final pass.

Copy link
Member

@ValarDragon ValarDragon left a comment

Choose a reason for hiding this comment

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

LGTM! Lets compare the methods for mitigating parallelization overhead in a second PR?

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