Run-Time Feature detection / Library info¶
Overview¶
The libinfo functionality allows to check for compile-time features supported by the library.
Example usage¶
In []: import mxnet as mx
...: import mxnet.runtime
...: fs = mx.runtime.Features()
In []: fs
Out[]: [✖ CUDA, ✖ CUDNN, ✖ NCCL, ✖ CUDA_RTC, ✖ TENSORRT, ✔ CPU_SSE, ✔ CPU_SSE2, ✔ CPU_SSE3, ✔ CPU_SSE4_1, ✔ CPU_SSE4_2, ✖ CPU_SSE4A, ✔ CPU_AVX, ✖ CPU_AVX2, ✖ OPENMP, ✖ SSE, ✔ F16C, ✖ JEMALLOC, ✔ BLAS_OPEN, ✖ BLAS_ATLAS, ✖ BLAS_MKL, ✖ BLAS_APPLE, ✔ LAPACK, ✖ MKLDNN, ✔ OPENCV, ✖ CAFFE, ✖ PROFILER, ✖ DIST_KVSTORE, ✖ CXX14, ✔ SIGNAL_HANDLER, ✔ DEBUG]
In []: fs.keys()
Out[]: odict_keys(['CUDA', 'CUDNN', 'NCCL', 'CUDA_RTC', 'TENSORRT', 'CPU_SSE', 'CPU_SSE2', 'CPU_SSE3', 'CPU_SSE4_1', 'CPU_SSE4_2', 'CPU_SSE4A', 'CPU_AVX', 'CPU_AVX2', 'OPENMP', 'SSE', 'F16C', 'JEMALLOC', 'BLAS_OPEN', 'BLAS_ATLAS', 'BLAS_MKL', 'BLAS_APPLE', 'LAPACK', 'MKLDNN', 'OPENCV', 'CAFFE', 'PROFILER', 'DIST_KVSTORE', 'CXX14', 'SIGNAL_HANDLER', 'DEBUG'])
In []: type(fs['CUDA'])
Out[]: mxnet.runtime.Feature
In []: fs['CUDA'].enabled
Out[]: False
In []: fs.is_enabled('CPU_SSE')
Out[]: True
In []: fs.is_enabled('CUDA')
Out[]: False
In []: features = mx.runtime.feature_list()
In []: features
Out[]:
[✖ CUDA,
✖ CUDNN,
✖ NCCL,
✖ CUDA_RTC,
✖ TENSORRT,
✔ CPU_SSE,
✔ CPU_SSE2,
✔ CPU_SSE3,
✔ CPU_SSE4_1,
✔ CPU_SSE4_2,
✖ CPU_SSE4A,
✔ CPU_AVX,
✖ CPU_AVX2,
✖ OPENMP,
✖ SSE,
✔ F16C,
✖ JEMALLOC,
✔ BLAS_OPEN,
✖ BLAS_ATLAS,
✖ BLAS_MKL,
✖ BLAS_APPLE,
✔ LAPACK,
✖ MKLDNN,
✔ OPENCV,
✖ CAFFE,
✖ PROFILER,
✖ DIST_KVSTORE,
✖ CXX14,
✔ SIGNAL_HANDLER,
✔ DEBUG]
In []: type(features)
Out[]: list
In []: type(features[0])
Out[]: mxnet.runtime.Feature
API Reference¶
runtime querying of compile time features in the native library
-
class
mxnet.runtime.
Feature
[source]¶ Compile time feature description, member fields: name and enabled.
-
name
¶ Feature name.
-
enabled
¶ True if MXNet was compiled with the given compile-time feature.
-
-
mxnet.runtime.
feature_list
()[source]¶ Check the library for compile-time features. The list of features are maintained in libinfo.h and libinfo.cc
Returns: List of Feature
objectsReturn type: list