[SciPy-user] fftw3 wrappers
Tue Aug 7 04:32:27 CDT 2007
Lars Friedrich wrote:
> in the numpy mailing list, I was told that
>> - if you care about speed (that is, faster than numpy), then use
>> scipy.fftpack with fftw3: there are wrappers in scipy for it.
> I am using version '0.5.3.dev3173' of scipy. Where do I find the
> fftw3-wrappers? When I just use scipy.fftpack.fft2, I do not see any
> speedup compared to numpy.fft.fft2.
Mmh, sorry, I missed that you were interested in multi dimensional fft,
this may explain the result. For 1d, fftw3 wrappers are almost always
faster than numpy, but not for multi dimensional
> I googled a bit and found this page:
> that has code for fftw2.1.3, but the page says that it is old.
There are wrappers for both fftw2 and 3 in scipy now.
> Do I need to compile scipy with some fftw3-switch turned on?
What does scipy.show_config() tells you ? The problem is that, at least
in my experience, scipy's fftw3 wrappers may or may not be faster than
numpy for multi dimensional fft, depending on your architecture (eg
Pentium 4 vs Pentium m vs Core Duo). This will change in the future,
because the problem is on scipy's side, not on fftw3 (fftw by itself is
certainly faster than what you get using numpy).
If I were you, this is what I would do:
- first, check whether you are really using fftw3 (using show_config)
- if you are, then maybe you can try with fftw2 instead of fftw3:
install fftw2 on your computer, and then rebuild scipy with FFTW3=None,
eg: FFTW3=None python setup.py build (you can check whether fftw2 is
picked instead of fftw3 by running first FFTW3 python setup.py config).
- if this is ok for you, you may try the Intel MKL instead. I have
never used it, but heard it is pretty efficient.
fftw2 has a pretty good chance of working better than fftw3 now because
it is more efficiently used by scipy. Hopefully, this will change soon
(there is a bit some work needed to improve the wrappers efficiency
wise: I am working on it).
More information about the SciPy-user