OpenVINO™ is an open-source toolkit for optimizing and deploying AI inference
Go to file
Gladilov, Gleb 1601c7fdbd
[IE][VPU]: Enables Extract Dynamic Batch Transformation (#3715)
* [IE][nGraph]: Enables begin/end iterators for PartialShape

It's convenient to be able to use STL algorithms on
PartialShape since semantically PartialShape is a
sequence of Dimensions.

* [IE][VPU][nGraph]: Introduces tree utilities

Introduces Depth-First-Search and Breadth-First-Search
utilities for tree traversal. Templated arguments
makes them extensible for different use-case scenarios.

BFS is designed in way to make it possible to guarantee
node will be visited only after all its predecessors
have been visited:

       a
      / \
     b   c
     |   |
     d   |
     \  /
       e

There with accordingly provided functors (NumEntries) it's
guaranteed node "e" will be visited after "d" and "c".
Such a property is important for nodes depth evaluation.

* [IE][VPU][nGraph]: Fixes printTo for nGraph type

For some reason if printTo for nGraph type is
usual function it's not picked up by VPU_THROW_UNLESS
triggered inside DynamicToStaticShape transformations.

Making it template specialization does the job.

* [IE][VPU]: Introduces SliceConfiguration class

SliceConfiguration is a class that's intended
to express the result of operation slicing by
batch. The result of slicing is configuration
that specifies what to do with each data object
associated with operation. There are two options
defined: Slice and Unchanged. Typical slice
scenario is Slice, when operation has the same
batch for all inputs and outputs, so all
corresponding data object will be "sliced"
(replaced with copy where batch equal to 1).

At some cases, data object should not sliced
(ex. if operation has constant input which
is the same for all input data batches and
so, does not have batch - Add of 2 tensors
with shapes [10, 1000] and [1000]). To
represent such cases there is option
"Unchanged".

At cases when operation should not be sliced
at all (ex. does not have batch, have different
batch for inputs and outputs, has static
batch and so on) SliceConfiguration object will
return false for "hasSlice" method call. In
these cases inputs and outputs methods calls
will throw an exception.

* [IE][VPU][nGraph]: Enables MatMul operation slice

In case of static batch, operation is not going to be sliced,
since for handling such cases other transformation is used.
Such approach allows both passes to co-exist while one is
being replaced with another.

If data input has other dynamic dimension than batch error
will be thrown since Myriad-X plugin does not support
convolutions (HW accelerated operations) with dynamism in
spatial dimensions.

* [IE][VPU][nGraph]: Enables Convolution operations slice

In case of static batch, operation is not going to be sliced,
since for handling such cases other transformation is used.
Such approach allows both passes to co-exist while one is
being replaced with another.

If data input has other dynamic dimension than batch error
will be thrown since Myriad-X plugin does not support
convolutions (HW accelerated operations) with dynamism in
spatial dimensions.

* [IE][VPU][nGraph]: Enables unary eltwise slice

Since extract dynamic batch transformation will handle
dynamism only by batch (so requires body loop to be static)
operations with dynamism in dimension other than batch should
not be covered by loop.

In case of dynamism in dimension other than batch eltwise
will be considered unsupported for sub-graph extraction.

* [IE][VPU][nGraph]: Enables binary eltwise slice

Since extract dynamic batch transformation will handle
dynamism only by batch (so requires body loop to be static)
operations with dynamism in dimension other than batch should
not be covered by loop.

In case of dynamism in dimension other than batch eltwise
will be considered unsupported for sub-graph extraction.

It's template function since different binary eltwise
operations have the same broadcasting rules.

* [IE][VPU][nGraph]: Enables extract dynamic batch transformation

General approach is following:

1. Extracted sub-graphs should have exactly one input and output
   operation. Otherwise, it's possible that memory consumption of
   model will be increased since loops implementation on Myriad-X
   requires to keep all inputs and outputs of loop to be alive
   along with memory used by loop body. In layout consolidation
   scenario it reflects intention to use minimized amount of
   permutations.

2. Extracted sub-graph should not have external connections (
   the only nodes that allowed to have predecessor or successor
   outside of sub-graph are input and output). Otherwise, it's
   possible that memory consumption of model will be increased
   for the same reason as in previous point.

   To make sure this restriction is met transformation looks
   for leaves in both directions, finds corresponding LCA
   (Lowest Common Ancestor) and checks if such sub-graph has
   external connections. If so, it repeats leaves search
   procedure stopping if it approaches leaves from previous
   iteration and finds LCA again. It is repeated until
   sub-graph without external connections is found (it exists,
   at least source itself forms it).

   Leaf in current context is a node which satisfies one of
   the following conditions (depending on direction):
     Top:
       1. It has no predecessors which are neither Parameter,
          nor Constant
       2. It's unknown how to slice this operation
       3. It could not be sliced (different batch for inputs and
          outputs)
     Bottom:
       1. It has no successors which are not Result
       2. It's unknown how to slice this operation
       3. It could not be sliced (different batch for inputs and
          outputs)

Signed-off-by: Gladilov, Gleb <gleb.gladilov@intel.com>
2021-01-13 13:42:53 +03:00
.ci OpenVino ONNX CI update (#3750) 2020-12-28 11:03:38 +03:00
.github Remove Java bindings (#3216) 2020-11-19 13:59:20 +03:00
cmake [cmake] Fix single config generators handling (#3794) 2021-01-11 18:38:11 +03:00
docs Added AddV2, FusedBatchNormV2 and FusedBatchNormV3 to the list of supported TF operations (#3829) 2021-01-13 13:26:42 +03:00
inference-engine [IE][VPU]: Enables Extract Dynamic Batch Transformation (#3715) 2021-01-13 13:42:53 +03:00
licensing added third party programs files (#2751) 2020-10-23 18:03:01 +03:00
model-optimizer [MO] Implement support of TensorFlow 2 Keras Embedding operation in MO (#3766) 2021-01-10 22:05:58 +03:00
ngraph [IE][VPU]: Enables Extract Dynamic Batch Transformation (#3715) 2021-01-13 13:42:53 +03:00
openvino Added CC macros to validate, clone and visit (#3730) 2020-12-25 17:20:48 +03:00
scripts Align location to OMZ demos (#3754) 2021-01-12 17:17:47 +03:00
tests Enabled CMP0025 as NEW (#3791) 2021-01-11 14:48:27 +03:00
tools Adding MYRIAD_THROUGHPUT_STREAMS support (#3723) 2020-12-29 19:02:57 +03:00
.gitattributes Doc Migration (master) (#1377) 2020-07-20 17:36:08 +03:00
.gitignore publish master branch snapshot, revision 8d31237e2c3f673cbb0f0ba110fc10f5cce1d2bb 2020-05-22 02:23:12 +03:00
.gitmodules add submodules for mkl-dnn, gflags and gtest 2020-05-21 23:00:55 +03:00
CMakeLists.txt Partially removed ngraph cmake duplication with IE cmake (#3751) 2021-01-11 14:49:33 +03:00
CODEOWNERS Added code owners for scripts folder (#2130) 2020-09-08 17:23:27 +03:00
install_build_dependencies.sh [install_dependencies.sh] install latest cmake if current version is lower 3.13 (#2695) 2020-10-16 21:03:46 +03:00
Jenkinsfile [Jenkinsfile] Disable failFast & enable propagateStatus (#3503) 2020-12-10 12:05:03 +03:00
LICENSE Publishing R3 2018-10-16 13:45:03 +03:00
README.md [README.md] change latest release to 2021.2 (#3638) 2020-12-16 14:13:51 +03:00
SECURITY.md Added SECURITY.md back (#3177) 2020-11-17 16:44:44 +03:00

OpenVINO™ Toolkit - Deep Learning Deployment Toolkit repository

Stable release Apache License Version 2.0 Azure DevOps builds (branch)

This toolkit allows developers to deploy pre-trained deep learning models through a high-level C++ Inference Engine API integrated with application logic.

This open source version includes several components: namely Model Optimizer, ngraph and Inference Engine, as well as CPU, GPU, MYRIAD, multi device and heterogeneous plugins to accelerate deep learning inferencing on Intel® CPUs and Intel® Processor Graphics. It supports pre-trained models from the Open Model Zoo, along with 100+ open source and public models in popular formats such as Caffe*, TensorFlow*, MXNet* and ONNX*.

Repository components:

License

Deep Learning Deployment Toolkit is licensed under Apache License Version 2.0. By contributing to the project, you agree to the license and copyright terms therein and release your contribution under these terms.

Resources:

Support

Please report questions, issues and suggestions using:


* Other names and brands may be claimed as the property of others.