OpenVINO Execution Provider

April 29, 2020 · View on GitHub

OpenVINO Execution Provider enables deep learning inference on Intel CPUs, Intel integrated GPUs and Intel® MovidiusTM Vision Processing Units (VPUs). Please refer to this page for details on the Intel hardware supported.

Build

For build instructions, please see the BUILD page.

Onnxruntime Graph Optimization level

OpenVINO backend performs both hardware dependent as well as independent optimizations to the graph to infer it with on the target hardware with best possible performance. In most of the cases it has been observed that passing in the graph from the input model as is would lead to best possible optimizations by OpenVINO. For this reason, it is advised to turn off high level optimizations performed by ONNX Runtime before handing the graph over to OpenVINO backend. This can be done using Session options as shown below:-

  1. Python API
options = onnxruntime.SessionOptions()
options.graph_optimization_level = onnxruntime.GraphOptimizationLevel.ORT_DISABLE_ALL
sess = onnxruntime.InferenceSession(<path_to_model_file>, options)
  1. C++ API
SessionOptions::SetGraphOptimizationLevel(ORT_DISABLE_ALL);

Dynamic device selection

When ONNX Runtime is built with OpenVINO Execution Provider, a target hardware option needs to be provided. This build time option becomes the default target harware the EP schedules inference on. However, this target may be overriden at runtime to schedule inference on a different hardware as shown below.

Note. This dynamic hardware selection is optional. The EP falls back to the build-time default selection if no dynamic hardware option value is specified.

  1. Python API
import onnxruntime
onnxruntime.capi._pybind_state.set_openvino_device("<harware_option>")
# Create session after this
  1. C/C++ API
Ort::ThrowOnError(OrtSessionOptionsAppendExecutionProvider_OpenVINO(sf, "<hardware_option>"));

ONNX Layers supported using OpenVINO

The table below shows the ONNX layers supported and validated using OpenVINO Execution Provider.The below table also lists the Intel hardware support for each of the layers. CPU refers to Intel® Atom, Core, and Xeon processors. GPU refers to the Intel Integrated Graphics. VPU refers to USB based Intel® MovidiusTM VPUs as well as Intel® Vision accelerator Design with Intel Movidius TM MyriadX VPU.

ONNX LayersCPUGPUVPU
AddYesYesYes
ArgMaxYesYesYes
AveragePoolYesYesYes
BatchNormalizationYesYesYes
CastYesYesYes
ClipYesYesYes
ConcatYesYesYes
ConstantYesYesYes
ConvYesYesYes
ConvTransposeYesYesYes
DivYesYesYes
DropoutYesYesYes
FlattenYesYesYes
FloorYesYesYes
GatherYesYesYes
GatherNDYesYesYes
GemmYesYesYes
GlobalAveragePoolYesYesYes
IdentityYesYesYes
LeakyReluYesYesYes
LogYesYesYes
LRNYesYesYes
LSTMYesYesYes
MatMulYesYesYes
MaxYesYesYes
MaxPoolYesYesYes
MinYesYesYes
MulYesYesYes
PadYesYesYes
PowYesYesYes
PReluYesYesYes
ReduceMaxYesYesYes
ReduceMeanYesYesYes
ReduceMinYesYesYes
ReduceSumYesYesYes
ReluYesYesYes
ReshapeYesYesYes
SigmoidYesYesYes
SliceYesYesYes
SoftmaxYesYesYes
SqueezeYesYesYes
SubYesYesYes
SumYesYesYes
TanhYesYesYes
TopKYesYesYes
TransposeYesYesYes
UnsqueezeYesYesYes

Topology Support

Below topologies from ONNX open model zoo are fully supported on OpenVINO Execution Provider and many more are supported through sub-graph partitioning

Image Classification Networks

MODEL NAMECPUGPUVPUFPGA
bvlc_alexnetYesYesYesYes*
bvlc_googlenetYesYesYesYes*
bvlc_reference_caffenetYesYesYesYes*
bvlc_reference_rcnn_ilsvrc13YesYesYesYes*
emotion ferplusYesYesYesYes*
densenet121YesYesYesYes*
inception_v1YesYesYesYes*
inception_v2YesYesYesYes*
mobilenetv2YesYesYesYes*
resnet18v1YesYesYesYes*
resnet34v1YesYesYesYes*
resnet101v1YesYesYesYes*
resnet152v1YesYesYesYes*
resnet18v2YesYesYesYes*
resnet34v2YesYesYesYes*
resnet101v2YesYesYesYes*
resnet152v2YesYesYesYes*
resnet50YesYesYesYes*
resnet50v2YesYesYesYes*
shufflenetYesYesYesYes*
squeezenet1.1YesYesYesYes*
vgg19YesYesYesYes*
vgg16YesYesYesYes*
zfnet512YesYesYesYes*
arcfaceYesYesYesYes*

Image Recognition Networks

MODEL NAMECPUGPUVPUFPGA
mnistYesYesYesYes*

Object Detection Networks

MODEL NAMECPUGPUVPUFPGA
tiny_yolov2YesYesYesYes*

*FPGA only runs in HETERO mode wherein the layers that are not supported on FPGA fall back to OpenVINO CPU.