Commit Graph

232 Commits

Author SHA1 Message Date
Mateusz Tabaka
d7db4974f3 Reduce number of ops needed to create InstanceNorm (#1896)
* Reduce number of ops needed to create InstanceNorm

InstanceNorm in onnx importer creates the same subgraph for Mean twice - once for Variance and once for actual Mean.
This change makes InstanceNorm to use single Mean which is shared by numerator and Variance.

Also enables IE_CPU.onnx_model_instance_normalization test case

* Revert changes to .gitignore
2020-08-24 12:26:15 +03:00
Tomasz Dołbniak
d4567d5ab5 Linux clang compilation error fix (#1891) 2020-08-21 17:22:54 +03:00
Tomasz Dołbniak
067d29a3f0 Accept empty initializers from ONNX models (#1776)
* Accept empty initializers from ONNX models

* Create dummy constants instead of null nodes

* Code formatting

* Test the empty initializers handling in onnx importer
2020-08-21 15:15:27 +03:00
Ewa Tusień
54b9b7ae6c Remove Structural Attributes from Proposal op. (#1853) 2020-08-20 12:31:43 +03:00
Ilya Churaev
d25bb6314a Deprecate nGraph v0 ops and builders (#1856)
* Deprecate nGraph v0 ops

* Fixed build

* Added deprecated defines to fix windows
2020-08-20 12:27:14 +03:00
Evgenya Stepyreva
802d605bff [ MO ] KSO ON by default (#1730)
* [ MO ] KSO ON by default.
Introduce static_shape MO key, remove keep_shape_ops key usages

* keep_shape_ops -> static_shape

* static_shape = False by default

* Fix Proposal-4 shape infer

* style-apply

* Fix Layout Change for ShapeOf paths
2020-08-20 12:06:45 +03:00
Ewa Tusień
a8e611f90b Change "run_op_node" helper to use Parameter instead of Constant (#1722)
* Replace Constant with Parameter in run_op_node.

* Pass inputs to function.

* Add func to get shape.

* Make constant if input is scalar.

* Add case for list.

* Fix test.

* Split tests for run_op_node and run_op_numeric_data.

* Split more tests.

* Split more and more tests.

* Mark tests with xfail.

* Mark more tests with xfail.

* Replace scalar with parameter.

* Code formatting.

* Set empty shape for scalar.

* Remove check for list.
2020-08-19 17:55:20 +02:00
Gleb Kazantaev
301d6b50e3 Moved AlgebraicSimplification and NopElimination passes to IE (#1859)
* Moved AlgebraicSimplification and NopElimination passes to IE

* Fixed headerfiles
2020-08-19 18:55:11 +03:00
Vladislav Vinogradov
fa8d07aebe [NGRAPH] Fix system protoc version check in CMake (#1852)
Add `OUTPUT_STRIP_TRAILING_WHITESPACE` option to `execute_process` command.

Latest CMake (tested 3.18.1) doesn't strip new line from `protoc --version` call,
which leads to wrong `PROTOC_VERSION` variable and failure on git fetch step.
2020-08-19 16:05:00 +03:00
Ilya Churaev
6ab61c1f7b Fixed path for pad reference impl (#1846) 2020-08-19 09:41:59 +03:00
Katarzyna Mitrus
ceb8a25c94 Enable HSwish - ngraph op, fusion/decomposition and reference implementation (#1770)
* Add HSwish operator to nGraph

* Add HSwishFusion transformation

* Update check_constant function

* Add reference implementation for HSwish

* Enable reference implemenation in HSwish evaluate

* Add op_eval test

* HSwish fusion transformation test

* Add HSwishFusionWithoutRelu transformation

* Add more hswish fusion tests

* Register HSwishFusion pass in common_optimizations

* Update HSwish reference implementation

* Add HSwishFusion with Relu and Multiply

* Add HSwishDecomposition transformation pass

* Add HSwishDecomposition test

* Add HSwish op to ngraph python API

* Update HSwish fusion transformations

* Remove HSwishFusion from common optimizations

* Update hswish python API

* Add bf16 to evaluate hswish

* Update hswish python API

* Move hswish reference implementation

* UnaryElementwiseArithmetic inheritance

* Enable HSwish callback for clDNN

* Register HSwishDecomposition pass in ConvertOpSet1ToLegacy

* Enable HSwishFusion pass in common optimizations

* Use NGRAPH_RTTI_DECLARATION

* Moved python hswish test to the test_ops_unary
2020-08-19 08:04:00 +03:00
Maxim Vafin
6b04eca3c2 Add Range-4 support (#1552)
* Add Range-4 support

* Add type infer and IR Reader extender

* Implement ngraph Range-4

* Implement evaluate for Range-4

* Remove not needed types

* Resolve review feedback

* Add RTTI defines
2020-08-19 07:58:41 +03:00
Ivan Tikhonov
c5ca8f5b51 Remove ngraph::Lambda class, replace TensorIterator body with ngraph::Function (#1830)
* remove Lambda class, replace TensorIterator body with ngraph::Function

* Fix passing parameters from parent graph to subgraph

Co-authored-by: mbencer <mateusz.bencer@intel.com>
2020-08-19 07:09:32 +03:00
Mateusz Bencer
a63c8d9537 Optimize Concat operation (#1812)
* 1d case optimization

* code refactor

* concat optimization

* removed using template for concat

* unit tests to concat constant folding

* synchro with current master
2020-08-18 18:28:57 +03:00
Ilya Lavrenov
579cec716e Ngraph: hide itt.hpp to src (#1834)
* Use proper include for log.hpp

* Hide itt.hpp to src folder

* Removed CodeWriter
2020-08-18 16:50:37 +03:00
Ilya Churaev
04475bc1b2 Add arithmetic operators for bfloat16 (#1831) 2020-08-18 13:49:30 +03:00
Tomasz Dołbniak
1cb1f13eaa v1::Pad evaluator (#1771)
* v1::Pad reference implementation

* ut fix: pad_negative_exterior_1d

* ut fix: pad_negative_exterior_1d_check_limits & pad_edge_1d

* Code formatting

* ut fix: pad_edge_1d_top_neg & pad_edge_1d_top_neg_bigger_than_tensor

* More Pad UT fixes

* Pad UT fixes: REFLECT mode

* Fix all Pad UTs

* Switch Pad evaluation in INT backend

* Non-template solution to v1::Pad::evaluate

* Always create v1::Pad with 4 inputs

* VS compilation error fix

* Python test fix

* Remove the v0::Pad constant folding pass

* Some extra checks in v1::Pad evaluator

* Code formatting

* Remove an obsolete CF test
2020-08-18 13:43:54 +03:00
Mateusz Bencer
ea80bc3d6f Add ONNX Round op (#1605) 2020-08-18 12:10:23 +02:00
Gleb Kazantaev
af6f99525a ConvertPrecision for element::boolean (#1772)
* Added bool to u8 conversion

* Added opset1::ShapeOf handler

* Added ReduceLogicalAnd/Or support in ConvertPrecision pass

* Moved static map inside function; Updated callbacks

* Removed header

* Fixed tyle relaxed for cases when the same output consumes by multiple inputs in the same operation; added tests; fixed input types setting for already created type relaxed operations
2020-08-18 11:10:24 +03:00
Ilya Lavrenov
57ab1e74a4 Removed NGRAPH_API from reference library (#1821) 2020-08-17 22:46:12 +03:00
Ilya Churaev
f17262e05f Add static library with nGraph reference implementations (#1810)
* Removed reference implementations from public API

* Remove coordinate_transform from public API

* Introduced static library with reference implementations
2020-08-17 19:43:11 +03:00
Evgeny Lazarev
125a462400 Enable ReduceL1 and ReduceL2 operations (#1799)
* Initial version of ReduceL1, ReduceL2 and ReduceLp enabling in the MO

* Added operations ReduceL1 and ReduceL2 to nGraph

* Removed ReduceLp. Added ReduceL1 and ReduceL2

* Separated specification of ReduceLp into ReduceL1 and ReduceL2

* Updated ReduceL1 and ReduceL2 specification

* Fixed ReduceL1 and ReduceL2 type prop tests

* Implemented nGraph transformation to decompose ReduceL1 and ReduceL2. Disabled them for CPU and GPU plugins

* Updated supported framework layers

* Added unit tests for ReduceL1 and ReduceL2 reference implementation

* Fixed ReduceXXX operations reference implementation by adding support for a new parameter 'keep_dims'

* Fixed constant folding for v0::Any

* Added ReduceL1 and ReduceL2 to Python API

* Implemented ReduceL1 and ReduceL2 decomposition tests and fixed ReduceL2 decomposition

* Added specific creator for ReduceXXX operations instead of NodeBuilders

* Fixed conversion ReduceXXX to CNNLayer

* Fixed parser for ReduceLogicalXXX operations
2020-08-17 16:32:53 +03:00
Gleb Kazantaev
aa35c59c5f FGTT for CF (#1792)
* Added FGTT for ConstantFolding

* Added test for CF disabling
2020-08-17 15:39:58 +03:00
Ilya Churaev
6c98590bcd Removed template headers for Fused Ops (#1780) 2020-08-17 13:37:00 +03:00
Mateusz Bencer
73fc659f6d Add reference implementation to VariadicSplit (#1698)
* implementation of variadic split ref impl

* Added tests

* added unit tests

* refactor

* review remarks

* fixed ie tests
2020-08-17 11:13:06 +03:00
Nikolay Shchegolev
c9251687c9 [NGraph] CTCLoss reference implementation. (#1453) 2020-08-17 06:10:51 +03:00
Ilya Churaev
4270153ad2 Remove nGraph layout (#1763) 2020-08-17 06:05:08 +03:00
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
Gleb Kazantaev
983e2a922f opset4 Convolution/GroupConvolution -> Multiply fusion (#1754)
* Added new predicates for smart pattern matching

* Added ConvMul and GroupConvMul fusion passes based on opset4; Added CPU functional tests for comparing fusion accuracy

* Improved ConvMultiply fusion to support scalars; Added positive and negative tests

* Added ConvolutionBackprop/GrouConvolutionBackprop Multiply fusion; Added functional tests
2020-08-14 13:47:02 +03:00
iliya mironov
0cc63cbb05 Add asinh acosh atanh to python api (#1488)
* Add asinh acosh atanh to python api
2020-08-14 10:07:58 +03:00
Ilya Churaev
d8133824b3 Deprecate FusedOp class (#1758)
* Deprecate FusedOps

* Try to fix windows

* Added temp headers
2020-08-14 06:27:58 +03:00
Jan Iwaszkiewicz
680cdacc11 [nGraph] Add Manager to Py API (#1533)
* Added test

* working ManagerWrapper

* Clean-up in ManagerWrapper

* worksave

* fixed building error

* Finished test of constant folding

* remove unused param

* Added get_vector function

* clean up
2020-08-13 19:56:59 +03:00
Alexander Peskov
7c921b8b45 [CPU] Add explicit storage for MemoryNode (#895) 2020-08-13 19:06:20 +03:00
Sergey Lyalin
9a62e00674 TypeRelaxed implementation (#1561)
* RTTI base for ngraph::Node; cherry-pick from another branch, draft

* Added comments, moved code, switched to custom RTTI-based version of is_type

* Move rtti definitions in ngraph op class to the beginning of each class definition as a preparation for the next replacement

* Migrate part of operations to new RTTI

* Migrate GroupConvolution and Concat to new RTTI

* Apply code style for ngraph part

* Rename RTTI_DECLARATION/DEFINITION to NGRAPH_RTTI_DECLARATION/DEFINITION

* Reverted accidentally updated version of mkldnn

* TMP: rewrite RTTI back to constexprions as an attempt to fix static objects initialization order issue

* Apply ngraph code style

* Finalize move back to constexpr for RTTI

* Applied code-style

* TypeRelaxed template class implementation and necessary changes in ngraph + tests.

* Applied code-style

* Fix in fast algorithm in GraphRewrite, add new tests for this and other cases

* Make parent optional parameter for NGRAPH_RTTI_DECLARATION and remove Node::type_info; remove ability to have Node as a parent for type_info

* Try to resolve compilation error on Windows

* The next attempt to fix Windows build: re-introduce get_type_info_static

* Removed file that was removed in master and kept in this branch by mistake

* Next attempt to fix Windows build: externConstexpr

* Attempt to fix win build: extra public (suspect icc bug), remove get_type_info_static as useless.

* Next attempt to fix Windows: proxy const and constexpr

* Fixed constexpr

* Next attmpts: move get_type_info to cpp file

* Code stype fix

* Re-implemented RTTI without use of constexpr; run-time initialization is used; removed global definitions to avoid issues with order of static objects initialization

* Removed externConstexpr flag and removed TRANSFOMRATIONS_API for TypeRelaxed

* get_type_info_static initializes static local constant with type_info that is used for CLASS::type_info and CLASS::get_type_info

* Removed not needed debug output and useless comments

* Implemented better copy ctor for Node

* Fixed VisualizeTree issue for TypeRelaxed: stopped using < and > in type_info::name

* Better comments and names for methods

* Remove unused include

* Remove commented line

* Workaround for legacy conversion that uses Node::get_type_info().name as a type for the resulting CNNLayer leading to incorrect types for TypeRelaxed-based operations and then to fail in plugins

* Fixed typos, explicit ctor for TypeRelaxedBase, explanation for the need of get_overridden_output_type

* Fix typo

* Fixed issue with non-static name in type definition for TypeRelaxed and fixed WrapType to make it compatible with hierarchical relations between types

* Reverted default ctor for Output and reverted ability to reduce number of outputs for a Node; syntactically better debug message for a Node

* Cover methods of TypeRelaxedBase by tests

* Apply code-style
2020-08-13 18:45:37 +03:00
Ilya Churaev
618c61537b Remove some builders for old operations (#1736)
* Remove some builders

* Removed reshape v0 builder

* Fixed code style
2020-08-13 07:17:24 +03:00
Gleb Kazantaev
e752911b62 nGraph passes clean up (#1742)
* Cleanup pass::Manager;Update VisualizeTree to inherit FunctionPass; Removed deprecated tranformations types

* Removed legacy code; Updated docs
2020-08-13 06:49:51 +03:00
Mateusz Tabaka
df448c092e Improve SpaceToDepth tests (#1661) 2020-08-12 16:06:09 +02:00
Ilya Churaev
819aadd981 Removed ngraph assertion (#1719) 2020-08-12 15:39:51 +03:00
Ilya Churaev
b5cf2a1f2e Removed cpio (#1735) 2020-08-12 15:39:23 +03:00
Ilya Churaev
40ce418eab Removed constant folding pass for reverse (#1716) 2020-08-12 06:57:38 +03:00
Ivan Tikhonov
abab645c42 Unroll transformation for TensorIterator (#1259)
* unroll ti transformation, lstm sequence ie, rnn sequence ie

* Update unroll ti transformation, added GRUSequenceIE op, fixed several ti e2e tests

* apply ngraph codestyle

* fix naming after unroll transformation

* Added default constructor for RNNCellBase, fix conversions

* copy runtime info

* added UnrollTI unit tests

* clean up, move sequence ops in a separate PR

* clean up, ngraph code style

* temporary disable ngraph reader unit tests for ti

* fix unit tests on windows

* naming: use name of tensor after unroll tensor iteration transformation

* apply transformations to tensor iterator body, separate pass for ti transformations, fix naming issue

* fix build

* remove TensorIterationTransformations pass

* fix includes

* resolve conflicts

* fix build: incorrect includes

* remove split/concat for single iteration of TI, update to opset4, unit tests

* use matcher pass instead of graph rewrite

* try to enable UnrollTI transformation for all plugins

* disable unrollTI transformation for cpu plugin

* resolve review comments, enable unit tests

* update transformation description

* fix unit tests

* update transformation pipeline

* clean up

* clean up

* resolve review comments
2020-08-11 18:46:57 +03:00
Mateusz Tabaka
5814bd9b98 Improve DepthToSpace tests (#1659) 2020-08-11 16:28:24 +02:00
Tomasz Dołbniak
76648b378a Make Clip work for dynamic input (#1666) 2020-08-11 16:59:15 +03:00
Jan Iwaszkiewicz
2b6b047b43 [nGraph] Create Python API support for rt_info (#1696) 2020-08-11 15:57:31 +02:00
Ilya Churaev
c46c978c79 Remove GetOutputElement op (#1604) 2020-08-11 15:28:14 +03:00
Ilya Churaev
3c9fc72b58 Changed structure of nGraph core library (#1658) 2020-08-11 11:11:33 +03:00
Rafal Blaczkowski
0721761492 Enable Model Zoo in OpenVINO-ONNX CI (#1660) 2020-08-11 09:28:55 +02:00
Jan Iwaszkiewicz
2b474c8a47 Fixed access to the data of FP16 IRs with nGraph Python API (#1707) 2020-08-11 07:16:11 +03:00
Ilya Churaev
a60f1d4633 Removed onnx_import folder from src (#1706) 2020-08-10 18:25:44 +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