From 1968632c6e4d106e8fe2b0c42b3e6c0ec726f59f Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Wed, 12 Apr 2023 01:25:37 +0400 Subject: [PATCH] Removed FixRtInfo pass --- .../docs/develop_cc_for_new_component.md | 1 - .../include/transformations/fix_rt_info.hpp | 38 ----------------- .../src/transformations/fix_rt_info.cpp | 42 ------------------- .../src/transformations/init_node_info.cpp | 2 - src/core/CMakeLists.txt | 1 - src/inference/src/cnn_network_ngraph_impl.cpp | 8 ---- src/inference/src/compilation_context.cpp | 2 - .../unit/ie_compilation_context_test.cpp | 3 +- 8 files changed, 1 insertion(+), 96 deletions(-) delete mode 100644 src/common/transformations/include/transformations/fix_rt_info.hpp delete mode 100644 src/common/transformations/src/transformations/fix_rt_info.cpp diff --git a/src/common/conditional_compilation/docs/develop_cc_for_new_component.md b/src/common/conditional_compilation/docs/develop_cc_for_new_component.md index 4166a907434b13..32c10478dc6310 100644 --- a/src/common/conditional_compilation/docs/develop_cc_for_new_component.md +++ b/src/common/conditional_compilation/docs/develop_cc_for_new_component.md @@ -69,7 +69,6 @@ It checks whether the code region in this module is active or inactive by the ma There is an example of `conditional_compilation_gen.h`: ``` -#define ov_pass_FixRtInfo_run_on_function 1 #define ov_pass_GraphRewrite_run_on_model 1 #define ov_pass_InitNodeInfo_run_on_function 1 #define ov_pass_ConstantFolding_run_on_model 1 diff --git a/src/common/transformations/include/transformations/fix_rt_info.hpp b/src/common/transformations/include/transformations/fix_rt_info.hpp deleted file mode 100644 index 97c45c9af5fb63..00000000000000 --- a/src/common/transformations/include/transformations/fix_rt_info.hpp +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -/** - * @brief Defines initialize node runtime information pass - * @file init_node_info.hpp - */ - -#include -#include -#include - -#include "transformations_visibility.hpp" - -namespace ov { -namespace pass { - -class TRANSFORMATIONS_API FixRtInfo; - -} // namespace pass -} // namespace ov - -/** - * @ingroup ie_transformation_common_api - * @brief FixRtInfo transformation helps to fix info attributes in a single place. - * User can pass runtime attribute using various types. - * This Pass should generalize them runtime info representation. - * - * Used to extract runtime attributes from shared pointer to `ov::RuntimeAttributeWrapper` to standard or trivial types - */ -class ov::pass::FixRtInfo : public ov::pass::ModelPass { -public: - OPENVINO_RTTI("FixRtInfo", "0"); - bool run_on_model(const std::shared_ptr& m) override; -}; diff --git a/src/common/transformations/src/transformations/fix_rt_info.cpp b/src/common/transformations/src/transformations/fix_rt_info.cpp deleted file mode 100644 index abd07aa0618b06..00000000000000 --- a/src/common/transformations/src/transformations/fix_rt_info.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (C) 2018-2023 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "transformations/fix_rt_info.hpp" - -#include -#include -#include -#include - -#include "itt.hpp" -#include "transformations/rt_info/primitives_priority_attribute.hpp" - -bool ov::pass::FixRtInfo::run_on_model(const std::shared_ptr& f) { - RUN_ON_FUNCTION_SCOPE(FixRtInfo); - - for (auto& node : f->get_ops()) { - // Recursively apply transformation for sub-graph based operations - if (auto sub_graph_node = std::dynamic_pointer_cast(node)) { - if (auto sub_graph = sub_graph_node->get_function()) { - run_on_model(sub_graph); - } - } - auto& rt_info = node->get_rt_info(); - { - auto it_info = rt_info.find("PrimitivesPriority"); - if (it_info != rt_info.end()) { - if (it_info->second.is()) { - rt_info.emplace(ov::PrimitivesPriority::get_type_info_static(), - it_info->second.as()); - } - if (it_info->second.is()) { - rt_info.emplace(ov::PrimitivesPriority::get_type_info_static(), - ov::PrimitivesPriority{it_info->second.as()}); - } - rt_info.erase(it_info); - } - } - } - return false; -} diff --git a/src/common/transformations/src/transformations/init_node_info.cpp b/src/common/transformations/src/transformations/init_node_info.cpp index 0fe6a33c691d22..0ace33d8532a9b 100644 --- a/src/common/transformations/src/transformations/init_node_info.cpp +++ b/src/common/transformations/src/transformations/init_node_info.cpp @@ -10,7 +10,6 @@ #include #include "itt.hpp" -#include "transformations/fix_rt_info.hpp" #include "transformations/rt_info/fused_names_attribute.hpp" #include "transformations/rt_info/primitives_priority_attribute.hpp" @@ -27,6 +26,5 @@ bool ov::pass::InitNodeInfo::run_on_model(const std::shared_ptrget_rt_info(); rtInfo.emplace(FusedNames::get_type_info_static(), FusedNames{node->get_friendly_name()}); } - FixRtInfo{}.run_on_model(f); return false; } diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 566a085c9f9003..627a30b8bb6aa8 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -115,7 +115,6 @@ file(GLOB_RECURSE smart_reshape_srcs ${CMAKE_CURRENT_SOURCE_DIR}/src/pass/smart_ file(GLOB_RECURSE rt_info_srcs ${CMAKE_CURRENT_SOURCE_DIR}/src/pass/rt_info/*.cpp) set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/src/pass/convert_precision.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/src/pass/convert_fp32_to_fp16.cpp" - "${CMAKE_CURRENT_SOURCE_DIR}/src/pass/fix_rt_info.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/src/pass/init_node_info.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/src/pass/serialize.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/src/op/type_relaxed.cpp" diff --git a/src/inference/src/cnn_network_ngraph_impl.cpp b/src/inference/src/cnn_network_ngraph_impl.cpp index 46ad025933d053..391b9d64c8dbc9 100644 --- a/src/inference/src/cnn_network_ngraph_impl.cpp +++ b/src/inference/src/cnn_network_ngraph_impl.cpp @@ -29,7 +29,6 @@ #include "transformations/common_optimizations/nop_elimination.hpp" #include "transformations/common_optimizations/remove_concat_zero_dim_input.hpp" #include "transformations/common_optimizations/remove_multi_subgraph_op_dangling_params.hpp" -#include "transformations/fix_rt_info.hpp" #include "transformations/smart_reshape/set_batch_size.hpp" #include "transformations/smart_reshape/smart_reshape.hpp" #include "transformations/utils/utils.hpp" @@ -136,7 +135,6 @@ CNNNetworkNGraphImpl::CNNNetworkNGraphImpl(const std::shared_ptr& nGra { ov::pass::Manager m; using namespace ov::pass; - REGISTER_PASS(m, FixRtInfo) REGISTER_PASS(m, EliminateScatterUpdate) REGISTER_PASS(m, RemoveConcatZeroDimInput) REGISTER_PASS(m, RemoveMultiSubGraphOpDanglingParamsResults) @@ -199,12 +197,6 @@ CNNNetworkNGraphImpl::CNNNetworkNGraphImpl(const CNNNetwork& network) { } _ngraph_function = ngraph::clone_function(*network.getFunction()); - { - ov::pass::Manager m; - using namespace ov::pass; - REGISTER_PASS(m, FixRtInfo) - m.run_passes(_ngraph_function); - } validateFunctionNames(); InputsDataMap inputs = network.getInputsInfo(); OutputsDataMap outputs = network.getOutputsInfo(); diff --git a/src/inference/src/compilation_context.cpp b/src/inference/src/compilation_context.cpp index 3668a4d932e1b8..d302e2fa18c7ec 100644 --- a/src/inference/src/compilation_context.cpp +++ b/src/inference/src/compilation_context.cpp @@ -18,7 +18,6 @@ #include "ie_itt.hpp" #include "ngraph/opsets/opset6.hpp" #include "openvino/pass/manager.hpp" -#include "transformations/fix_rt_info.hpp" #include "transformations/hash.hpp" #include "transformations/rt_info/fused_names_attribute.hpp" #include "transformations/rt_info/primitives_priority_attribute.hpp" @@ -86,7 +85,6 @@ std::string ModelCache::compute_hash(const std::shared_ptr& mod uint64_t seed = 0; // 1. Calculate hash on function ov::pass::Manager m; - m.register_pass(); m.register_pass(seed); m.run_passes(std::const_pointer_cast(model)); diff --git a/src/inference/tests/unit/ie_compilation_context_test.cpp b/src/inference/tests/unit/ie_compilation_context_test.cpp index 42906daab8355f..421480c61e7cd5 100644 --- a/src/inference/tests/unit/ie_compilation_context_test.cpp +++ b/src/inference/tests/unit/ie_compilation_context_test.cpp @@ -189,8 +189,7 @@ TEST(NetworkContext, HashWithPrimitivesPriority) { op3["PrimitivesPriority"] = "testPriority"; ASSERT_NE(ModelCache::compute_hash(net1, {}), ModelCache::compute_hash(net2, {})); - - ASSERT_EQ(ModelCache::compute_hash(net2, {}), ModelCache::compute_hash(net3, {})); + ASSERT_NE(ModelCache::compute_hash(net2, {}), ModelCache::compute_hash(net3, {})); } TEST(NetworkContext, HashWithFusedNames) {