Skip to content

Perform in-place FFT in intermediate steps of ND FFT #2543

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

Merged
merged 3 commits into from
Jul 29, 2025
Merged

Conversation

vtavana
Copy link
Collaborator

@vtavana vtavana commented Jul 28, 2025

In this PR, FFT module is updated to perform in-place FFT in intermediate steps of ND FFT which brings performance improvements for cases such as:

import dpnp
shape = (30,40,50,60,70)
a = dpnp.random.rand(*shape) + 1j * dpnp.random.rand(*shape)
res = dpnp.fft.fftn(a)
%timeit res = dpnp.fft.fftn(a); res.sycl_queue.wait()
# 74.6 ms ± 166 μs per loop (mean ± std. dev. of 7 runs, 10 loops each)# Master branch
# 71.7 ms ± 99.8 μs per loop (mean ± std. dev. of 7 runs, 10 loops each) # This branch

import dpnp
shape = (30,40,50,60,70)
a = dpnp.random.rand(*shape)
out = out=dpnp.empty((30, 40, 50, 60, 36), dtype=dpnp.complex128)
res = dpnp.fft.rfftn(a, out=out)
res is out
# True
%timeit res = dpnp.fft.rfftn(a, out=out); res.sycl_queue.wait()
# 78.8 ms ± 384 μs per loop (mean ± std. dev. of 7 runs, 10 loops each) # Master branch
# 69.6 ms ± 86.1 μs per loop (mean ± std. dev. of 7 runs, 10 loops each) # This branch
  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?

@vtavana vtavana self-assigned this Jul 28, 2025
Copy link
Contributor

View rendered docs @ https://intelpython.github.io/dpnp/pull/2543/index.html

Copy link
Contributor

github-actions bot commented Jul 28, 2025

Array API standard conformance tests for dpnp=0.19.0dev1=py313h509198e_27 ran successfully.
Passed: 1227
Failed: 0
Skipped: 9

@coveralls
Copy link
Collaborator

coveralls commented Jul 28, 2025

Coverage Status

coverage: 72.108% (+0.007%) from 72.101%
when pulling b9c79c5 on fft-out
into c8b9ad0 on master.

@vtavana vtavana marked this pull request as ready for review July 28, 2025 23:44
@antonwolfy antonwolfy added this to the 0.19.0 release milestone Jul 29, 2025
Copy link
Contributor

@antonwolfy antonwolfy left a comment

Choose a reason for hiding this comment

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

Thank you @vtavana for implementing a significant performance improvement. LGTM!

@vtavana vtavana merged commit 5122f80 into master Jul 29, 2025
115 of 123 checks passed
@vtavana vtavana deleted the fft-out branch July 29, 2025 14:24
github-actions bot added a commit that referenced this pull request Jul 29, 2025
In this PR, FFT module is updated to perform in-place FFT in
intermediate steps of ND FFT which brings performance improvements for
cases such as: 5122f80
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