Removed FixRtInfo pass (#16870)
* Removed FixRtInfo pass * Removed FixRtInfo pass * Fixed macOS compilation
This commit is contained in:
parent
10dc2d8b9b
commit
54609e7b72
@ -106,8 +106,6 @@ function(openvino_developer_export_targets)
|
||||
if(TARGET "${target_name}")
|
||||
get_target_property(original_name ${target_name} ALIASED_TARGET)
|
||||
if(TARGET "${original_name}")
|
||||
message(STATUS "The name ${target_name} is an ALIAS for ${original_name}. "
|
||||
"It will be exported to the OpenVINODeveloperPackage with the original name.")
|
||||
list(REMOVE_ITEM ${EXPORT_COMPONENT} ${target_name})
|
||||
list(APPEND ${EXPORT_COMPONENT} ${original_name})
|
||||
endif()
|
||||
|
@ -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
|
||||
|
@ -62,7 +62,7 @@ static uint64_t hash_combine(uint64_t seed, const T &v) {
|
||||
namespace rt_info {
|
||||
|
||||
// some node attr is not type of ov::RuntimeAttribute, need dedicate visitor.
|
||||
const std::vector<std::string> list_of_names{
|
||||
static const std::vector<std::string> list_of_names{
|
||||
"PrimitivesPriority",
|
||||
"alt_width",
|
||||
};
|
||||
|
@ -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 <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#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<ov::Model>& m) override;
|
||||
};
|
@ -1,42 +0,0 @@
|
||||
// Copyright (C) 2018-2023 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include "transformations/fix_rt_info.hpp"
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "itt.hpp"
|
||||
#include "openvino/core/rt_info.hpp"
|
||||
#include "openvino/opsets/opset1.hpp"
|
||||
#include "transformations/rt_info/primitives_priority_attribute.hpp"
|
||||
|
||||
bool ov::pass::FixRtInfo::run_on_model(const std::shared_ptr<ov::Model>& 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<op::util::SubGraphOp>(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<ov::PrimitivesPriority>()) {
|
||||
rt_info.emplace(ov::PrimitivesPriority::get_type_info_static(),
|
||||
it_info->second.as<ov::PrimitivesPriority>());
|
||||
}
|
||||
if (it_info->second.is<std::string>()) {
|
||||
rt_info.emplace(ov::PrimitivesPriority::get_type_info_static(),
|
||||
ov::PrimitivesPriority{it_info->second.as<std::string>()});
|
||||
}
|
||||
rt_info.erase(it_info);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
@ -8,9 +8,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "itt.hpp"
|
||||
#include "openvino/core/rt_info.hpp"
|
||||
#include "openvino/opsets/opset1.hpp"
|
||||
#include "transformations/fix_rt_info.hpp"
|
||||
#include "openvino/op/util/sub_graph_base.hpp"
|
||||
#include "transformations/rt_info/fused_names_attribute.hpp"
|
||||
#include "transformations/rt_info/primitives_priority_attribute.hpp"
|
||||
|
||||
@ -27,6 +25,5 @@ bool ov::pass::InitNodeInfo::run_on_model(const std::shared_ptr<ov::Model>& f) {
|
||||
auto& rtInfo = node->get_rt_info();
|
||||
rtInfo.emplace(FusedNames::get_type_info_static(), FusedNames{node->get_friendly_name()});
|
||||
}
|
||||
FixRtInfo{}.run_on_model(f);
|
||||
return false;
|
||||
}
|
||||
|
@ -122,7 +122,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"
|
||||
|
@ -197,7 +197,7 @@ void ngfunction_2_ir(pugi::xml_node& node,
|
||||
bool deterministic);
|
||||
|
||||
namespace rt_info {
|
||||
const std::vector<std::string> list_of_names{
|
||||
static const std::vector<std::string> list_of_names{
|
||||
"PrimitivesPriority",
|
||||
"alt_width",
|
||||
};
|
||||
|
@ -11,8 +11,6 @@ ov_try_use_gold_linker()
|
||||
|
||||
add_definitions(-DSERIALIZED_ZOO=\"${TEST_MODEL_ZOO}/core/models\")
|
||||
|
||||
message(STATUS "OpenVINO Core unit tests enabled")
|
||||
|
||||
# For type relaxed types
|
||||
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/threading.cpp
|
||||
PROPERTIES INCLUDE_DIRECTORIES $<TARGET_PROPERTY:inference_engine_transformations,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||
|
@ -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<Function>& 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();
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "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<const ov::Model>& mod
|
||||
uint64_t seed = 0;
|
||||
// 1. Calculate hash on function
|
||||
ov::pass::Manager m;
|
||||
m.register_pass<ov::pass::FixRtInfo>();
|
||||
m.register_pass<ov::pass::Hash>(seed);
|
||||
m.run_passes(std::const_pointer_cast<ov::Model>(model));
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "ie_ngraph_utils.hpp"
|
||||
#include "openvino/core/type/element_type.hpp"
|
||||
#include "utils/rt_info/memory_formats_attribute.hpp"
|
||||
#include "transformations/rt_info/primitives_priority_attribute.hpp"
|
||||
#include "utils/general_utils.h"
|
||||
#include <cstdint>
|
||||
|
||||
@ -101,7 +102,7 @@ std::string CPUTestsBase::fmts2str(const std::vector<cpu_memory_format_t> &fmts,
|
||||
return str;
|
||||
}
|
||||
|
||||
std::string CPUTestsBase::impls2str(const std::vector<std::string> &priority) {
|
||||
ov::PrimitivesPriority CPUTestsBase::impls2primProiority(const std::vector<std::string> &priority) {
|
||||
std::string str;
|
||||
for (auto &impl : priority) {
|
||||
((str += "cpu:") += impl) += ",";
|
||||
@ -109,7 +110,7 @@ std::string CPUTestsBase::impls2str(const std::vector<std::string> &priority) {
|
||||
if (!str.empty()) {
|
||||
str.pop_back();
|
||||
}
|
||||
return str;
|
||||
return ov::PrimitivesPriority(str);
|
||||
}
|
||||
|
||||
void CPUTestsBase::CheckPluginRelatedResults(InferenceEngine::ExecutableNetwork &execNet, const std::set<std::string>& nodeType) const {
|
||||
@ -321,7 +322,7 @@ CPUTestsBase::makeCPUInfo(const std::vector<cpu_memory_format_t>& inFmts,
|
||||
ov::intel_cpu::OutputMemoryFormats(fmts2str(outFmts, "cpu:"))});
|
||||
}
|
||||
if (!priority.empty()) {
|
||||
cpuInfo.insert({"PrimitivesPriority", impls2str(priority)});
|
||||
cpuInfo.emplace(ov::PrimitivesPriority::get_type_info_static(), impls2primProiority(priority));
|
||||
}
|
||||
|
||||
cpuInfo.insert({"enforceBF16evenForGraphTail", true});
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <string>
|
||||
#include "ie_system_conf.h"
|
||||
#include "shared_test_classes/base/layer_test_utils.hpp"
|
||||
#include "transformations/rt_info/primitives_priority_attribute.hpp"
|
||||
#include <exec_graph_info.hpp>
|
||||
#include <openvino/runtime/compiled_model.hpp>
|
||||
#include "ie_system_conf.h"
|
||||
@ -122,7 +123,7 @@ public:
|
||||
static const char *cpu_fmt2str(cpu_memory_format_t v);
|
||||
static cpu_memory_format_t cpu_str2fmt(const char *str);
|
||||
static std::string fmts2str(const std::vector<cpu_memory_format_t> &fmts, const std::string &prefix);
|
||||
static std::string impls2str(const std::vector<std::string> &priority);
|
||||
static ov::PrimitivesPriority impls2primProiority(const std::vector<std::string> &priority);
|
||||
static CPUInfo makeCPUInfo(const std::vector<cpu_memory_format_t>& inFmts,
|
||||
const std::vector<cpu_memory_format_t>& outFmts,
|
||||
const std::vector<std::string>& priority);
|
||||
|
@ -28,11 +28,11 @@ ov_add_test_target(
|
||||
find_package(OpenCV QUIET COMPONENTS core imgproc)
|
||||
|
||||
if(OpenCV_FOUND AND OpenCV_VERSION VERSION_GREATER_EQUAL 3.4)
|
||||
message("-- Reference preprocessing: OpenCV tests are enabled")
|
||||
message(STATUS "Reference preprocessing: OpenCV tests are enabled")
|
||||
target_compile_definitions(${TARGET_NAME} PRIVATE OPENCV_TEMPLATE_TESTS)
|
||||
target_link_libraries(${TARGET_NAME} PRIVATE opencv_imgproc opencv_core)
|
||||
else()
|
||||
message("-- Reference preprocessing: OpenCV tests are disabled, because OpenCV ver. 3.4+ is not found")
|
||||
message(WARNING "Reference preprocessing: OpenCV tests are disabled, because OpenCV ver. 3.4+ is not found")
|
||||
endif()
|
||||
|
||||
if (ENABLE_INTEL_CPU)
|
||||
|
@ -140,7 +140,7 @@ void OpSummary::updateOPsStats(const std::shared_ptr<ov::Model>& model, const Pa
|
||||
return;
|
||||
}
|
||||
bool isFunctionalGraph = false;
|
||||
for (const auto &op : model->get_ordered_ops()) {
|
||||
for (const auto& op : model->get_ordered_ops()) {
|
||||
if (!std::dynamic_pointer_cast<ov::op::v0::Parameter>(op) &&
|
||||
!std::dynamic_pointer_cast<ov::op::v0::Constant>(op) &&
|
||||
!std::dynamic_pointer_cast<ov::op::v0::Result>(op)) {
|
||||
|
Loading…
Reference in New Issue
Block a user