Commit Graph

100 Commits

Author SHA1 Message Date
Pavel Esir
4302e2c120 add preliminary support of Proposal-4 in nGraph (#1448)
renamed logits -> bbox_deltas

updated ngraph unittests for Proposal

removed validate_and_infer_types Proposal-4

removed validate_and_infer_types Proposal-4

changed validate_and_infer_types in parent class of Proposal

removed get_output_size

successfully inferred Proposal on SSH and Faster-RCNN

added unittests for Proposal-4

added unittests for Proposal-4

added unittests for Proposal-4

returned back default namespace for Proposal

reduced number of outputs in v0::Proposal

correct conversion of Proposal-4 -> propodal_ie with 2 outputs

removed creator for proposal v0

removed converter for proposal v0

added Proposal-4 to MO

removed `for_deformable` attribute

added Proposal-4 to MO and nGraph Python API

removed typo in Proposal-4 specification

style corrections

style corrections and removed some redundant code

rename proposal Python api test

removed 'attrs' context from visitor

returned back AttrVisitor to check if passes OpenVINO ONNX pipeline

Should pass OpenVINO ONNX pipeline (returned back AttrVisitor just to check)

python api for Proposal-4 works ok

(style correction) python api for Proposal-4 works ok

parametrized proposal_ie some other corrections

removed 'attrs.' context from nGraph Python API tests for Proposal

minor corrections in replacer proposal->proposal_ie

corrected Python API OpenVINO-ONNX tests should pass

Improved workaround for AttributeVisitor for Proposal

Add additional check of im_info tensor shape to Proposal node in MKLDNNPlugin

😠 removed 4 extra spaces from test_dyn_attributes.py to match The Style

added new nGraph RTTI declarations, removed throwing exception in transformation

added new nGraph RTTI declarations, removed throwing exception in transformation, corrected exception in MKLDNNplugin

corrected im_info size checking in Proposal node of MKLDNNPlugin
2020-08-16 15:49:49 +03:00
Evgeny Lazarev
133baf23ef Updated a link to MO FAQ (#1750) 2020-08-13 13:20:29 +03:00
Roman Kazantsev
2ccd9b0bc8 Add requirements_tf2.txt to package_BOM.txt (#1728) 2020-08-12 08:55:56 +03:00
Evgenya Stepyreva
9c1f479a61 [ MO ] Turning GNMT KSO OFF (#1718) 2020-08-11 18:47:27 +03:00
Roman Kazantsev
b4b03b14f7 Separate MO configuration for TensorFlow 2 model conversion (#1685)
* Separate MO configuration for TensorFlow 2 model conversion

Also, it updates documentation including steps to convert
TF2 model with a custom layer in Keras H5 format into SavedModel

* Do fixes based on the first-round code review
2020-08-11 18:02:05 +03:00
Evgenya Stepyreva
2d2a6dbfd8 [ MO ] Fixed layout interpretation for 4/5D tensors calculated from ShapeOfs (#1634) 2020-08-11 09:34:04 +03:00
Maxim Vafin
a6efc86a6a [MO] Support ONNX QuantizeLinear (#1451)
* [MO] Support ONNX QuantizeLinear

* Update docs

* Fix cast type

* Fix error messages
2020-08-10 21:10:45 +03:00
Evgeny Lazarev
318d38770b Enable swish (#1682)
* Draft version of the Swish nGraph operation and fusing transformations for different approaches to express the operation

* Swish fusing transformation refactoring

* Added Swish operation and extractor for TF. Removed unfolding transformation for the operation.

* Added SwishIE. Implemented transformation to convert Swish to SwishIE.

* Code style fixes

* Updated Swish reference implementation. Added tests for shape and value inference


* Fixed code style for Python API

* Fixed unit test

* Apply review comments

* Use matcher_pass_callback

* Make m_alpha attribute protected in the SwishIE operation

* Fixed Swish op PythonAPI test
2020-08-10 15:51:21 +03:00
Evgenya Stepyreva
3cc7896e42 [ MO ] Extended Const->Result replacer (#1688)
* [ MO ] Extended Const->Result replacer
2020-08-10 15:36:05 +03:00
Evgenya Stepyreva
1eac9e3932 [ KALDI ] Disable KSO (#1689) 2020-08-10 12:22:42 +03:00
Pavel Esir
7e82728130 remove TestMode restriction for batchnorm in Kaldi (#1697) 2020-08-10 12:21:53 +03:00
Pavel Esir
75d2d88b61 Reshape able slice (#1241)
* Added Caffe Slice_ext

* Added TFSlice, AttributedSlice (both with extractors and replacers), corrected SliceConverter and added unittests for all cases

* added comments to each type of Slice operation; optimized shape inference; moved mxlice inside of slice.py; renamed slice_replacers

* removed type annotation for get_shape_after_slice routine

* replaced zeros_like with zeros

* Corrected preserving node names, renamed attributes names, added tests fro slice_replacer onnx phase

* Renamed slice_replacers.py

* added more unittest cases

* added type annotations, moved to more relevant place routines for shape calculation, and some other minor corrections

* corrected a typo `normalize_slice_indices` comment

* corrected shape calculation for Nonconstant inputs

* corrected a few typos

* corrected type declarations

* corrected shape inference with rounding

* refactored unit-tests for front transforms of Slice

* added error raising for negative and zero shapes

* removed magic_num

* corrected AttributedSlice, clarified comments

* fixed unit-test for AttributedSliceToSlice

* typo in type hints corrected

* removed supported_attrs

* returned back default None for attrs of Slice
2020-08-10 12:19:08 +03:00
iliya mironov
c8d74632f9 Add mxnet extractors (#1667)
* Add mxnet extractors for hyperbolic functions
2020-08-07 14:36:41 +03:00
iliya mironov
7e856c3700 Add mish fusion transformation (#1399)
* Add mish fusion transformation

* Add mish op to python api
2020-08-06 15:55:12 +03:00
Evgeny Lazarev
853cfaa038 Fixed extractor for MVN from ONNX (#1653)
* Fixed extractor for MVN from ONNX

* Updated MVN extractor from ONNX

* Code style
2020-08-06 13:53:16 +03:00
Maxim Vafin
75cb10fd6d Improve node name with port resolving (#1581)
* Improve node name with port resolving

* Fix IE remove Convert on output

* Address feedback
2020-08-05 11:31:17 +03:00
iliya mironov
680e93fba7 Add asinh acosh atanh extractors (#1600)
* Add asinh acosh atanh extractors

* Add asinh acosh atanh ext for tf

* Update docs
2020-08-04 14:56:15 +03:00
Evgenya Stepyreva
067c2414d1 [ MO GroupNorm ] Covered float Multiplication with Converts (#1602) 2020-08-03 14:45:39 +03:00
Evgeny Lazarev
dec7df17ed MO clean from IR v7 and other legacy code (#1521)
* Remove unnnecessary ir_version checks in the MO

* Cleaned up 'backend_attrs_v2' function

* Small clean up from the 'TFCustomSubgraphCall'

* Clean up the MO extractor attributes mapping

* Renamed PreluOp to PReLU
2020-07-29 17:43:12 +03:00
Evgeny Lazarev
eb8fe44de3 Updated MO requirements files (#1511)
* Updated MO requirements files

* Updated requirements in the CI config to run the pylint
2020-07-29 13:23:52 +03:00
Anton Chetverikov
4e1f7d2b96 InterpolateWithConcat pass fix (#1501)
* Fix InterpolateWithConcat pass

* Add test for None case
2020-07-28 14:50:32 +03:00
Maxim Vafin
43b46036ae Fix the case with nodes containing ":" in names (#1089)
* Fix the case with nodes containing : in names

* Raise error in case of several possibilities
2020-07-24 18:39:57 +03:00
Maxim Vafin
663be787d6 Add ONNX DequantizeLinear to MO (#1250)
* Add ONNX DequantizeLinear to MO

* Update docs
2020-07-24 18:39:09 +03:00
Pavel Esir
e56c8a2bc7 support parallel nested nnet for Kaldi (#1194)
* supported nested nnet1 for Kaldi
2020-07-23 15:37:41 +03:00
Anton Chetverikov
cdd5605c61 Update ShapeOf extender (#1406) 2020-07-23 14:07:34 +03:00
Maxim Vafin
0063efeb09 Add ONNX SpaceToDepth and DepthToSpace extractor (#1122)
* Add ONNX SpaceToDepth extractor

* Add DepthToSpace ONNX extractor
2020-07-23 13:05:42 +03:00
Roman Kazantsev
7b65ba365e Implement ScatterND operation in MO and transform for SparseToDense (#584)
SparseToDense used in Wide and Deep model is expressed through ScatterND operation.
ScatterND is more functional than SparseToDense. Hence, it was decided to replace SparseToDense
with ScatterND. ScatterND is more useful for other models.

Remove SparseToDense from the previous opset

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2020-07-10 12:29:15 +03:00
Anton Chetverikov
56916ace61 Fix const node non-deterministic names (part 2) (#1081)
* Fix non-deterministic node names generation in the Model Optimizer (part 2)
2020-07-07 09:37:48 +03:00
Maxim Vafin
ae8aaedc29 Add assert for Clip-11 (#795) 2020-07-06 18:10:14 +03:00
Evgeny Talanin
02d4787cd4 Stick to isort==4.3.21 (#1223) 2020-07-06 17:49:47 +03:00
Evgenya Stepyreva
20610ce52e [ BTS & STB ] Fixing broken transformations (#874) 2020-07-03 19:55:00 +03:00
Evgenya Stepyreva
143036f96f [ MO ] Clamp value inference (#1207) 2020-07-03 17:57:10 +03:00
Yegor Kruglov
465707eba7 [MO MXNET] Fixed spatial reshape on GluonCV models (#587)
* added value propagation for slice_like op

* Mark slice_lice as undead node

* fixes in mark_undead_nodes and unittests update
2020-06-30 22:32:13 +03:00
Evgeny Lazarev
f596432268 NMS-4 op support (#1115)
* Specification for the NMS-4 operation (updated shape infer function)

* Enabled NMS-4 in the Model Optimizer

* Changed opset version for NMS with dynamic outputs and namespace to be "dynamic"

* Added NMS-4

* Added opset4 to the nGraph

* Added unit tests for NMS-4 type infer

* Renamed UpgradeNMS3ToNMS4 to UpgradeNMS3ToNMSDynamic. Added stub for ConvertNMS4ToLegacy

* Make IE aware of opset4 ops

* Updated NMSIE to have different shape infer function based on the NMS it was converted from. Implemented NMS4->NMSIE conversion

* Apply code style

* Updated StaticShapeNonMaximumSuppression op in the VPU

* Introduced new version of NMSIE operation with shape infer function from v4::NMS

* Fixed dynamicToStaticNonMaxSuppression transformation

* Added new version of NMSIE op with updated shape infer function

* Fixed NMS4 to NMSIE2 transformation

* Fixed constructors for nGraph ops v4::NM and dynamic::NMS

* Updated text in the opset4 specification document

* Code style fixes

* Fixed constructors for StaticShapeNMS + fixed test

* Minor change to the NMS op in the MO

* Fixed typo in the dynamic_to_static_shape_non_max_suppression transformation

* Removed redundant checks

* Refactored NMS infer and validate functions

* Added more checks to the validate_and_infer_types functions for NMS-3 and NMS-4

* Fixed compilation issue on Windows for op NMS

* Code style fixes

* Fixed typos in the NMSIE and NMSIE2 to CNNLayer op conversion

* Fixed typo in the ie_cnn_layer_builder_ngraph.cpp

* Fixed the NMSToLegacyNMS transformation. Added unit tests

* Apply code review comments

* Refactored NMSIE to use visitors

* Removed calling ConvertNMS4ToLegacy in the common optimizations

* Moved NMS4ToNMSLegacy to convert1_to_legacy group of transformations

* Removed useless include statement

* Removed copy-paste issue

Co-authored-by: Evgeny Lazarev <elazarev.nnov@gmail.com>
2020-06-30 14:04:31 +03:00
Evgenya Stepyreva
62fba3eadf [ MO ] Keep data type of compressed value (#1143)
JIRA: 34085
2020-06-29 14:56:11 +03:00
Vladimir Gavrilov
b9d67927fd Fixed deleting Transpose layers after and before Interpolate layers. (#1071)
* Fixed deleting Transpose layers after and before Interpolate layers.

* Added run_after() for the transformation InterpolateTranspose.

* Some checks were moved from the replacement function to the pattern.

* Added a check of the attribute 'axes' into the pattern.
2020-06-29 12:49:29 +03:00
Anton Chetverikov
5aa9ffbfe3 Fix const node non-deterministic names (part 1) (#996)
* Update node names
2020-06-26 13:41:49 +03:00
Maxim Shevtsov
7e40136c3c LayerNorm(PyTorch/HuggingFace pattern)->MVN+Mul+Add (#1003)
* LayerNorm(PyTorch/HuggingFace pattern)->MVN+Mul+Add. Improves perf on BERT by 5%

* deducing the across_channels from axes passed to the MVN op.
axes are normalized. if no axes is specified, falling back to the (previously) default across_channel value

Co-authored-by: myshevts <maim.y.shevtsov@intel.com>
2020-06-25 09:25:56 +03:00
Roman Kazantsev
5ad1bf643d Correct removing nodes from graph and add test for ConstToResult transform (#1084)
Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>
2020-06-23 13:49:14 +03:00
Evgenya Stepyreva
f40338ff4b [ MO ] Hard-coded Interpolate followed by concat reshape-ability fixing (#818) 2020-06-23 08:27:27 +03:00
Maxim Vafin
9276334144 Cherry-pick fix OneHot transformation for Bert Squad opset 10 (#1068)
* Fix OneHot transformation for Bert Squad opset 10

* Add transformation for squeezing depth for OneHot
2020-06-22 20:42:02 +03:00
Evgeny Lazarev
970b1301b5 Cleanup IR v7 from the MO (#1008)
* Removed back phase transformations related to IRv7

* Fixed setting value for the input port using the 'set_value' method

* Removed front and middle phase transformations related to IRv7

* Cleanup the rest of the Model Optimizer transformations from IRv7 specific transformations

* Final cleanup of the deprecated IR v7 related code

* Removed 'blobs_as_input' usage in the Model Optimizer.

* Removed function '_fuse_add' from the Model Optimizer since it is not used anymore.

* Removed 'keep_in_IR' node attribute for FakeQuantize ops in the MO

* Disabled failing gpu_engine.user_context test
2020-06-22 11:52:00 +03:00
Evgeny Lazarev
356e40c988 Relaxed MO requirements for "protobuf" package (#864)
Co-authored-by: Evgeny Lazarev <elazarev.nnov@gmail.com>
2020-06-17 18:31:23 +03:00
Pavel Esir
00f0247b4e fixed some typos in MO help (#972) 2020-06-17 18:27:37 +03:00
Maxim Vafin
074266bf73 Fix onnx slice by clipping ends to int32 domain (#603) 2020-06-09 17:50:38 +03:00
Pavel Esir
7a11e36eeb Add fixedscale(bias) components to Kaldi (#725)
* Added fixed scale(bias) components

* Successfully converted after adding fixed bias,scale components

* Added unittests
2020-06-08 21:37:44 +03:00
iliya mironov
eefaf56075 Fix unit tests for select layer. (#638)
* Fix unit tests for select layer.
2020-06-08 18:39:40 +03:00
Maxim Vafin
f1811ad060 Implement support for opset3 EmbeddingBag ops (#546)
* [MO] Implement EmbeddingBag_3

* Transform dynamic sub-graph of Wide and Deep into EmbeddingSegmentsSum

- Expressed SparseWeightedSum sub-graph through EmbeddingSegmentsSum
- Removed experimental SparseWeightedSum layer
- Implemented tests for the transformation

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Fix EmbeddingBag shape infer

* Fix EmbeddingSegmentsSum transformation for Wide and Deep

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Fix EmbeddingSegmentSum replacer after ports swap

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Update package_BOM.txt

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Add unit tests for EmbeddingXXX shape infer

* Fix ATen resolver

* Remove deleted files from BOM

* Add opset version to embedding_bag

* Use base class for EmbeddingBag

* Fix per_sample_weights case

* Fix EmbeddingSegmentsSum transformation

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Fix EmbeddingBag checks

* Fix ATen front transformation and merge conflicts

* Fix BOM

* Work around limitation for I64 input of W&D model

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Cleanup where operation to fix affect of WhereDecomposition transform

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Fix BOM

* Correct EmbeddingSegmentSum transform for Wide and Deep

Add casting segment ids to i32 and remove ConstToResult sub-graph.

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Update BOM with RemoveConstToResult transform

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Add more comments for RemoveConstToResult transformation

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Remove useless logging in EmbeddingSegmentsSum transformation

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Small fixes

* Move EmbeddingBag resolving back to front phase

* Improve error messages

* Fix typo in unittests

* Reimplement sparse_reshape middle transform

Avoid deprecated API.

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Clean-up graph after sparse_reshape and ConstToResult transformation

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Fix clean-up for transformations

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

* Fix clean-up for transformation #2

Signed-off-by: Roman Kazantsev <roman.kazantsev@intel.com>

Co-authored-by: Roman Kazantsev <roman.kazantsev@intel.com>
2020-06-08 18:06:40 +03:00
Evgenya Stepyreva
e7f5f53f92 [ MO ] Groupped conv fusion (#797)
Fixed the group convolution fusion pass to properly get the feature dim in NCHW layout case.
2020-06-08 13:00:54 +03:00
Maxim Vafin
f51c533ea8 Add ReduceL2 decomposition (#733)
* Add ReduceL2 decomposition

* Add ReduceL2 transformation tests

* Add const propagation unit test for ReduceL2
2020-06-05 12:34:57 +03:00