From: Ivan Tikhonov Date: Thu, 17 Sep 2020 08:45:45 +0000 (+0300) Subject: Move PriorBox to PriorBoxIE transformation from CommonOptimization pass (#2185) X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=379158fc1199a1264eb0d10fb80e7b8eb6b8045b;p=platform%2Fupstream%2Fdldt.git Move PriorBox to PriorBoxIE transformation from CommonOptimization pass (#2185) * move PriorBox to PriorBoxIE transformation from CommonOptimization pass * call initNodeInfo transformation before PriorToPriorIE * update comments --- diff --git a/inference-engine/src/cldnn_engine/cldnn_engine.cpp b/inference-engine/src/cldnn_engine/cldnn_engine.cpp index 3d9b167..33f7e74 100644 --- a/inference-engine/src/cldnn_engine/cldnn_engine.cpp +++ b/inference-engine/src/cldnn_engine/cldnn_engine.cpp @@ -30,8 +30,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -127,6 +129,9 @@ InferenceEngine::ICNNNetwork::Ptr clDNNEngine::CloneAndTransformNetwork(const In // Note: instead of running all Conversion Transformations you can make up your own transformation pipeline ngraph::pass::Manager manager; + manager.register_pass(); + // WA: ConvertPriorBox must be executed before the 1st ConstantFolding pass + manager.register_pass(); manager.register_pass(); manager.register_pass(); manager.register_pass(); diff --git a/inference-engine/src/legacy_api/src/cnn_network_impl.cpp b/inference-engine/src/legacy_api/src/cnn_network_impl.cpp index 67bf014..2aaeec4 100644 --- a/inference-engine/src/legacy_api/src/cnn_network_impl.cpp +++ b/inference-engine/src/legacy_api/src/cnn_network_impl.cpp @@ -18,8 +18,10 @@ #include "generic_ie.hpp" #include "cnn_network_ngraph_impl.hpp" +#include #include #include +#include #include #include #include @@ -95,6 +97,9 @@ CNNNetworkImpl::CNNNetworkImpl(const ICNNNetwork & ngraphImpl) { ::ngraph::op::GenericIE::DisableReshape noReshape(graph); ::ngraph::pass::Manager manager; + manager.register_pass<::ngraph::pass::InitNodeInfo>(); + // WA: ConvertPriorBox must be executed before the 1st ConstantFolding pass + manager.register_pass<::ngraph::pass::ConvertPriorBox>(); manager.register_pass<::ngraph::pass::CommonOptimizations>(); manager.register_pass<::ngraph::pass::ConvertOpSet3ToOpSet2>(); manager.register_pass<::ngraph::pass::ConvertOpSet2ToOpSet1>(); diff --git a/inference-engine/src/mkldnn_plugin/mkldnn_plugin.cpp b/inference-engine/src/mkldnn_plugin/mkldnn_plugin.cpp index 0631c27..cf4b35f 100644 --- a/inference-engine/src/mkldnn_plugin/mkldnn_plugin.cpp +++ b/inference-engine/src/mkldnn_plugin/mkldnn_plugin.cpp @@ -24,8 +24,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -92,6 +94,9 @@ static void Transformation(ICNNNetwork::Ptr& clonedNetwork) { ngraph::op::GenericIE::DisableReshape noReshape(nGraphFunc); ngraph::pass::Manager manager; + manager.register_pass(); + // WA: ConvertPriorBox must be executed before the 1st ConstantFolding pass + manager.register_pass(); manager.register_pass(); manager.register_pass(); manager.register_pass(); diff --git a/inference-engine/src/transformations/src/transformations/common_optimizations/common_optimizations.cpp b/inference-engine/src/transformations/src/transformations/common_optimizations/common_optimizations.cpp index 56f0ece..4ec3c63 100644 --- a/inference-engine/src/transformations/src/transformations/common_optimizations/common_optimizations.cpp +++ b/inference-engine/src/transformations/src/transformations/common_optimizations/common_optimizations.cpp @@ -7,7 +7,6 @@ #include "transformations/common_optimizations/algebraic_simplification.hpp" #include "transformations/common_optimizations/nop_elimination.hpp" #include "transformations/common_optimizations/common_optimizations.hpp" -#include "transformations/convert_opset1_to_legacy/convert_prior_to_ie_prior.hpp" #include "transformations/depth_to_space_fusion.hpp" #include "transformations/optimize_strided_slice.hpp" #include "transformations/convert_scatter_elements_to_scatter.hpp" @@ -35,8 +34,6 @@ bool ngraph::pass::CommonOptimizations::run_on_function(std::shared_ptr(); - manager.register_pass(); // WA: ConvertPriorBox must be executed before CF - manager.register_pass(); manager.register_pass(); // Resolves dynamism (replaces NonZero), CF needed manager.register_pass(); manager.register_pass(); diff --git a/inference-engine/src/vpu/graph_transformer/src/frontend/frontend.cpp b/inference-engine/src/vpu/graph_transformer/src/frontend/frontend.cpp index 6bdcb26..d7c88a7 100644 --- a/inference-engine/src/vpu/graph_transformer/src/frontend/frontend.cpp +++ b/inference-engine/src/vpu/graph_transformer/src/frontend/frontend.cpp @@ -27,7 +27,9 @@ #include #include #include +#include #include +#include #include #include #include "vpu/ngraph/transformations/dynamic_to_static_shape.hpp" @@ -168,6 +170,9 @@ ie::ICNNNetwork::Ptr FrontEnd::convertNetwork(ie::ICNNNetwork& network) { ngraph::op::GenericIE::DisableReshape noReshape(nGraphFunc); ngraph::pass::Manager manager; + manager.register_pass<::ngraph::pass::InitNodeInfo>(); + // WA: ConvertPriorBox must be executed before the 1st ConstantFolding pass + manager.register_pass<::ngraph::pass::ConvertPriorBox>(); manager.register_pass(); manager.register_pass(); manager.register_pass(); diff --git a/inference-engine/tests/functional/inference_engine/cnn_network/convert_ngraph_to_cnn_network_tests.cpp b/inference-engine/tests/functional/inference_engine/cnn_network/convert_ngraph_to_cnn_network_tests.cpp index 6daf329..3f22b42 100644 --- a/inference-engine/tests/functional/inference_engine/cnn_network/convert_ngraph_to_cnn_network_tests.cpp +++ b/inference-engine/tests/functional/inference_engine/cnn_network/convert_ngraph_to_cnn_network_tests.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -167,6 +168,9 @@ TEST(ConvertFunctionToCNNNetworkTests, ConvertTopKWithOneInput) { } ngraph::pass::Manager manager; + manager.register_pass(); + // WA: ConvertPriorBox must be executed before the 1st ConstantFolding pass + manager.register_pass(); manager.register_pass(); manager.register_pass(); manager.register_pass(); diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/low_precision_transformations/layer_transformation.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/low_precision_transformations/layer_transformation.cpp index 31f5f5d..a384b22 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/low_precision_transformations/layer_transformation.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/low_precision_transformations/layer_transformation.cpp @@ -17,8 +17,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -79,6 +81,9 @@ InferenceEngine::CNNNetwork LayerTransformation::transform(InferenceEngine::deta // Note: instead of running all Conversion Transformations you can make up your own transformation pipeline ngraph::pass::Manager manager; + manager.register_pass(); + // WA: ConvertPriorBox must be executed before the 1st ConstantFolding pass + manager.register_pass(); manager.register_pass(); manager.register_pass(); manager.register_pass(); diff --git a/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/low_precision_transformations/layer_transformation.cpp b/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/low_precision_transformations/layer_transformation.cpp index b9d608d..4a3cc72 100644 --- a/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/low_precision_transformations/layer_transformation.cpp +++ b/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/low_precision_transformations/layer_transformation.cpp @@ -17,8 +17,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -73,6 +75,9 @@ InferenceEngine::CNNNetwork LayerTransformation::transform(InferenceEngine::deta // Note: instead of running all Conversion Transformations you can make up your own transformation pipeline ngraph::pass::Manager manager; + manager.register_pass(); + // WA: ConvertPriorBox must be executed before the 1st ConstantFolding pass + manager.register_pass(); manager.register_pass(); manager.register_pass(); manager.register_pass();