Intel® oneAPI Math Kernel Library

2025.3.1 · active · verified Sun Apr 12

Intel® oneAPI Math Kernel Library (oneMKL) is a highly optimized, extensively threaded, and vectorized numerical library for mathematical functions. It provides a wide range of routines for linear algebra (BLAS, LAPACK, ScaLAPACK), fast Fourier transforms (FFT), vector math, and more. When used with Python libraries like NumPy and SciPy, it significantly accelerates numerical computations by providing highly optimized CPU-specific implementations. The `mkl` PyPI package, version 2025.3.1, typically provides the runtime components required for other Python packages to link against and utilize MKL, with updates usually following major oneAPI releases.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to install the MKL runtime and verify that it is being used by common numerical libraries like NumPy. It checks the MKL Python package version, detailed MKL service info, and then inspects NumPy's configuration to confirm MKL linkage before performing a basic benchmark.

import mkl
import numpy as np

print("MKL Python package version:", mkl.get_version())
print("\nMKL Service info:")
print(mkl.service.get_mkl_info())

# Verify if NumPy is using MKL
print("\nNumPy configuration (look for 'mkl' or 'blas_mkl'):")
np.__config__.show()

# Perform a simple matrix multiplication which should be accelerated by MKL
a = np.random.rand(1000, 1000)
b = np.random.rand(1000, 1000)
print("\nPerforming a matrix multiplication (1000x1000) with NumPy...")
_ = a @ b
print("Operation complete. Check NumPy config above to see MKL linkage.")

view raw JSON →