Compiling FFTW with --enable-avx

1,139 views
Skip to first unread message

Viral Shah

unread,
Apr 28, 2012, 12:11:06 AM4/28/12
to Dev Julia
Does anyone have experience with using FFTW with --enable-avx, and the kind of performance gains one gets? I am experimenting with enabling threads and such in BLAS and FFTW to start with on the local_blas branch.

-viral



Steven G. Johnson

unread,
Nov 25, 2012, 10:47:49 PM11/25/12
to juli...@googlegroups.com, ath...@fftw.org
Viral Shah wrote:
> Does anyone have experience with using FFTW with --enable-avx, and the kind of performance gains one gets? I am experimenting with enabling threads and such in BLAS and FFTW to start with on the local_blas branch.

It is definitely worth it; last I heard we were getting 11-17gflops on a
single Sandy Bridge core with AVX in double precision for small to
moderate sized transforms. More in single precision.

Note that FFTW checks at runtime to determine whether the CPU supports
AVX instructions (and SSE etcetera), and disables any unsupported
kernels. So it is safe to compile with --enable-avx --enable-sse2 ...
the resulting binary should still work on fairly ancient machines.

--SGJ

Stefan Karpinski

unread,
Nov 26, 2012, 10:18:14 AM11/26/12
to Julia Dev, ath...@fftw.org
That sounds like an all-around yes to me. Seems like something we should definitely do then.




--SGJ

--




Viral Shah

unread,
Nov 26, 2012, 3:20:46 PM11/26/12
to juli...@googlegroups.com, ath...@fftw.org, ste...@alum.mit.edu
Fantastic. I believe we used to do that at one point, and it was disabled due to build issues. The issue, if I remember correctly was that compilers that did not have AVX support would barf altogether. This is also the reason that OpenBLAS is no longer built with DYNAMIC_ARCH=1.

We need to figure out how to make this work.

-viral
 

Steven G. Johnson

unread,
Nov 26, 2012, 5:59:32 PM11/26/12
to juli...@googlegroups.com
On 11/26/12 3:20 PM, Viral Shah wrote:
> Fantastic. I believe we used to do that at one point, and it was
> disabled due to build issues. The issue, if I remember correctly was
> that compilers that did not have AVX support would barf altogether. This
> is also the reason that OpenBLAS is no longer built with DYNAMIC_ARCH=1.

Maybe something like:

./configure --enable-avx --enable-sse2 || ./configure --enable-sse2

? The configure script checks if -mavx is accepted by the compiler and
exits otherwise.

Steven

Jeff Bezanson

unread,
Nov 26, 2012, 6:17:45 PM11/26/12
to juli...@googlegroups.com
Welcome, Steve. Great to have you on the list and thanks for answering this stuff.




Steven

--




Viral Shah

unread,
Nov 26, 2012, 10:05:36 PM11/26/12
to juli...@googlegroups.com
That should work. I'll try it out in the next couple of days, unless someone beats me to it.

Also, Steve, great to see you on the list!

-viral

Elliot Saba

unread,
Dec 9, 2012, 9:36:20 PM12/9/12
to juli...@googlegroups.com
Hey Steve, is there a way I can double check to make sure that FFTW is indeed using AVX?  Some symbol that's exported I can check with `nm` or some function I can call?

Thanks!



-viral

--




Steven G. Johnson

unread,
Dec 10, 2012, 12:57:46 PM12/10/12
to juli...@googlegroups.com
On 12/9/12 9:36 PM, Elliot Saba wrote:
> Hey Steve, is there a way I can double check to make sure that FFTW is
> indeed using AVX? Some symbol that's exported I can check with `nm` or
> some function I can call?

The symbol fftw_have_simd_avx (or fftwf_have_simd_avx in single
precision) is exported if FFTW is compiled with AVX enabled.

(This defines a function fftw_have_simd_avx() that checks at runtime if
AVX is supported on the current CPU and returns 1 if AVX is available.)

This is not documented, however, so I can't guarantee that it won't
change in future FFTW versions. If this is not a one-time thing and
you need some permanent functionality of this sort, could you let us
know why?

--SGJ

Elliot Saba

unread,
Dec 10, 2012, 3:43:09 PM12/10/12
to juli...@googlegroups.com
This is a one-time thing, I just want to verify that FFTW is able to use AVX on my processor to make sure the build process is compiling what we want it to.

Thanks!
-E




--SGJ

--




Reply all
Reply to author
Forward
0 new messages