【问题标题】:Does Anaconda 4.0.2 already runs numpy on MKLAnaconda 4.0.2 是否已经在 MKL 上运行 numpy
【发布时间】:2016-09-10 12:20:26
【问题描述】:

我的系统中有 Ananconda4.0.2。我尝试在 python 控制台中通过以下命令找出我的 numpy 配置:

import numpy as np
np.__config__.show()

它返回以下输出

lapack_opt_info:
libraries = ['mkl_lapack95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'iomp5', 'pthread']
library_dirs = ['/home/<username>/anaconda2/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/home/<username>/anaconda2/include']
blas_opt_info:
libraries = ['mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'iomp5', 'pthread']
library_dirs = ['/home/<username>/anaconda2/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/home/<username>/anaconda2/include']
openblas_lapack_info:
NOT AVAILABLE
lapack_mkl_info:
libraries = ['mkl_lapack95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread','mkl_core', 'iomp5', 'pthread']
library_dirs = ['/home/<username>/anaconda2/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/home/<username>/anaconda2/include']
blas_mkl_info:
libraries = ['mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'iomp5', 'pthread']
library_dirs = ['/home/<username>/anaconda2/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/home/<username>/anaconda2/include']
mkl_info:
libraries = ['mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'iomp5', 'pthread']
library_dirs = ['/home/<username>/anaconda2/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/home/<username>/anaconda2/include']

这是否意味着我的 numpy 已经使用了 mkl?

【问题讨论】:

    标签: python numpy anaconda


    【解决方案1】:

    来自 numpy 1.15.0 OpenBLAS seems to be the default。我在 1.16.2 上,这成立:

    In [2]:np.__version__
    Out[2]: '1.16.2'
    
    In [3]: np.__config__.show()
    blas_mkl_info:
      NOT AVAILABLE
    blis_info:
        libraries = ['blas', 'cblas', 'lapack', 'blas', 'cblas', 'lapack']
        library_dirs = ['/home/tams00/anaconda3/envs/course2019/lib']
        define_macros = [('HAVE_CBLAS', None)]
        include_dirs = ['/home/tams00/anaconda3/envs/course2019/include']
        language = c
    blas_opt_info:
        libraries = ['blas', 'cblas', 'lapack', 'blas', 'cblas', 'lapack', 'blas', 'cblas', 'lapack']
        library_dirs = ['/home/tams00/anaconda3/envs/course2019/lib']
        define_macros = [('HAVE_CBLAS', None)]
        include_dirs = ['/home/tams00/anaconda3/envs/course2019/include']
        language = c
    lapack_mkl_info:
      NOT AVAILABLE
    openblas_lapack_info:
        libraries = ['blas', 'cblas', 'lapack', 'blas', 'cblas', 'lapack']
        library_dirs = ['/home/tams00/anaconda3/envs/course2019/lib']
        language = c
        define_macros = [('HAVE_CBLAS', None)]
    lapack_opt_info:
        libraries = ['blas', 'cblas', 'lapack', 'blas', 'cblas', 'lapack', 'blas', 'cblas', 'lapack']
        library_dirs = ['/home/tams00/anaconda3/envs/course2019/lib']
        language = c
        define_macros = [('HAVE_CBLAS', None)]
    

    【讨论】:

      【解决方案2】:

      是的,从 Anaconda 2.5 MKL support is the default 开始。

      要确定,请输入:

      conda search numpy
      

      你会看到类似的东西

      *  1.10.4                   py27_0  defaults        
         1.10.4             py27_nomkl_0  defaults        [nomkl]
      

      .  1.10.4                   py35_0  defaults        
         1.10.4             py35_nomkl_0  defaults        [nomkl]
      

      因此,没有 MKL 的版本被明确标记为 nomkl,而安装的版本(*.)包括 MKL。

      【讨论】:

      • 我正在尝试安装需要一些 BLAS 实现的 caffe。我想知道由于 Ananconda4.0.2 默认情况下为 numpy 和 scipy 提供 MKL 支持,我是否有可能只是将现有的 MKL 支持链接到 caffe 安装而不是安装 OpenBLAS,如此处提到的 github.com/tiangolo/caffe/blob/ubuntu-tutorial-b/docs/… 如果可能,请帮助我过程?谢谢
      • 好像。正如installation instructions 所说:Set BLAS := mkl in Makefile.config
      • 这是有用的信息,谢谢
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-06-02
      • 1970-01-01
      • 1970-01-01
      • 2014-10-01
      • 1970-01-01
      • 2014-10-29
      • 2010-09-07
      相关资源
      最近更新 更多