sriramn
sriramn

Reputation: 2378

numpy MKL vs Standard - What are the requirements?

I typically get the latest scientific Python packages from here. I noticed that there are two version of numpy made available - standard and MKL versions. My questions:

  1. How much of performance improvements do we actually get from switching to the MKL version? Does anyone have benchmarks after testing it on real datasets and problems?
  2. Do we need to have proprietary libraries from Intel to run the MKL version? I ask this because on installing the MKL version from the above link numpy seems to work just fine - also I did not see any performance improvement. This made me curious and I ran this command np.__config__.show() based on the answer here and it gives me the following:

    lapack_opt_info:
    libraries = ['mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd', 'mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd']
    library_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64']
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/include']
    blas_opt_info:
    libraries = ['mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd']
    library_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64']
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/include']
    openblas_lapack_info:
    NOT AVAILABLE
    lapack_mkl_info:
    libraries = ['mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd', 'mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd']
    library_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64']
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/include']
    blas_mkl_info:
    libraries = ['mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd']
    library_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64']
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/include']
    mkl_info:
    libraries = ['mkl_lapack95_lp64', 'mkl_blas95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'libiomp5md', 'libifportmd']
    library_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/lib/intel64']
    define_macros = [('SCIPY_MKL_H', None)]
    include_dirs = ['C:/Program Files (x86)/Intel/Composer XE/mkl/include']
    

So I tried browsing to the directory C:/Program Files (x86)/Intel/Composer XE/mkl/include to see if anything was there - but I do not have those libraries installed. So ideally it should not work right because the files are missing?

Upvotes: 1

Views: 2896

Answers (1)

sebastian
sebastian

Reputation: 9696

To 1:

The main reason many people are using Gohlke's MKL based libraries - afaik - is, that there's no free 64bit fortran compiler for windows out there. So using MKL is not primarily based on performance reasons. Check e.g. the comments on this answer: https://stackoverflow.com/a/11200146/2319400

To 2:

No you don't need them. As Christoph Gohlke's site tells you:

Numpy+MKL is linked statically to the Intel® Math Kernel Library. Numpy+MKL includes the runtime libraries for Intel C++ and Fortran in the numpy.core directory.

So, he needs those libraries during compilation - you don't need them. That's the point of "static" linking: all functionality from the linked libraries is contained in the the numpy libraries after the compilation process.

Upvotes: 3

Related Questions