[Numpy-discussion] Matrix dot product over an axis(for a 3d array/list of matrices)

Charles R Harris charlesr.harris@gmail....
Thu Jul 15 18:44:53 CDT 2010


On Thu, Jul 15, 2010 at 4:28 PM, David Warde-Farley <dwf@cs.toronto.edu>wrote:

> On 2010-07-15, at 4:31 PM, David Warde-Farley wrote:
>
> > If you need/want more speed than the solution Chuck proposed, you should
> check out Cython and Tokyo. Cython lets you write loops that execute at C
> speed, whereas Tokyo provides a Cython level wrapper for BLAS (no need to go
> through Python code to call NumPy). Tokyo was designed for exactly your use
> case: lots of matrix multiplies with relatively small matrices, where you
> start noticing the Python overhead.
>
> It occurred to me I neglected to provide a link (cursed iPhone):
>
>
> http://www.vetta.org/2009/09/tokyo-a-cython-blas-wrapper-for-fast-matrix-math/
>
>
For speed I'd go straight to c and avoid BLAS since the matrices are so
small. There might also be a cache advantage to copying the non-contiguous
columns of the rhs to the stack.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20100715/0ccbcf4f/attachment.html 


More information about the NumPy-Discussion mailing list