Intel MKL, now Intel oneMKL, supplies optimized BLAS and LAPACK routines for numerical and scientific computing. NumPy can use it beneath array operations and linear-algebra algorithms, including matrix multiplication and singular value decomposition. section 4.3.1
The linked BLAS/LAPACK implementation changes how NumPy uses CPU resources. MKL is threaded, so parallel workloads require care to avoid overcommitting CPU resources; a nonthreaded library instead leaves process-level parallelism more predictable. section 4.3.1
Use configuration inspection before tuning:
- Run np.show_config() to inspect the libraries and directories associated with the NumPy installation. section 4.3.1
- When configuration output is unclear, inspect package files and symbolic links; libcblas.so.3 pointing to libmkl_rt.so indicates MKL linkage. section 4.3.1
- Avoid the slow, nonthreaded NetLib implementation when performance matters; compare OpenBLAS and MKL for maximum system-specific performance. section 4.3.2
conda create -n book-mkl blas=*=mk conda activate book-mkl conda install numpy
Creates an isolated Anaconda environment with the MKL BLAS build and installs NumPy without changing the existing environment. section 4.3.2
Checking the active backend
Run np.show_config(), then verify the reported library paths rather than inferring the backend from an environment name. If necessary, inspect the installed shared-library links directly. section 4.3.1
