mxnet.runtime

Runtime querying of compile time features in the native library.

With this module you can check at runtime which libraries and features were compiled in the library.

Example usage:

>>> import mxnet
>>> features = mxnet.runtime.Features()
>>> features.is_enabled("CUDNN")
False
>>> features.is_enabled("CPU_SSE")
True
>>> print(features)
[✖ CUDA, ✖ CUDNN, ✖ NCCL, ✖ 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,
✖ ONEDNN, ✔ OPENCV, ✖ DIST_KVSTORE, ✖ INT64_TENSOR_SIZE, ✔ SIGNAL_HANDLER, ✔ DEBUG, ✖ TVM_OP]

Functions

feature_list()

Check the library for compile-time features.

get_branch()

get_commit_hash()

Classes

Feature

Compile time feature description, member fields: name and enabled.

Features()

OrderedDict of name to Feature

class mxnet.runtime.Feature[source]

Bases: Structure

Compile time feature description, member fields: name and enabled.

property enabled

True if MXNet was compiled with the given compile-time feature.

property name

Feature name.

class mxnet.runtime.Features[source]

Bases: OrderedDict

OrderedDict of name to Feature

is_enabled(feature_name)[source]

Check for a particular feature by name

Parameters:

feature_name (str) – The name of a valid feature as string for example ‘CUDA’

Returns:

True if it’s enabled, False if it’s disabled, RuntimeError if the feature is not known

Return type:

Boolean

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 objects

Return type:

list