Commit Graph

23 Commits

Author SHA1 Message Date
Ilya Lavrenov c38f08b777
Use protobuf-lite for ONNX FE by default (#6829) 2021-07-31 17:21:35 +03:00
Evgeny Lazarev 5bafab9e72
Allow partially defined dimensions to read/serialize from/to IR (#6819)
* Allow to read and serialize IRs with -1 in dimensions (partially defined shape)

* Added unit test for reading/writing IR with partially defined shapes

* Added missing xml file with test IR

* Remove copy-paste issue

* Output message fix

* Restored statification of the output shapes during IR serialization

* Try to make dynamic shapes static with upper bound

* Code style changes
2021-07-30 22:53:43 +03:00
Ilya Lavrenov fa2f9c5201
Migrated to official GoogleTest repo (#6286)
* Move gtest to <root>/wqthirdparty

* Fixed inference engine tests

* Fixed unit-tests

* Fixed GPU

* Fixed clDNN_unit_tests compilation

* Reverted ngraph changes

* Fixed VPU tests

* Fixed deprecated tests compilation

* Removed OpenVINO clone

* Added public submodule

* Removed

* Fixed Windows

* More updates for INSTANTIATE_TEST_SUITE_P

* Use release-1.10.0

* Removed ngraph copy of gtest

* Revert "Removed ngraph copy of gtest"

This reverts commit ec9fe08d79.

* Fixes for TYPED_TEST_CASE

* Fixed GNA tests

* Updated submodule

* Updaed index

* TMP disabled tests

* Revert changes and fix compilation errors

* Fixed caching tests

* Revert back

* Revert back all

Co-authored-by: Michael Nosov <mikhail.nosov@intel.com>
2021-06-22 17:39:39 +03:00
Alexey Suhov a748c26fee
Align copyright notice in cpp and cmake source files (CVS-51320) (#4950) 2021-03-25 02:40:09 +03:00
Patryk Elszkowski af712743ab
Comparison of InputDescription and OutputDescription in SubGraph (#4123)
* draft - looks good, need merge with other branch

* apply suggestions from PR

* apply suggestions from PR

* add unit test - NotValidInputOrOutput

* rephraze equal for constant

* cleanup all TODOs

* Try to fix TI

* try to satisfy PR comments

* fix spelling

Co-authored-by: Patryk Elszkowski <patryk.elszkowki@intel.com>
2021-02-25 16:31:35 +03:00
Jozef Daniecki 4d9797c1fe
Fix U1 type constant comparison in compare_functions(). (#4461) 2021-02-24 09:37:36 +03:00
Bartosz Lesniewski f90ed75db8
Fix comparison of constant with float NAN values (#4369)
* check bitwise equality before using the threshold method

* use std functions to check float class instead of reinterpret casting

* add unit test with nan f32 const value
2021-02-19 07:13:10 +03:00
Bartosz Lesniewski 7c8b8e5dda
Fix comparison of constant with short float NAN values (#4299)
* fix comparison of constant with short float NAN values

* adjust precision, remove elvises

* more templates

* add ir serialization  test with float16 const

* remove unused prototxt
2021-02-15 07:22:19 +03:00
Jozef Daniecki 2d979accab
Added BIN precision convertion to ngraph's u1. (#4160)
* Added BIN precision convertion to ngraph's u1.

* Add test to check if serialization works with BIN precision.
2021-02-04 14:41:54 +03:00
Bartek Szmelczynski 18a65b5330
Serialization dynamic layer bug (#3982)
* remove if statement which checks if there is no dynamic shape

* remove reshaping for genericIE operation

* back to the previous version with reshape

* remove blank space

* add plugin_api to cmake in order to use generic_ie.hpp in serialize file

* add SLT for serialization for NonMaxSupperesion operator

* revert the removal of if check for dynamism

* remove the left over from CMakeLists

* fix CmakeLists removal fail

* remove redundant parenthesis

* add test which failed in the first place and fixes to it

* fix wrong spaces
2021-02-04 07:21:37 +03:00
Ilya Lavrenov 75ed35836f
Properly enabled ia32 build (#4145)
* Properly enabled ia32 build

* Fixed OpenCV_DIR env check
2021-02-03 17:26:50 +03:00
Patryk Elszkowski 450f01280a
[compare_function] compare ops attributes (#3966)
* [compare_function] compare ops attributes value by value

* Storage cleanup

* Add comparison for:
- SubGraphOpInputDescription
- SubGraphOpOutputDescription
- SpecialBodyPorts

* cleanup

* Report error on unhandled types

* Change comparison of floating-point to general approach

Co-authored-by: Patryk Elszkowski <patryk.elszkowki@intel.com>
2021-01-29 12:30:57 +03:00
Szymon Durawa 0791987491
Add Loop serialization, SLT and regular test. (#3980)
* Add Loop serialization, SLT and regular test.

* Remove loop test from SerializationTensorIteratorTest, add bin for test loop xml.

* Remove metadata section from loop xml file.

* Remove m_num_iterations initialization, it is done during validate_and_infer_types().
2021-01-26 12:25:06 +03:00
Patryk Elszkowski 5993383e31
[BUG] Serialize loses runtime info (#3903)
* rt_info serialization for ngraph::Node

* add test for it info serialization

* try to fix centos build

Co-authored-by: Patryk Elszkowski <patryk.elszkowki@intel.com>
2021-01-22 10:58:51 +03:00
Patryk Elszkowski 187813a3f6
[BUG]Add extra op clone to have default inputs/outputs set. (#3855)
* Add extra op clone to have default inputs/outputs set.

* Call `validate_and_infer_types` after clone for TensorIterator and Loop

* Add gtest to check if default values works with dynamic shapes

* Apply suggestions from PR.

Co-authored-by: Patryk Elszkowski <patryk.elszkowki@intel.com>
2021-01-21 13:02:21 +03:00
Vladimir Gavrilov 318db6eccc
Implement ExperimentalDetectronROIFeatureExtractor operation as nGraph op (#3739)
* Commit.

* Written the header file of the nGraph operation ExperimentalDetectronROIFeatureExtractor.

* Started to write cpp-file for the nGraph operation ExperimentalDetectronROIFeatureExtractor.

* Deleted in_ports_count attribute for the MO operation ExperimentalDetectronROIFeatureExtractor.

* Written validate_and_infer_type() method of ngraph::op::v6::ExperimentalDetectronROIFeatureExtractor.

* Code style fixes.

* Code style fixes.

* Small fixes.

* Code style fixes.

* Now operation ExperimentalDetectronROIFeatureExtractor is read as nGraph operation ExperimentalDetectronROIFeatureExtractor.

* Implemented op::v6::ExperimentalDetectronROIFeatureExtractor::clone_with_new_inputs().

* Added macro NGRAPH_OP_SCOPE to the cpp-file of the nGraph operation ExperimentalDetectronROIFeatureExtractor.

* Fixes in some tests.

* Code style fix.

* Fixed yet another test for ExperimentalDetectronROIFeatureExtractor.

* Added tests for reading ExperimentalDetectronROIFeatureExtractor as operation from opset6.

* Added more test for reading ExperimentalDetectronROIFeatureExtractor as operation from opset6.

* Started to write shape infer tests for the nGraph operation ExperimentalDetectronROIFeatureExtractor.

* Corrected ngraph/test/CMakeLists.txt.

* Small changes.

* Code style fix.

* Small fixes.

* Added ctor of ExperimentalDetectronROIFeatureExtractor with NodeVector as argument.

* Added setting the attribute in_ports_count when the MO operation ExperimentalDetectronROIFeatureExtractor is creating in the MO transformation ONNXMaskRCNNTransformation.

* Added shape infer for the second output of the nGraph operation ExperimentalDetectronROIFeatureExtractor.

* Written shape infer tests for nGraph operation ExperimentalDetectronROIFeatureExtractor (case when input shapes are partially dynamic).

* Small fixes.

* Code style fix.

* Deleted redundant &expected_channels.

* Code style fix.

* Small refactoring.

* Small fixes.

* Small changes.

* Small fixes.

* Deleted attribute distribute_rois_between_levels of ExperimentalDetectronROIFeatureExtractoe.

* Deleted attribute preserve_rois_order of ExperimentalDetectronROIFeatureExtractoe.

* Deleted attribute image_id of ExperimentalDetectronROIFeatureExtractoe.

* Now MO generates attribute 'aligned' of ExperimentalDetectronROIFeatureExtractor only with values 'true' or 'false'.

* Small fix.

* Fix in the conversion of the attribute 'aligned' of MO operation ExperimentalDetectronROIFeatureExtractor to string.

* Tabs were replaced by spaces in some XMLs.

* Tabs were replaced by spaces in ngraph_reshape_tests.cpp.

* Fixed copyrights.

* Applied small patch to IREngine from PR https://github.com/openvinotoolkit/openvino/pull/3814.

* Tabs were replaced by spaces in cnn_ngraph_impl_tests.cpp.

* op::v6::ExperimentalDetectronROIFeatureExtractor::validate_and_infer_types() was rewritten using operator & for channels.

* Added tests for input shapes of op::v6::ExperimentalDetectronROIFeatureExtractor in the case when inputs shapes consist of intervals.

* Fixes in test type_prop.detectron_roi_feature_extractor_intervals.
2021-01-20 16:20:54 +03:00
Szymon Durawa 4f5230bb03
Visitor api ti serialization (#3777)
* Add on_adapter(Function) for serialization.

* Add port_map and back_edges serialization.

* Add 2  unit tests for TI serialization.

* Convert lambda expression into function pointer.

* Add single layer test for tensor iterator.

* Add limitation for file name length during serialization.

* Add file name length limitation for Serialize().

* Add WA for LSTMCell v0 in serialize class, new test class for TI serialization with dynamic weights, add bin path to SerializationParams, replace call to ngfunction_2_irv10 with visitor.on_attribute().

* Remove hacks for TI from ngfunction_2_irv10(), validate buffers in port_map.

* Changed year in new added test files.

* Add check for version of LSTMv0 WA, add assert for model read from file.

* Remove append_copy for xml Function, changed comparison for LSTMvo WA.

* Update second WA for LSTMCell v0 with version check.

* Remove find_child when searching for port_map and back_edges.
2021-01-19 15:26:29 +03:00
Vladimir Gavrilov e20a58d770
Implement ExperimentalDetectronDetectionOutput and ExperimentalDetectronPriorGridGenerator operations as nGraph ops (#3374)
* Commit.

* Started to write nGraph operation ExperimentalDetectronDetectionOutput. Written draft of the header file.

* Written draft of the cpp-file for nGraph operation ExperimentalDetectronDetectionOutput.

* Small fix.

* Added reading of ExperimentalDetectronDetectionOutput as nGraph operation.

* Some fix.

* Unregistered old shape infer function of the operation ExperimentalDetectronDetectionOutput.

* Written the header file for the operation ExperimentalDetectronPriorGridGenerator.

* Small refactoring.

* Small fix.

* Added set_output_size(3) into op::ExperimentalDetectronDetectionOutput::validate_and_infer_types().

* Added check for number of inputs of ExperimentalDetectronDetectionOutput.

* Reverted some changes.

* Changed IR for ExperimentalDetectronDetectionOutput serialization test.

* Written cpp-file of nGraph operation ExperimentalDetectronPriorGridGenerator.

* Small fix.

* Some fixes.

* Fixes in type and shape infer functions of the MO operation ExperimentalDetectronDetectionOutput.

* Now ExperimentalDetectronPriorGridGenerator is readed as nGraph operation.

* Fixed the infer function of the nGraph operation ExperimentalDetectronPriorGridGenerator.

* Started to write tests for the shape infer function of the nGraph operation ExperimentalDetectronDetectionOutput.

* Written the draft of the test for the shape infer function of the nGraph operation ExperimentalDetectronDetectionOutput.

* Small fix.

* Fixed ngraph/test/CMakeLists.txt.

* Started to write tests for the shape infer function of the nGraph operation ExperimentalDetectronPriorGridGenerator.

* Now the shape infer function of the nGraph operation ExperimentalDetectronPriorGridGenerator performs correctly case dynamic input shapes with static ranks.

* Continued to write test for the nGraph operation ExperimentalDetectronPriorGridGenerator.

* Small fixes.

* Written tests for the shape infer function of the nGraph operation ExperimentalDetectronPriorGridGenerator (case when input shapes are partially dynamic).

* Added test for reading ExperimentalDetectronDetectionOutput as an operation from opset6.

* Some fixes.

* Added some debug outputs.

* Deleted inserted debug output.

* Small fixes.

* Small fix.

* Small fix.

* Small change.

* Added comments to attributes of ExperimentalDetectronDetectionOutput.

* Reverted changes.

* Deleted shape infer for output port 3.

* Small fixes.

* Deleted redundant keyword 'virtual'.

* Deleted redundant usings in header files of nGraph operations ExperimentalDetectronDetectionOutput and ExperimentalDetectronPriorGridGenerator.

* Some fixes.

* Small change.

* Now GridGenerator::validate takes three args (input partial shapes).

* Small fix.

* Deleted some usings.

* Small code style fix.

* Reverted changes in validate_and_infer_types() and validate() of op::v6::ExperimentalDetectronPriorGridGenerator.

* Added description of the class ExperimentalDetectronDetectionOutput.

* Added some comments into the header file of the nGraph operation ExperimentalDetectronPriorGridGenerator.

* Some fixes.

* Added some comments to the class of the nGraph operation ExperimentalDetectronPriorGridGenerator.

* Now the MO operation ExperimentalDetectronDetectionOutput has the attribute 'version' as 'opset6'.

* Now the MO operation ExperimentalDetectronPriorGridGenerator has the attribute 'version' as 'opset6'.

* Some fixes in the MO class ExperimentalDetectronDetectionOutput.

* Fixes in the shape infer function of the nGraph operation ExperimentalDetectronPriorGridGenerator.

* Renamed test XML model for ExperimentalDetectronDetectionOutput serialization tests.

* Added validation of input shapes for the nGraph operation ExperimentalDetectronDetectionOutput.

* Small fixes in the XML models for serialization testing of ExperimentalDetectronDetectionOutput.

* Added tests of shape infer function of the nGraph operation ExperimentalDetectronDetectionOutput for the case when input shapes are partially dynamic.

* Added tests of shape infer function of the nGraph operation ExperimentalDetectronDetectionOutput for the case when some input shapes have dynamic ranks.

* Small fixes.

* Small fix in the MO operation ExperimentalDetectronDetectionOutput shape infer function.

* Fixes in op::v6::ExperimentalDetectronDetectionOutput::validate_and_infer_types().

* Code style fix.

* Small refactoring.

* Added NGRAPH_OP_SCOPE into ExperimentalDetectronDetectionOutput nGraph class.

* Added NGRAPH_OP_SCOPE to the nGraph class ExperimentalDetectronPriorGridGenerator.

* Small fixes.

* Some refactoring.

* Small fix.

* Small fixes.

* Reverted some changes in ExperimentalDetectronDetectionOutput::validate_and_infer_type().

* Now VPU reads the attribute class_agnostic_box_regression of ExperimentalDetectronDetectionOutput as Bool.

* Now MO generates attribute  'class_agnostic_box_regression' of ExperimentalDetectronDetectionOutput only with values false or true.

* Small fix.

* Tabs were replaced by spaces in some XMLs.

* Fixed copyrights.

* Refactoring in op::v6::ExperimentalDetectronDetectionOutput::validate_and_infer_types().

* Refactoring in op::v6::ExperimentalDetectronPriorGridGenerator::validate_and_infer_types().

* Small fixes.

* Started to write ExperimentalDetectronPriorGridGenerator shape infer tests for the case when dynamic input dimensions are intervals.

* Deleted redundant 'return'.

* Written tests for interval values of input shapes of op::v6::ExperimentalDetectronPriorGridGenerator.

* Code style fix.

* Code style fix.
2021-01-18 12:16:40 +03:00
Patryk Elszkowski 2bc18c27aa
Constant attr to visitor (#3540)
* Add new path for constant in IR serializer.

* Apply suggestion from review.

* Unique name for temporary test file

* Switch from static to constant member function - GetTestName

* Ensure bin path is not empty.

* Compare Constants op by string values converted to float.

* Add path validation.

Co-authored-by: Patryk Elszkowski <patryk.elszkowki@intel.com>
2020-12-23 16:14:26 +03:00
Piotr Szmelczynski 3d66869081
add f64 support to ngraph serializer (#3462)
* add f64 support to ngraph serializer

* Create add_abc test with f64 type
2020-12-04 12:13:32 +03:00
Gleb Kazantaev 27efd1fc7e
Resolve dynamism in Serialize transformation (#3260)
* Added Interval shape inference for NMS5

* Added dynamic shape resolver for Serialize pass

* Refactored Serializatoin tests; Added tests with dynamic shapes(NMS5, ShapeOf)

* Fixed python NMS5 test

* Fixed LowLatecnyTests
2020-11-24 12:38:56 +03:00
Jozef Daniecki 34af04e1a8
Serialization of experimental and custom ops (#2862)
* Add IEGeneric node type handling.

* Remove dependency on plugin_api library.

IEGeneric type name is passed via Visiotr API as new syntetic atribute.

* Add custom operations support

* Fix charachter literals comparison.

* Pass custom opsets to CNNNetwork:serialize().

IE extensions are stored in ngraph CNNNetwork and later used to pass
custom opsets to serialization transformation.

* Refactor custom ops tests to use template_extension library.

* Add comment on __generic_ie_type__ purpose.
2020-10-30 07:31:27 +03:00
Jozef Daniecki c6fc247f99
Add nGraph function serialization. (#2579)
* Add nGraph function serialization.

* Turn of execption throwing on failed visitation.

* CNNNetworkNgrapImpl serialize also support fallback to v7 serialization.

* Add error message for legacy IR not implemented case.

* Store tests models in files.

* Add tests with multiple layers.

* Style aligned to IE rules.

* Add visit_attributes to ExecutionNode.

* Layer version XML atribute implementation.

* Fix opset atribute creation for ExecutionGraph. Refactoring.

* Add missing header.

* Move opset collecting to private scope.

* Add missing header.

* Add test wit multiple oututs. Fix found issues: constant name, result
outputs.

* Move serialization to transformation library.

* Add versioning to serialization transformation.

* Add functional tests with ONNX importer path.

* Add nodes unique name checking and correction.

* Add checks for unsuported cases: dynamic shapes & GenericIE node

* General refactoring.

* Add comment describing type name translations.

* Add serialization deterministicity tests.

It's needed to ensure that subsequent calls to serialize() on the same function are giving the same results.

* Serialization in CNNNetworkNGraphImpl::serialize executed via pass::Manager.

Co-authored-by: Gleb Kazantaev <gleb.nnstu@gmail.com>

* NGRAPH_CHECK messages refactored.

* Performance and const correctness refactoring.

* Style formatting applied.

* Code simplifaction.

* Serialize transformation documentation refactoring.

* Changed compare_function() to throw on functions with multiple outputs.

Before this check was implemented with assert which means it was working
only in debug builds. Now it is working also in release build.

* Adjust tests to new compare_functions() behaviour.

* Replace cmakes add_definitions with more modern target_compile_definitions

Co-authored-by: Gleb Kazantaev <gleb.nnstu@gmail.com>
2020-10-27 06:57:48 +03:00