[Numpy-discussion] making numpy.dot faster
Pauli Virtanen
pav at iki.fi
Fri Oct 3 17:11:58 EDT 2008
Fri, 03 Oct 2008 18:59:02 +0200, Gael Varoquaux wrote:
> I am doing a calculation where one call numpy.dot ends up taking 90% of
> the time (the array is huge: (61373, 500) ).
>
> Any chance I can make this faster? I would believe BLAS/ATLAS would be
> behind this, but from my quick analysis (ldd on
> numpy/core/multiarray.so) it doesn't seem so. Have I done something
> stupid when building numpy (disclaimer: I am on a system I don't know
> well --Mandriva--, so I could very well have done something stupid).
AFAIK, multiarray.so is never linked against ATLAS. The accelerated dot
implementation is in _dotblas.so, and can be toggled with alterdot/
restoredot (but the ATLAS one should be active by default).
>>> numpy.dot.__module__
'numpy.core._dotblas'
Are your arrays appropriately contiguous? Numpy needs to copy the data if
they are not; though I'm not sure if this could account for what you see.
--
Pauli Virtanen
More information about the NumPy-Discussion
mailing list