I tried some preliminary tests of the newly released gcc-4.6.0 with Gambit, and things look pretty good.
I was looking just at how long the routine direct-fft-recursive-4 in lib/_num.scm took to execute on an array of $2^{25}$ complex doubles. Here are various execution times comparing gcc-4.6.0 with the gcc-4.5.1 that ships with Ubuntu 10.10. I just did "./configure CC=...; make" on plain manilla gambit-4.6.0 with default optimization "-O1 -fschedule-insns2":
4.5.1: 3180 ms cpu time (3160 user, 20 system) 4.6.0: 2910 ms cpu time (2910 user, 0 system)
That's quite the improvement, nearly 10%
I also added -fschedule-insns to the optimization list:
4.5.1 -fschedule-insns: 2870 ms cpu time (2870 user, 0 system) 4.6.0 -fschedule-insns: 2730 ms cpu time (2730 user, 0 system)
Still about a 5% improvement.
Since there are 5 N \log_2 N operations in an FFT of size N, that last time represents 1.536 Gflops on my
model name : Intel(R) Core(TM)2 Quad CPU Q8200 @ 2.33GHz
FFTW3 out-of-place (i.e, the same result, but not the same algorithm) achieves almost exactly 2 Gflops on a 3.0 GHz machine with a better memory system:
http://www.fftw.org/speed/CoreDuo-3.0GHz-icc64/
Scaling the results on my machine to the higher clock rate gives
(* 1.56 3.0 (/ 2.33))
2.008583690987124
(I don't feel like benchmarking fftw3 on my own machine, sorry.)
So who says you can't do scientific computing in Scheme?
Brad
PS: This is no April Fools joke!
Afficher les réponses par date
I've just built the latest fftw3 with gcc-4.6.0 (it uses the compiler options -O3 -fast-math) and compared it to gambit-4.6.0 (without any updates) configured with
./configure CC='/pkgs/gcc-4.6.0/bin/gcc -fschedule-insns'
For both systems we computed an fft of $2^{25}$ complex elements. The scheme code did an "out-of-place" fft, fftw3 does an "in-place" fft, but I can't see any way to get fftw3 to do an "out-of-place" fft, even though there are reports of such a code on the BenchFFT web site.
The results are
Gambit:
2730 ms cpu time (2730 user, 0 system)
FFTW3:
With FFTW_ESTIMATE (estimate the best algorithm without any actual testing):
4.5400000000000000e+00 seconds
With FFTW_PATIENT (compute the specific size FFT we want to do with many different algorithms, then choose the fastest one):
2.9500000000000002e+00 seconds
Brad
PS: The total time for the code that tests many different algorithms is
1587.630u 4.840s 26:34.24 99.8% 0+0k 0+0io 0pf+0w
On Fri, 2011-04-01 at 18:27 -0400, Bradley Lucier wrote:
The scheme code did an "out-of-place" fft, fftw3 does an "in-place" fft, but I can't see any way to get fftw3 to do an "out-of-place" fft, even though there are reports of such a code on the BenchFFT web site.
Sorry, that should be the scheme code does an "out-of-order" FFT, while FFTW3 does an "in-order" FFT; both FFTs are "in-place".
Brad