Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* Re: Is FFT inherently slow on Alpha CPUs?
  1999-10-14  4:00 Is FFT inherently slow on Alpha CPUs? G. Hugh SONG
  1999-10-14  4:00 ` Paul Bourke
  1999-10-14  4:00 ` Christian Simmendinger
@ 1999-10-14  4:00 ` Michal Jaegermann
  1999-10-14  4:00 ` James Van Buskirk
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Michal Jaegermann @ 1999-10-14  4:00 UTC (permalink / raw)


G. Hugh SONG (ghsong@nospam.com) wrote:
: I realized that sine and cosine are the Achilles heel of the Alpha CPU.

There are not implemented in hardware, if this is what you want to say.

: On the new sun with double CPUs, the FFT benchmark is twice faster than
: on Alpha 21164.

If your "benchmark" happens really to measure how fast you can produce
some sine and cosine values, and you are using a default math library
which came with gcc on the top of it, then this result is not at all
surprising.  As usual benchmarks without all details what was run, in
what circumstances, which compilers and libraries were used and so on,
and so on, do not provide any real information beyond that something
was run.

: Is my understanding correct?  Does FFT rely on sine and cosine even for
: 2's radix or something?

Correctly written FFT does not depend on sine and cosine at all
and even less "inherently".  In some circumstances it may make sense
to recalculate coefficients "on a spot" but in others this will be
an elementary error.

  --mj




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Is FFT inherently slow on Alpha CPUs?
  1999-10-14  4:00 Is FFT inherently slow on Alpha CPUs? G. Hugh SONG
                   ` (2 preceding siblings ...)
  1999-10-14  4:00 ` Michal Jaegermann
@ 1999-10-14  4:00 ` James Van Buskirk
  1999-10-15  4:00   ` Stephen E. Halpin
  1999-10-14  4:00 ` W. Kyle Gilbertson
  1999-10-15  4:00 ` David A. Long
  5 siblings, 1 reply; 9+ messages in thread
From: James Van Buskirk @ 1999-10-14  4:00 UTC (permalink / raw)



G. Hugh SONG wrote in message <38063F40.8EE3A106@nospam.com>...

>I realized that sine and cosine are the Achilles heel of the Alpha CPU.
>On the new sun with double CPUs, the FFT benchmark is twice faster than
>on Alpha 21164.
>On all other benchmark programs (Polyhedron, if you care to know), our
>old Alpha 21164 533MHz is still about 1.5 times faster.  That is not
>actually bad.  I know.

>Is my understanding correct?  Does FFT rely on sine and cosine even for
>2's radix or something?


I don't think so.  This result bugged me, too, so I took a glance at
the code.  I seem to recall that the number of trig function calls
was essentially negligible, but that they were ony done once in any
case followed by 20 FFTs.  The trig functions were put in a huge
table and there was also a huge index table... this looks like one
of those old codes where the author assumed that memory access is
cheap: not a valid assumption nowadays.  If you're interested, I
typed in some code from a paper referenced in comp.lang.fortran and
created a file that compares the performance between the old and new
versions.  The new version is faster but seems to suffer from lack
of page coloring under NT; if you can get a patch to enable this
under Alpha Linux you might be able to confirm that this is truly
the reason for the widely variable performance of the improved FFT.
If you want to further communicate on this topic, it might be
advisable to also send email to me as my news server is currently
experiencing difficuties.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Is FFT inherently slow on Alpha CPUs?
  1999-10-14  4:00 Is FFT inherently slow on Alpha CPUs? G. Hugh SONG
                   ` (3 preceding siblings ...)
  1999-10-14  4:00 ` James Van Buskirk
@ 1999-10-14  4:00 ` W. Kyle Gilbertson
  1999-10-15  4:00 ` David A. Long
  5 siblings, 0 replies; 9+ messages in thread
From: W. Kyle Gilbertson @ 1999-10-14  4:00 UTC (permalink / raw)



Doesn't FFT rely on complex number manipulation?  The 21264 has
transcendental computation as part of the ALU.

