Files
Pedro Larroy 3a6fe22b66 Refine runtime feature discovery python API and add documentation to … (#14130)
* Refine runtime feature discovery python API and add documentation to Python API docs

* Fix lint

* Provide is_enabled method to check if feature is present from string

* Refine docs, add is_enabled

* Fix encoding

* Fix doc

* Address CR suggestions

* remove index as per CR suggestion

* Fix lint

* runtime

* Fix doc

* Add license
2019-02-18 11:29:47 -08:00

2.0 KiB

Run-Time Feature detection / Library info

.. currentmodule:: mxnet.runtime

Overview

The libinfo functionality allows to check for compile-time features supported by the library.

Example usage

In [1]: import mxnet as mx
   ...: import mxnet.runtime
   ...: fs = mx.runtime.Features()

In [2]: fs
Out[2]: [✖ 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 [3]: fs['CUDA'].enabled
Out[3]: False

In [4]: fs.is_enabled('CPU_SSE')
Out[4]: True

In [5]: fs.is_enabled('CUDA')
Out[5]: False

In [6]:
.. autosummary::
    :nosignatures:

    Features
    Feature
    feature_list

API Reference

<script type="text/javascript" src='../../../_static/js/auto_module_index.js'></script>
.. automodule:: mxnet.runtime
    :members:
<script>auto_index("api-reference");</script>