Boost logo

Boost :

From: Toon Knapen (toon_at_[hidden])
Date: 2001-03-13 11:59:26

lums_at_[hidden] wrote:
> If you just go to netlib and download the reference BLAS
> implementation you will not get very good performance (I am thinking
> particularly of that grand-daddy of all linear algebra performance
> metrics, DGEMM). To get high levels of performance (some significant
> fraction of machine peak) requires careful hand structuring of the
> code to do things like tiling, cache blocking, software pipelining
> and the like. However, all of these things can be done in C++ as
> well -- and they can be done in a much nicer way -- and they can be
> made much more tunable -- and they can be done with template meta-
> programs. The bottom line being that at least with KCC (and in the
> future with other compilers), you can write a very concise but very
> high performance library. MTL (cf Jeremy's thesis) achieves
> performance better than Fortran -- and better than vendor libraries
> (some written in Fortran, some in C I think).
> Now, vendor-tuned libraries can give you good performance (which is
> where BLAS get their reputation). The problem with this is that a)
> the performance is not portable, b) you have to pay for them, c) they
> are highly optimized for only the subset of BLAS necessary to market
> their machines well, and d) the BLAS do not really cover everything
> that you would want to do in an efficient way.

I'm also definitly in favor of an C++ only approach. Nevertheless I
using in some cases BLAS internally would be necessary as a migration

Vendors have spend a lot of effort on optimising blas on their machines
and thus our library should be able to stand up against hand-crafter
machine code. And I agree that platform-independent optimisations can be
done in C++ but not all C++ compilers are there yet
(e.g. I can't afford at the moment not to use vendor tuned BLAS on NEC
because the C++ compiler needs to catch up and KAI is not available)
Thus I would only like to rely on BLAS for some operations which can be
done faster in BLAS during some kind of migration period (e.g. as I have
already reported to the mtl-ml, in my experience performance of atlas on
my linux box (2.92.2) is 6 times better compared to MTL)
But we indeed should not consider BLAS during the design of the
interfaces. BLAS should only be an occasional internal optimisation.

I've used/tried other C++ libraries but encountered some problems. As I
already mentioned Blitz++ is not suited for linear algebra Same goes for
Pooma and additionally the developers themselves say performance is not
as good as Blitz++. Pooma of course has a whole bunch of other great
features but they are OT here. MET has been born to improve linear
algebra suitability compared to Blitz++ but e.g. does not support sparse
matrices. MTL is great but the interface is not very intuitive, lacks
expression templates and, as jeremy already commented, is not activly
maintained currently. And finally LinAl's strategy is to be based on
fortran only (which is indeed what I want to avoid). I have the deepest
respect for all these libraries and their developers but I think there
is sufficient market opportunity for a boost library.

But maybe, as Andrew Lumsdaine pointer out, should we first decide if we
want to go in the direction of a linear algebra library or a general
multi-dim array lib.



Boost list run by bdawes at, gregod at, cpdaniel at, john at