G. Hugh SONG wrote in message <38063F40.8EE3A106@nospam.com>...
>I realized that sine and cosine are the Achilles heel of the Alpha CPU.
>On the new sun with double CPUs, the FFT benchmark is twice faster than
>on Alpha 21164.
>On all other benchmark programs (Polyhedron, if you care to know), our
>old Alpha 21164 533MHz is still about 1.5 times faster.  That is not
>actually bad.  I know.
>
>Is my understanding correct?  Does FFT rely on sine and cosine even for
>2's radix or something?
>
>Thanks
>--
>G. Hugh Song





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Is FFT inherently slow on Alpha CPUs?
@ 1999-10-14  4:00 G. Hugh SONG
  1999-10-14  4:00 ` Paul Bourke
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: G. Hugh SONG @ 1999-10-14  4:00 UTC (permalink / raw)


I realized that sine and cosine are the Achilles heel of the Alpha CPU.
On the new sun with double CPUs, the FFT benchmark is twice faster than
on Alpha 21164.
On all other benchmark programs (Polyhedron, if you care to know), our
old Alpha 21164 533MHz is still about 1.5 times faster.  That is not
actually bad.  I know.

Is my understanding correct?  Does FFT rely on sine and cosine even for
2's radix or something?

Thanks
-- 
G. Hugh Song



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Is FFT inherently slow on Alpha CPUs?
  1999-10-14  4:00 Is FFT inherently slow on Alpha CPUs? G. Hugh SONG
@ 1999-10-14  4:00 ` Paul Bourke
  1999-10-14  4:00 ` Christian Simmendinger
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Paul Bourke @ 1999-10-14  4:00 UTC (permalink / raw)


> Is my understanding correct?  Does FFT rely on sine and cosine even for
> 2's radix or something?

The FFT doesn't require ANY sine or cosine functions, just
additions and multiplications. If you want to try a routine
that isn't optimised for any particular platform try the code
here: http://www.swin.edu.au/astronomy/pbourke/sigproc/dft/

----------------------------           ----------------------------------
P a u l   B o u r k e                     Astrophysics and Supercomputing
mailto:pbourke@swin.edu.au                                 Mail number 31
http://www.mhri.edu.au/~pdb/           Swinburne University of Technology
Phone: 61 3 9214 8624                                 PO Box 218 Hawthorn
Fax:   61 3 9819 0856                            Victoria 3122, Australia



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Is FFT inherently slow on Alpha CPUs?
  1999-10-14  4:00 Is FFT inherently slow on Alpha CPUs? G. Hugh SONG
  1999-10-14  4:00 ` Paul Bourke
@ 1999-10-14  4:00 ` Christian Simmendinger
  1999-10-14  4:00 ` Michal Jaegermann
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Christian Simmendinger @ 1999-10-14  4:00 UTC (permalink / raw)


"G. Hugh SONG" wrote:

> I realized that sine and cosine are the Achilles heel of the Alpha CPU.
> On the new sun with double CPUs, the FFT benchmark is twice faster than
> on Alpha 21164.

Probably related to cachesize and/or memory bandwidth/latency.

> On all other benchmark programs (Polyhedron, if you care to know), our
> old Alpha 21164 533MHz is still about 1.5 times faster.  That is not
> actually bad.  I know.

Indeed.

> Is my understanding correct?  Does FFT rely on sine and cosine even for
> 2's radix or something?

Nope.
But there is several options for an optimized FFT.
For starters you might want to check the DXML library
(or is it called CXML these days ?)
If not satisfied check:
http://www.fftw.org

Christian






^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Is FFT inherently slow on Alpha CPUs?
  1999-10-14  4:00 ` James Van Buskirk
@ 1999-10-15  4:00   ` Stephen E. Halpin
  0 siblings, 0 replies; 9+ messages in thread
From: Stephen E. Halpin @ 1999-10-15  4:00 UTC (permalink / raw)


On Thu, 14 Oct 1999 14:03:52 -0600, "James Van Buskirk" <torsop@ix.netcom.com> wrote:

>
>G. Hugh SONG wrote in message <38063F40.8EE3A106@nospam.com>...
>
>>I realized that sine and cosine are the Achilles heel of the Alpha CPU.
>>On the new sun with double CPUs, the FFT benchmark is twice faster than
>>on Alpha 21164.

It wouldnt be unexpected for Suns newest processors to keep up with
Digitals oldest.  The only "new" dual processor Sun reporting slower
SPECfp95 averages (using the single CPU numbers from the SPEC web site)
is the base 300MHz Ultra 2.

You also dont mention whether the benchmark was written to use both
processors on the Sun, which compilers you were using, etc...  All of
these can significantly impact the results.

>>On all other benchmark programs (Polyhedron, if you care to know), our
>>old Alpha 21164 533MHz is still about 1.5 times faster.  That is not
>>actually bad.  I know.
>
>>Is my understanding correct?  Does FFT rely on sine and cosine even for
>>2's radix or something?
>
>I don't think so.  This result bugged me, too, so I took a glance at
>the code.  I seem to recall that the number of trig function calls
>was essentially negligible, but that they were ony done once in any
>case followed by 20 FFTs.  The trig functions were put in a huge
>table and there was also a huge index table... this looks like one
>of those old codes where the author assumed that memory access is
>cheap: not a valid assumption nowadays.

