question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use pypocketfft as FFT backend?

See original GitHub issue

Numpy 1.17 has adopted the C version of pocketfft (https://gitlab.mpcdf.mpg.de/mtr/pocketfft) as their FFT implementation. Since then I have been working on the pocketfft code, converted it to C++ and added a Python wrapper.

The new library (https://gitlab.mpcdf.mpg.de/mtr/pypocketfft)

  • supports complex and half-complex transforms, also Hartley transforms
  • supports float, double and long double precision
  • supports multi-dimensional FFTs
  • uses CPU vector instructions for ndim>1 (i.e. it computes several 1D FFTs dimultaneously).
  • uses the Bluestein algorithm for FFTs with large prime factors

Performance is significantly better than FFTPACK’s, accuracy as well. For benchmarks and dicussion see https://github.com/numpy/numpy/pull/11888 and recent comments in https://github.com/numpy/numpy/issues/11885. I have also added an interface which is very similar to scipy.fftpack.

Potential problems for adaptation:

  • written in C++, requires a C++11 compiler and pybind11
  • cosine/sine transforms are missing, and I probaly won’t have the time ti implement them. They would have to be added on top of the existing machinery.

Would this be of interest for Scipy?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:73 (73 by maintainers)

github_iconTop GitHub Comments

3reactions
rgommerscommented, May 13, 2019

In case it wasn’t clear: I don’t think there should be a default and backends; I think there should be a default backend. i.e. the default fft library would implement the same interface that a 3rd party backend would.

Yes that makes sense. I think we’re saying the same thing in different words:)

@larsoner do you mean as well as scipy.fftpack or instead of?

I’m pretty sure “instead of”.

I thought that part of the idea of adding backends was that existing code using scipy.fftpack could benefit.

For most existing code it’s an extra one-liner change (import fft instead of fftpack). Also, it cleans up the ugly fftpack name, which never made too much sense

3reactions
larsonercommented, May 13, 2019

I’m starting to think “instead of” (i.e., keep scipy.fftpack just for backward compatibility and focus this new effort on a new scipy.fft) might be nicer in the long term from a maintainability and usability/naming/user expectation perspective.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CuPy backend and pypocketfft cleanup - Python GSoC - Blogs
I have opened a PR on cupy adding a scipy.fft backend ... Restarted a discussions about use of OpenMP in SciPy. pypocketfft already...
Read more >
Document
FFT backend using pypocketfft. FFT backend using pypocketfft. Examples. See : Local connectivity graph. Hover to see nodes names; edges to Self not...
Read more >
Scipy fft backends possibilities - python - Stack Overflow
So following release notes and GitHub SciPy and NumPy issues, you both have adopted pocketfft by default. With backend I can use fftw...
Read more >
Work Submission - The Google Doc Publisher
This PR defines the scipy.fft interface and integrates the vendored pypocketfft library to implement the FFTs. As part of this I also improved...
Read more >
fft/_pocketfft/__init__.py · colesbury/scipy - Gemfury
FFT backend using pypocketfft """ from .basic import * from .realtransforms import * from .helper import * from scipy._lib._testutils import PytestTester ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found