[Numpy-discussion] Performance degradation when installing Numpy and Python not from packaging system?

Pauli Virtanen pav at iki.fi
Wed May 8 14:13:27 EDT 2013


Hi,

08.05.2013 20:47, Bin Huang kirjoitti:
[clip]
> In order to compare performance, I wrote a piece of code that simply
> performs matrix-matrix multiplication using one of Numpy's functions.
> The source code is listed as follows:
[clip]

Your benchmark essentially measures the speed of the BLAS library Numpy
is linked with. It appears that the one supplied by the system is linked
with a high-performance BLAS, whereas the one you compiled yourself is not.

You should look at the output of the build command, and look for lines
such as

-------8<-------------
lapack_opt_info:
lapack_mkl_info:
mkl_info:
  libraries mkl,vml,guide not found in ['/usr/local/lib', '/usr/lib',
'/usr/lib/x86_64-linux-gnu']
  NOT AVAILABLE

  NOT AVAILABLE

atlas_threads_info:
Setting PTATLAS=ATLAS
  libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
  libraries lapack_atlas not found in /usr/local/lib
<class 'numpy.distutils.system_info.atlas_threads_info'>
Setting PTATLAS=ATLAS
Setting PTATLAS=ATLAS
  FOUND:
    language = f77
    include_dirs = ['/usr/include/atlas']
    library_dirs = ['/usr/lib/atlas-base/atlas', '/usr/lib/atlas-base']
    libraries = ['lapack', 'ptf77blas', 'ptcblas', 'atlas']
    define_macros = [('ATLAS_INFO', '"\\"3.8.4\\""')]

  FOUND:
    language = f77
    include_dirs = ['/usr/include/atlas']
    library_dirs = ['/usr/lib/atlas-base/atlas', '/usr/lib/atlas-base']
    libraries = ['lapack', 'ptf77blas', 'ptcblas', 'atlas']
    define_macros = [('ATLAS_INFO', '"\\"3.8.4\\""')]
-------8<-------------

If it says "NOT AVAILABLE" to all the cases, then it does not find a
good BLAS/LAPACK library, and uses one that is not optimized for
specific processors.

See here on how to tell it to use a specific BLAS/LAPACK combination:
http://new.scipy.org/scipylib/building/linux.html#generic-instructions

-- 
Pauli Virtanen




More information about the NumPy-Discussion mailing list