[Numpy-discussion] Numpy and MKL, update
David Cournapeau
cournape@gmail....
Thu Nov 13 22:11:07 CST 2008
On Fri, Nov 14, 2008 at 11:07 AM, Michael Abshoff
<michael.abshoff@googlemail.com> wrote:
> David Cournapeau wrote:
>> On Fri, Nov 14, 2008 at 5:23 AM, frank wang <f.yw@hotmail.com> wrote:
>>> Hi,
>
> Hi,
>
>>> Can you provide a working example to build Numpy with MKL in window and
>>> linux?
>>> The reason I am thinking to build the system is that I need to make the
>>> speed match with matlab.
>>
>> The MKL will only help you for linear algebra, and more specifically
>> for big matrices. If you build your own atlas, you can easily match
>> matlab speed in that area, I think.
>
> That is pretty much true in my experience for anything but Core2 Intel
> CPUs where GotoBLAS and the latest MKL have about a 25% advantage for
> large problems.
Note that I never said that ATLAS was faster than MKL/GotoBLAS :) I
said you could match matlab performances (which itself, up to 6.* at
least, used ATLAS; you could increase matlab performances by using
your own ATLAS BTW). I don't think 25 % matter that much, because if
it does, then you should not use python anyway in many cases (depends
on the kind of problems of course, but I don't think most scientific
problems reduce to just matrix product/inversion).
> The advantage of the MKL is that one library works more or less optimal
> on all platforms, i.e. with and without SSE2 for example since the
> "right" routines are selected at run time.
Agreed. As a numpy/scipy developer, I would actually be much more
interested in work into that direction for ATLAS than trying to get a
few % of peak speed. Deployment of ATLAS is really difficult ATM, and
it means that practically, we lose a lot of performances because for
distribution, you can't tune for every CPU out there, so we just use
safe defaults. Same for linux distributions. It is a shame that Apple
did not open source their Accelerate framework (based on ATLAS, at
least for the BLAS/LAPACK part), because that's exactly what they did.
David
More information about the Numpy-discussion
mailing list