[Numpy-discussion] dot!=matrixmultiply bug when dotblas is present
Alexander Schmolck
a.schmolck at gmx.net
Fri Oct 1 11:34:01 EDT 2004
Fernando Perez <Fernando.Perez at colorado.edu> writes:
> Hi all,
>
> I found something today a bit unpleasant: if you install numeric without
> any BLAS support, 'matrixmultiply is dot==True', so they are fully
> interchangeable. However, to my surprise, if you build numeric with the blas
> optimizations, they are NOT identical.
Oops, my bad (I submitted the patch and while pretty much all the real coding
was done by Richard Everson this is my oversight).
> The reason is a bug in Numeric.py. After defining dot, the code reads:
>
> #This is obsolete, don't use in new code
> matrixmultiply = dot
On the other hand, it gently nudges people to no longer use the obsoleted
matrixmultiply ;)
> In [4]: timing 1,dot,a,b
> ------> timing(1,dot,a,b)
> Out[4]: 0.55591500000000005
>
> In [5]: timing 1,matrixmultiply,a,b
> ------> timing(1,matrixmultiply,a,b)
> Out[5]: 68.142640999999998
>
> In [6]: _/__
> Out[6]: 122.57744619231356
>
> Pretty significant difference...
Yup, someone should incorporate optional atlas dot support into numarray if it
hasn't happened already (won't be me, IIRC it took some convincing to get this
into Numeric and I won't be using numarray for anything real in the near
future).
cheers,
alex
More information about the NumPy-Discussion
mailing list