[Numpy-discussion] BLAS and innerproduct

R.M.Everson R.M.Everson at exeter.ac.uk
Tue Nov 13 13:53:01 EST 2001


Hello,

So far as I can tell Numeric.dot(), which uses innerproduct() from
multiarraymodule.c doesn't call the BLAS, even if Numeric was compiled
against native BLAS.   This means (at least on my machine) that 

X = ones((150, 16384), 'd')
C = dot(X, tranpose(X))

is about 15 times as slow as the comparable operations in Matlab (v6),
which does, I think, use the native BLAS.

I guess that multiarray.c is not particularly optimised to use the
BLAS because of the difficulties of coping with all sorts of types
(float32, int64 etc), and with non-contiguous arrays.  The
innerproduct is so basic to most of the work I use Numeric for that a
speed up here would make a big difference.  I'm thinking of patching
multiarray.c to use the BLAS when it can, but before I start are there
good reasons for doing something different?

Any advice gratefully received!

Cheers,

Richard.


-- 
Department of Computer Science, Exeter University    Voice: +44 1392 264065
R.M.Everson at exeter.ac.uk                         Secretary: +44 1392 264061
http://www.dcs.ex.ac.uk/people/reverson                Fax: +44 1392 264067





More information about the NumPy-Discussion mailing list