不确定我的Python / numpy版本是否使用优化的BLAS / LAPACK库?

问题描述 投票:1回答:1

我读here认为“确保numpy在您的系统上使用优化版BLAS / LAPACK库”非常重要。

当我输入:

import numpy as np
np.__config__.show()

我得到以下结果:

blas_mkl_info:
  NOT AVAILABLE
blis_info:
  NOT AVAILABLE
openblas_info:
    libraries = ['openblas', 'openblas']
    library_dirs = ['/home/anaconda3/lib']
    language = c
    define_macros = [('HAVE_CBLAS', None)]
blas_opt_info:
    libraries = ['openblas', 'openblas']
    library_dirs = ['/home/anaconda3/lib']
    language = c
    define_macros = [('HAVE_CBLAS', None)]
lapack_mkl_info:
  NOT AVAILABLE
openblas_lapack_info:
    libraries = ['openblas', 'openblas']
    library_dirs = ['/home/anaconda3/lib']
    language = c
    define_macros = [('HAVE_CBLAS', None)]
lapack_opt_info:
    libraries = ['openblas', 'openblas']
    library_dirs = ['/home/anaconda3/lib']
    language = c
    define_macros = [('HAVE_CBLAS', None)]

这是否意味着我的numpy版本使用优化的BLAS / LAPACK库,如果没有,我如何设置numpy以便它确实使用优化版本?

python numpy anaconda lapack blas
1个回答
2
投票

的种类。 OpenBLAS非常好。我只是拿了第一个链接,我可以在google上找到“OpenBLAS,ATLAS,MKL比较”。

http://markus-beuckelmann.de/blog/boosting-numpy-blas.html

现在,这不是全部。根据您需要的算法,差异可能不会/略有差异。除了运行与不同实现链接的自己的代码之外,真的没什么可做的。

我最喜欢的各种线性代数问题,SVD,Eigs,实数和伪反转,因子...不同操作系统上的单核/多核:

MacOS:加速框架(随操作系统一起提供)Linux / Windows:

  1. MKL
  2. 距离很远,但仍然很安静:ATLAS和OpenBLAS相提并论
  3. 即使在AMD处理器上,ACML也一直令我失望

TLDR:你的设置很好。但是如果你想从CPU / RAM /主板组合中挤出最后一滴血,你需要MKL。它当然有相当的价格标签,但如果你能得到一半的硬件作为回报,也许值得。如果您编写开源软件包,可以免费使用MKL进行开发。

© www.soinside.com 2019 - 2024. All rights reserved.