Subject: Re: BLAS recommendations

From: <[email-masked]>
Date: 05 Jan 2000 17:19:20 -0500

From: Camm Maguire <[email-masked]>

Emil Briggs <[email-masked]> writes:

> 3. For the Level 3 BLAS the ATLAS package is a good solution under
>    Linux. R. Clint Whaley and Antoine Petitet have released version
>    3.0BETA of ATLAS which also has some support for generating
>    optimized Level 1 and Level 2 BLAS libs. (You can grab it 
>    at http://www.netlib.org/atlas/)
> 

Thanks for the tip about 3.0 beta.  It looks good!  It is my intention
to ship this version with the upcoming Debian release. 

>    The license seems fairly liberal even though it's not GPL. I havn't
>    benchmarked the new release yet but from looking at the source 
>    I suspect that the Level1 and Level2 performance is not particularly 
>    good yet. The problem is that ATLAS uses GCC which does not take 
>    advantage of the new prefetch instructions supported by the PIII 
>    and the Athlon.  For the Level1 and Level2 BLAS libs the use of 
>    these instructions is very important in order to hide main-memory latency.
> 

Preliminary results on our PII 350 machines indicate a speedup (over
the reference blas) of 2.5-4x on the level2 routines.  While this is
significantly below the level3 performance, it is, IMHO, still quite
good, and handily outperforms my own hand-tuned gcc level2 code (which
also outperformed the netlib reference implementation).  In fact,
using this lib shaves a nice 30% off the running time of our
production code when executed on a single machine.  (Of course, to see
significant benefits on a cluster, the array sizes have to be quite
large when using level2, larger than we use in production currently.)

What's even better is the mechanism they've provided for supplying
your own level2 primatives, in case you know quite a bit about your
hardware, to time against all the others and incorporate into the
library if they prove faster.  In principle, you could quite simply
supply an assemly routine using 'prefetch', and insert it into ATLAS.
So my question is: do PII CPU's understand the 'prefetch' instruction?
What type of performance gains do you expect when employing this
instruction?  Any suggestions as to other non-gcc invoked assembler
calls which could make a big difference?

> The stuff I wrote was assembly language versions of the Level1 BLAS
> for the Athlon which use the new prefetch instructions. They're GPL
> and could probably be adapted for the PIII fairly easily. (I don't
> have a PIII so I havn't done this). You can get these at
> 
>   http://nemo.physics.ncsu.edu/~briggs/blas_src_v0.11_tar.gz
> 
> Presumably at some point in the future GCC will be able to generate
> better code that uses the new instructions and the assembly language 
> won't be necessary but for now thats not the case.
> 

Thanks for these examples!  Can they be adapted to the PII as well?

> For recommendations I would say that ATLAS is a great choice for the
> Level3 stuff. If you've got an Athlon then my libs are OK
> for the Level1. No recommendations for Level2 (Our codes don't
> require much Level2 stuff so it hasn't been a high priority for me).
> 
> 
> Regards
> Emil
>  
> -------------------------------------------------------------------
> To unsubscribe send a message body containing "unsubscribe"
> to [email-masked]

Take care,

-- 
Camm Maguire			     			[email-masked]
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah
-------------------------------------------------------------------
To unsubscribe send a message body containing "unsubscribe"
to [email-masked]