It could be new code written for modern DSPs which have zero wait
state memory banks on chip which can be accessed in parallel.  All
the world wasnt a VAX and all the world isnt an Alpha...

>                                         If you're interested, I
>typed in some code from a paper referenced in comp.lang.fortran and
>created a file that compares the performance between the old and new
>versions.  The new version is faster but seems to suffer from lack
>of page coloring under NT; if you can get a patch to enable this
>under Alpha Linux you might be able to confirm that this is truly
>the reason for the widely variable performance of the improved FFT.
>If you want to further communicate on this topic, it might be
>advisable to also send email to me as my news server is currently
>experiencing difficuties.

-Steve



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Is FFT inherently slow on Alpha CPUs?
  1999-10-14  4:00 Is FFT inherently slow on Alpha CPUs? G. Hugh SONG
                   ` (4 preceding siblings ...)
  1999-10-14  4:00 ` W. Kyle Gilbertson
@ 1999-10-15  4:00 ` David A. Long
  1999-10-19  4:00   ` Greg Lindahl
  5 siblings, 1 reply; 9+ messages in thread
From: David A. Long @ 1999-10-15  4:00 UTC (permalink / raw)


>I realized that sine and cosine are the Achilles heel of the Alpha CPU.

A lot of the time (perhaps most of the time) apparent problems with
floating point performance on Alphas are due to the standards
requirements for signaling error conditions.  If you have not done so
already, I suggest trying the following before concluding the hardware
might be inherently slow:

1) Get the free Compaq Portable Math Library (CPML) for Linux, and the
free beta-test Compaq C compiler for Linux from:
	http://www.unix.digital.com/linux/software.htm

2) Consult the cc manpage for descriptions of "-fast".  The "-fast"
option causes, in part, the following to be set:

	-O3
	-assume nomath_errno
	-D_INTRINSICS
	-D_INLINE_INTRINSICS
	-D_FASTMATH
	-fp_reorder
	-intrinsics

which should be relevant to your goal.  The other things it sets can
also help performance, but if their description concerns you you can try
explicitly specifying just the above options.

3) Build your application with "cc -fast", and link it with CPML in
place of the default Linux libm.

If you are not using C, there is a FORTRAN compiler on the web page
too.  Consult the documentation that comes with it for similar issues. 
If you are using C++, keep consulting the web page for future
developments.

These options can make a substantial difference, but you must carefully
consider the implications of turning off full math routine error
reporting.  Other things that can help performance are making sure that,
if you are using "-std0", you also consider using "-float" to prevent
automatic promotion of float's to double (K&R C).  At the same time you
should be sure to use sinf() for calculations involving all float's, as
opposed to sin() (or the equivalent for other math routines), and use
the proper data types for all variables and constants.  Those last two
points should apply to any standards conforming vendor/platform.

Having said all this, there is a set of high performance FFT functions
in one of the libraries associated with FORTRAN.  I do not know if this
is in the FORTRAN kit on our Linux web page.  The library used to be
called DXML, and is presumably now called CXML.

-- 
-dl

David A. Long
Compaq Tru64 UNIX Development Environments Group
Compaq Computer Corporation



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Is FFT inherently slow on Alpha CPUs?
  1999-10-15  4:00 ` David A. Long
@ 1999-10-19  4:00   ` Greg Lindahl
  0 siblings, 0 replies; 9+ messages in thread
From: Greg Lindahl @ 1999-10-19  4:00 UTC (permalink / raw)


"David A. Long" <dlong@zk3.dec.com> writes:

> Having said all this, there is a set of high performance FFT functions
> in one of the libraries associated with FORTRAN.  I do not know if this
> is in the FORTRAN kit on our Linux web page.  The library used to be
> called DXML, and is presumably now called CXML.

Yes, it is there, and supposedly will be bundled with the compilers.

-- g



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~1999-10-19  4:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-10-14  4:00 Is FFT inherently slow on Alpha CPUs? G. Hugh SONG
1999-10-14  4:00 ` Paul Bourke
1999-10-14  4:00 ` Christian Simmendinger
1999-10-14  4:00 ` Michal Jaegermann
1999-10-14  4:00 ` James Van Buskirk
1999-10-15  4:00   ` Stephen E. Halpin
1999-10-14  4:00 ` W. Kyle Gilbertson
1999-10-15  4:00 ` David A. Long
1999-10-19  4:00   ` Greg Lindahl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox