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

Distributed Fast Fourier Transforms #1218

Merged
merged 65 commits into from
Nov 27, 2023

Conversation

ClaudiaComito
Copy link
Contributor

@ClaudiaComito ClaudiaComito commented Sep 18, 2023

Resolves #1097 and can be used for #1248

Due Diligence

  • General:
    • base branch must be main for new features, latest release branch (e.g. release/1.3.x) for bug fixes
    • title of the PR is suitable to appear in the Release Notes
  • Implementation:
    • unit tests: all split configurations tested
    • unit tests: multiple dtypes tested
    • documentation updated where needed

Description

Introducing fft module with all relevant operations.

Main points:

  • Transforms along the split dimension are handled by redistributing to a different axis first, transforming the original split dimension locally, and then redistributing back.
  • Multi-axis transforms on real input (rfftn, ihfft etc.) will be performed as the corresponding generic FFT operation if transform of the split axis is required. This is due to the intrinsic recursion built into these operations (transpose, resplit, transform, resplit, transpose, transform), where the complex output of the first real transform cannot act as input to the second real transform.
  • Multi-axis transforms on real input still return the correct shape, i.e. for the last transformed axis only up to the Nyquist frequency.

Still TODO:

  • expand documentation esp. of real ffts
  • implement fftfreq, fftshift etc.
  • fix test failure (on 7 processes) EDIT: solved by setting correct output dtype of empty local tensor)

Issue/s resolved: #1097

Changes proposed:

  • implemented FFT functions
  • implemented tests

Type of change

  • New feature (non-breaking change which adds functionality)

Memory requirements

Performance

Does this change modify the behaviour of other functions? If so, which?

no

@ClaudiaComito ClaudiaComito added this to the 1.4.0 milestone Sep 18, 2023
@ClaudiaComito ClaudiaComito self-assigned this Sep 18, 2023
@ghost
Copy link

ghost commented Sep 18, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@github-actions
Copy link
Contributor

Thank you for the PR!

@github-actions
Copy link
Contributor

Thank you for the PR!

@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

Attention: 23 lines in your changes are missing coverage. Please review.

Comparison is base (3302a44) 91.83% compared to head (e4409cb) 91.82%.

Files Patch % Lines
heat/fft/fft.py 91.15% 23 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1218      +/-   ##
==========================================
- Coverage   91.83%   91.82%   -0.02%     
==========================================
  Files          77       79       +2     
  Lines       11193    11457     +264     
==========================================
+ Hits        10279    10520     +241     
- Misses        914      937      +23     
Flag Coverage Δ
unit 91.82% <91.48%> (-0.02%) ⬇️

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.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

Thank you for the PR!

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

Thank you for the PR!

@github-actions
Copy link
Contributor

Thank you for the PR!

@github-actions
Copy link
Contributor

Thank you for the PR!

Copy link
Contributor

Thank you for the PR!

Copy link
Contributor

Thank you for the PR!

Copy link
Contributor

Thank you for the PR!

Copy link
Contributor

Thank you for the PR!

@ClaudiaComito
Copy link
Contributor Author

From my point of view this looks fine. Thanks for the work 👍 I only have added some minor questions/comment that we can address in the PR talk; after that I guess we can merge.

In addition, we could already add a benchmark for FFT if this makes sense.

@mrfh92 thanks a lot for the review. I think I've addressed all of your comments. I will add the benchmarks next week.

Copy link
Collaborator

@mrfh92 mrfh92 left a comment

Choose a reason for hiding this comment

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

As far as I can see, everything is fine now.
Thanks for your work! 👍

@mrfh92
Copy link
Collaborator

mrfh92 commented Nov 20, 2023

It looks like that we have the same problem with the old PyTorch versions as in #1262 (where no changes to the code have been done) ... so failure on many old PyTorch-versions seems to be a more general problem

Copy link
Contributor

Thank you for the PR!

Copy link
Contributor

Thank you for the PR!

Copy link
Contributor

Thank you for the PR!

Copy link
Contributor

Thank you for the PR!

@ClaudiaComito ClaudiaComito merged commit 8b87890 into main Nov 27, 2023
9 checks passed
@ClaudiaComito ClaudiaComito deleted the features/1097-Provide_Fast_Fourier_Transform_FFT branch November 27, 2023 09:06
ClaudiaComito added a commit that referenced this pull request Nov 28, 2023
@ClaudiaComito ClaudiaComito restored the features/1097-Provide_Fast_Fourier_Transform_FFT branch November 28, 2023 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request signal processing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide Fast Fourier Transform (FFT)
3 participants