2022年5月16日星期一

NumPy 与 SciPy 关于 mkl, OpenBLAS 加速

pip 安装的 vs conda 安装的

根据 scikit-learn 的描述

pip 安装的 numpy, scipy 用的是  OpenBLAS。

conda 安装的是 mkl。conda-forge 提供的是 OpenBLAS。


根据 numpy 官方的描述( https://numpy.org/install/ ),conda-forge 里的 numpy 的 BLAS 版本是:

In the conda-forge channel, NumPy is built against a dummy “BLAS” package. When a user installs NumPy from conda-forge, that BLAS package then gets installed together with the actual library - this defaults to OpenBLAS, but it can also be MKL (from the defaults channel), or even BLIS or reference BLAS.


英特尔 vs AMD

英特尔CPU用 mkl 明显比不用 mkl 快,毕竟 mkl 是英特尔自家的产品。

据说 mkl 对 AMD CPU 有负优化,所以 AMD CPU 用 pip 安装的 numpy 比较快。


Windows 环境的另一个选择是到以下网址自行选择加速版本:

https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy



IPv6 的 fe80开头的地址

fe80开头的 ipv6 地址不是公网地址,没人给你分ip,自动协商的地址,通常无法用于上网。 现在各大运营商用的ipv6: 电信是240e开头的(240e::/20) 移动是2409开头的(2409:8000::/20) 联通是2408开头的(2408:8000::/20)