[Numpy-discussion] NumPy EIG much slower than MATLAB EIG

Paul Anton Letnes paul.anton.letnes@gmail....
Mon Apr 9 01:36:08 CDT 2012



On 2. apr. 2012, at 15:47, David Cournapeau wrote:

> 
> 
> On Sun, Apr 1, 2012 at 2:28 PM, Kamesh Krishnamurthy <kameshkk@gmail.com> wrote:
> Hello all,
> 
> I profiled NumPy EIG and MATLAB EIG on the same Macbook pro, and both were linking to the Accelerate framework BLAS. NumPy turns out to be ~4x slower. I've posted details on Stackoverflow:
> http://stackoverflow.com/q/9955021/974568
> 
> Can someone please let me know the reason for the performance gap?
> 
> I would look at two things:
> 
>    - first, are you sure matlab is not using the MKL instead of accelerate framework ? I have not used matlab in ages, but you should be able to check by using otool -L to some of the core dll of matlab, to find out which libraries are linked to it
>    - second, it could be that matlab eig and numpy eig don't use the same underlying lapack API (do they give you the same result ?). This would already be a bit harder to check, unless it is documented explicitly in matlab.
> 
> regards,
> 
> David 
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion


Without commenting on the timing issues, I see that in the folder
/Applications/MATLAB_R2011b.app/bin/maci64
there are files with mkl in their names:
mkl.dylib
mklcompat.dylib

I'm guessing that Matlab always uses MKL.

Paul


More information about the NumPy-Discussion mailing list