Math Kernel Library

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
Math Kernel Library
Developer(s)Intel
Initial releaseMay 9, 2003; 16 years ago (2003-05-09)
Stable release
2018 Update 1 / November 11, 2017[1]
Written inC/C++, Fortran
Operating systemMicrosoft Windows, Linux, macOS
PlatformIntel Xeon Phi, Intel Xeon, Intel Core, Intel Atom[2]
TypeLibrary and framework
LicenseFreeware[3]
Websitesoftware.intel.com/mkl

Intel Math Kernel Library (Intel MKL) is a library of optimized math routines for science, engineering, and financial applications. Core math functions include BLAS, LAPACK, ScaLAPACK, sparse solvers, fast Fourier transforms, and vector math.[4] The routines in MKL are hand-optimized specifically for Intel processors.[5][6]

The library supports Intel processors[2] and is available for Windows, Linux and macOS operating systems.[4][5][7]

History[edit]

Intel launched the Math Kernel Library on May 9, 2003, and called it blas.lib.[8] The project's development teams are located in Russia and the United States. MKL is bundled with Intel Parallel Studio XE, Intel Cluster Studio XE, Intel C++, Fortran Studio XE products as well as canopy. Standalone versions have not been sold for years to new customers but are now available for free.[9]

License[edit]

The library is available free of charge under the terms of Intel Simplified Software License[3] which allow redistribution.[9] Commercial support is available when purchased as a standalone software or as part of Intel Parallel Studio XE or Intel System Studio.

Performance[edit]

Intel MKL and other programs generated by the Intel C++ Compiler improve performance with a technique called function multi-versioning: a function is compiled or written for many of the x86 instruction set extensions, and at run-time a "master function" uses the CPUID instruction to select a version most appropriate for the current CPU. However, as long as the master function detects a non-Intel CPU, it almost always chooses the most basic (and slowest) function to use, regardless of what instruction sets the CPU claims to support. This has netted the system a nickname of "cripple AMD" routine since 2009.[10] As of 2019, Intels MKL, which remains the numeric library installed by default along with many pre-compiled mathematical applications on Windows (such as NumPy, SymPy, and MATLAB), still significantly underperforms on AMD CPUs by ignoring their supported instruction sets.[11] However, setting the environment variable MKL_DEBUG_CPU_TYPE=5 can be used to override the vendor string dependent codepath choice and activate AVX2 instructions on AMD processor based systems resulting in equal or even better performance when compared to Intel CPUs.[12][13]

Details[edit]

Functional categories[edit]

Intel MKL has the following functional categories:[14]

  • Linear algebra: BLAS routines are vector-vector (Level 1), matrix-vector (Level 2) and matrix matrix (Level 3) operations for real and complex single and double precision data. LAPACK consists of tuned LU, Cholesky and QR factorizations, eigenvalue and least squares solvers. MKL also includes Sparse BLAS, ScaLAPACK, Sparse Solver, Extended Eigensolver, PBLAS and BLACS.
    Since MKL uses standard interfaces for BLAS and LAPACK, the application which uses other implementations can get better performance on Intel and compatible processors by re-linking with MKL libraries.
  • MKL includes a variety of Fast Fourier Transforms (FFTs) from 1D to multidimensional, complex to complex, real to complex, and real to real transforms of arbitrary lengths. Applications written with the open source FFTW can be easily ported to MKL by linking with interface wrapper libraries provided as part of MKL for easy migration.
    Cluster versions of LAPACK and FFTs are also available as part of MKL to take advantage of MPI parallelism in addition to single node parallelism from multithreading.
  • Vector math functions include computationally intensive core mathematical operations for single and double precision real and complex data types. These are similar to libm functions from compiler libraries but operate on vectors rather than scalars to provide better performance. There are various controls for setting accuracy, error mode and denormalized number handling to customize the behavior of the routines.
  • Statistics functions include random number generators and probability distributions. optimized for multicore processors. Also included are compute-intensive in and out-of-core routines to compute basic statistics, estimation of dependencies etc.
  • Data fitting functions include splines (linear, quadratic, cubic, look-up, stepwise constant) for 1-dimensional interpolation that can be used in data analytics, geometric modeling and surface approximation applications.
  • Deep Neural Network
  • Partial Differential Equations
  • Nonlinear Optimization Problem Solvers

See also[edit]

References[edit]

  1. ^ "Intel Math Kernel Library 2018 Release Notes".
  2. ^ a b Intel® Math Kernel Library (Intel® MKL) | Intel® Software
  3. ^ a b "Intel Simplified Software License".
  4. ^ a b "Intel Math Kernel Library".
  5. ^ a b "Intel Math Kernel Library (MKL)".
  6. ^ "Webinar 3 – Practical usage of Intel Math Kernel Library: performance tuning tips and usage with coprocessors".
  7. ^ "MKL - Intel Math Kernel Library".
  8. ^ "Intel launches library tool for developers. (Intel Math Kernel Library 6.0) (Brief Article)". Telecomworldwire. May 9, 2003. Retrieved November 29, 2009.
  9. ^ a b "Intel Math Kernel Library Licensing FAQ".
  10. ^ "Agner`s CPU blog - Intel's "cripple AMD" function". www.agner.org.
  11. ^ "MKL has bad performance on an AMD cpu". Mingru Yang.
  12. ^ "r/matlab - How-To force Matlab to use a fast codepath on AMD Ryzen/TR CPUs - up to 250% performance gains". reddit. Retrieved 2019-11-27.
  13. ^ Sherbaz (2019-11-06), GitHub - SherbazHashmi/HackathonServer: Hackathon Python Server with ArcGIS Integration, retrieved 2019-11-27
  14. ^ admin (2019-11-14). "Developer Reference for Intel® Math Kernel Library - C". software.intel.com. Retrieved 2019-11-27.

External links[edit]