[Numpy-discussion] array.sum() slower than expected along some array axes?
Sebastian Haase
haase@msg.ucsf....
Sun Feb 4 13:37:49 CST 2007
On 2/3/07, Robert Kern <robert.kern@gmail.com> wrote:
> Stephen Simmons wrote:
>
> > The question though is whether all of the inner loop's overhead is
> > necessary.
> > My counterexample using numpy.dot() suggests there's considerable scope
> > for improvement, at least for certain common cases.
>
> Well, yes. You most likely have an ATLAS-accelerated dot(). The ATLAS put a lot
> of work into making matrix products really fast. However, they did so at a cost:
> different architectures use different code. That's not really something we can
> do in the core of numpy without making numpy as difficult to build as ATLAS is.
>
Maybe this argument could be inverted:
maybe numpy could check if ATLAS is installed and automatically switch to the
numpy.dot(numpy.ones(a.shape[0], a.dtype), a)
variant that Stephen suggested.
Of course -- as I see it -- the numpy.ones(...) part requires lots of
extra memory. Maybe there are other downsides ... !?
-Sebastian
More information about the Numpy-discussion
mailing list