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, ✖ 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, ✖ DIST_KVSTORE, ✖ CXX14, ✖ INT64_TENSOR_SIZE,
✔ SIGNAL_HANDLER, ✔ DEBUG, ✖ TVM_OP]

Classes

Feature

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

Features

OrderedDict of name to Feature

Functions

feature_list()

Check the library for compile-time features.

class mxnet.runtime.Feature[source]

Bases: _ctypes.Structure

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

Attributes

enabled

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

name

Feature name.

property enabled

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

property name

Feature name.

class mxnet.runtime.Features[source]

Bases: collections.OrderedDict

OrderedDict of name to Feature

Methods

is_enabled(feature_name)

Check for a particular feature by name

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