[CC]Fix CC issue for transformation (#12292)
* Revert "Fixed 3 naming issue" This reverts commita92d3cfff5. * Revert "Fix CC issues for transformation and snippets" This reverts commitd08a3f5aac. * Fix NGRAPH_PASS_CALLBACK issue to make it can work * Fix matcher name missing issue
This commit is contained in:
@@ -20,7 +20,6 @@ OV_CC_DOMAINS(ov_pass);
|
||||
# define RUN_ON_FUNCTION_SCOPE(region) OV_SCOPE(ov_pass, OV_PP_CAT(region, _run_on_function))
|
||||
# define MATCHER_SCOPE(region) const std::string matcher_name(OV_PP_TOSTRING(region))
|
||||
# define RUN_ON_MODEL_SCOPE(region) OV_SCOPE(ov_pass, OV_PP_CAT(region, _run_on_model))
|
||||
# define MATCHER_SCOPE_ENABLE(region) OV_SCOPE(ov_pass, region)
|
||||
|
||||
#elif defined(SELECTIVE_BUILD)
|
||||
|
||||
@@ -36,11 +35,9 @@ OV_CC_DOMAINS(ov_pass);
|
||||
|
||||
# define RUN_ON_MODEL_SCOPE(region) MATCHER_SCOPE_(ov_pass, OV_PP_CAT(region, _run_on_model))
|
||||
|
||||
# define MATCHER_SCOPE_ENABLE(region)
|
||||
#else
|
||||
|
||||
# define MATCHER_SCOPE(region) const std::string matcher_name(OV_PP_TOSTRING(region))
|
||||
# define RUN_ON_FUNCTION_SCOPE(region)
|
||||
# define RUN_ON_MODEL_SCOPE(region)
|
||||
# define MATCHER_SCOPE_ENABLE(region)
|
||||
#endif
|
||||
|
||||
@@ -102,7 +102,6 @@ AddTransformation::AddTransformation(const Params& params) : EltwiseBaseTransfor
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(AddTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ AssignAndReadValueTransformation::AssignAndReadValueTransformation(const std::sh
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(AssignAndReadValueTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ AvgPoolTransformation::AvgPoolTransformation(const Params& params) : LayerTransf
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(AvgPoolTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ ClampTransformation::ClampTransformation(const Params& params) : LayerTransforma
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(ClampTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ ConcatTransformation::ConcatTransformation(const Params& params) : LayerTransfor
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(ConcatTransformation);
|
||||
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ ConvertTransformation::ConvertTransformation(const Params& params) : LayerTransf
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(ConvertTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ ngraph::pass::low_precision::ConvertSubtractConstant::ConvertSubtractConstant(co
|
||||
NetworkHelper::copyInfo(subtract, newSubtract);
|
||||
replace_node(subtract, newSubtract);
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(ConvertSubtractConstant);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ ConvolutionTransformation::ConvolutionTransformation(const Params& params) : Wei
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(ConvolutionTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -48,7 +48,6 @@ ConvolutionBackpropDataTransformation::ConvolutionBackpropDataTransformation(con
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(ConvolutionBackpropDataTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ DepthToSpaceTransformation::DepthToSpaceTransformation(const Params& params) : T
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(DepthToSpaceTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ FakeQuantizeTransformation::FakeQuantizeTransformation(const Params& params) : L
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(FakeQuantizeTransformation);
|
||||
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ FakeQuantizeDecompositionTransformation::FakeQuantizeDecompositionTransformation
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(FakeQuantizeDecompositionTransformation);
|
||||
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ FoldConvertTransformation::FoldConvertTransformation(const Params& params) : Lay
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(FoldConvertTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ FoldFakeQuantizeTransformation::FoldFakeQuantizeTransformation(const Params& par
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(FoldFakeQuantizeTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ FuseConvertTransformation::FuseConvertTransformation(const Params& params) : Lay
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(FuseConvertTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ FuseMultiplyToFakeQuantizeTransformation::FuseMultiplyToFakeQuantizeTransformati
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(FuseMultiplyToFakeQuantizeTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ FuseSubtractToFakeQuantizeTransformation::FuseSubtractToFakeQuantizeTransformati
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(FuseSubtractToFakeQuantizeTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ GroupConvolutionTransformation::GroupConvolutionTransformation(const Params& par
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(GroupConvolutionTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ InterpolateTransformation::InterpolateTransformation(const Params& params) : Lay
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(InterpolateTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -127,7 +127,6 @@ void make_matcher_type_relaxed(ngraph::pass::GraphRewrite* transformation) {
|
||||
|
||||
copy_runtime_info(l_node, replacement);
|
||||
replace_node(l_node, replacement);
|
||||
MATCHER_SCOPE_ENABLE(TypeRelaxedReplacer);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ MatMulTransformation::MatMulTransformation(const Params& params) : LayerTransfor
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(MatMulTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ MaxPoolTransformation::MaxPoolTransformation(const Params& params) : LayerTransf
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(MaxPoolTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ MoveFakeQuantize::MoveFakeQuantize(const Params& params) : LayerTransformation(p
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(MoveFakeQuantize);
|
||||
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ MultiplyTransformation::MultiplyTransformation(const Params& params) : EltwiseBa
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(MultiplyTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ MultiplyToGroupConvolutionTransformation::MultiplyToGroupConvolutionTransformati
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(MultiplyToGroupConvolutionTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -53,7 +53,6 @@ MVNTransformation::MVNTransformation(const Params& params) : LayerTransformation
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(MVNTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@ NormalizeL2Transformation::NormalizeL2Transformation(const Params& params) : Lay
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(NormalizeL2Transformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ PadTransformation::PadTransformation(const Params& params) : LayerTransformation
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(PadTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ PReluTransformation::PReluTransformation(const Params& params) : LayerTransforma
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(PReluTransformation)
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ ngraph::pass::low_precision::PullReshapeThroughDequantization::PullReshapeThroug
|
||||
THROW_IE_LPT_EXCEPTION(*parent) << "unexepcted operation type";
|
||||
}
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(PullReshapeThroughDequantization);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ ngraph::pass::low_precision::PullTransposeThroughDequantization::PullTransposeTh
|
||||
THROW_IE_LPT_EXCEPTION(*parent) << "unexepcted operation type";
|
||||
}
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(PullTransposeThroughDequantization);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ ReduceMaxTransformation::ReduceMaxTransformation(const Params& params) : ReduceB
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(ReduceMaxTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ ReduceMeanTransformation::ReduceMeanTransformation(const Params& params) : Reduc
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(ReduceMeanTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ ReduceMinTransformation::ReduceMinTransformation(const Params& params) : ReduceB
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(ReduceMinTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ ReduceSumTransformation::ReduceSumTransformation(const Params& params) : ReduceB
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(ReduceSumTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ ReluTransformation::ReluTransformation(const Params& params) : LayerTransformati
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(ReluTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ ReshapeTransformation::ReshapeTransformation(const Params& params) : LayerTransf
|
||||
return false;
|
||||
}
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(ReshapeTransformation);
|
||||
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ ShuffleChannelsTransformation::ShuffleChannelsTransformation(const Params& param
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(ShuffleChannelsTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ SplitTransformation::SplitTransformation(const Params& params) : LayerTransforma
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(SplitTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ SqueezeTransformation::SqueezeTransformation(const Params& params) : LayerTransf
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(SqueezeTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -89,7 +89,6 @@ StridedSliceTransformation::StridedSliceTransformation(const Params& params) : L
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(StridedSliceTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ SubtractTransformation::SubtractTransformation(const Params& params) : LayerTran
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(SubtractTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ TransposeTransformation::TransposeTransformation(const Params& params) : LayerTr
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(TransposeTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ UnsqueezeTransformation::UnsqueezeTransformation(const Params& params) : LayerTr
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(UnsqueezeTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ VariadicSplitTransformation::VariadicSplitTransformation(const Params& params) :
|
||||
if (transformation_callback(op)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(VariadicSplitTransformation);
|
||||
return transform(*context, m);
|
||||
};
|
||||
|
||||
|
||||
@@ -523,10 +523,9 @@ TokenizeSnippets::TokenizeSnippets() {
|
||||
<< " inputs and " << subgraph->outputs().size()
|
||||
<< " outputs and " << subgraph->get_body()->get_ops().size() << " ops total\n";
|
||||
|
||||
MATCHER_SCOPE_ENABLE(TokenizeSnippets);
|
||||
return true;
|
||||
};
|
||||
auto matcher = std::make_shared<ngraph::pattern::Matcher>(label);
|
||||
auto matcher = std::make_shared<ngraph::pattern::Matcher>(label, matcher_name);
|
||||
register_matcher(matcher, callback);
|
||||
}
|
||||
} // namespace pass
|
||||
|
||||
@@ -21,8 +21,8 @@ ngraph::snippets::pass::ConvertConstantsToScalars::ConvertConstantsToScalars() {
|
||||
scalar->set_friendly_name(constant->get_friendly_name());
|
||||
ngraph::copy_runtime_info(constant, scalar);
|
||||
ngraph::replace_node(constant, scalar);
|
||||
MATCHER_SCOPE_ENABLE(ConvertConstantsToScalars);
|
||||
|
||||
return true;
|
||||
};
|
||||
register_matcher(std::make_shared<ov::pass::pattern::Matcher>(constants), callback);
|
||||
register_matcher(std::make_shared<ov::pass::pattern::Matcher>(constants, matcher_name), callback);
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@ ngraph::snippets::pass::ConvertPowerToPowerStatic::ConvertPowerToPowerStatic() {
|
||||
power_static->set_friendly_name(power->get_friendly_name());
|
||||
ngraph::copy_runtime_info(power, power_static);
|
||||
ngraph::replace_node(power, power_static);
|
||||
MATCHER_SCOPE_ENABLE(ConvertPowerToPowerStatic);
|
||||
|
||||
return true;
|
||||
};
|
||||
register_matcher(std::make_shared<ov::pass::pattern::Matcher>(scalarPower), callback);
|
||||
register_matcher(std::make_shared<ov::pass::pattern::Matcher>(scalarPower, matcher_name), callback);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
ngraph::snippets::pass::InsertLoad::InsertLoad() {
|
||||
MATCHER_SCOPE(InsertLoad);
|
||||
register_matcher(std::make_shared<ngraph::pattern::Matcher>(
|
||||
ngraph::pattern::wrap_type<ngraph::opset1::Parameter>()),
|
||||
ngraph::pattern::wrap_type<ngraph::opset1::Parameter>(), matcher_name),
|
||||
[this](ngraph::pattern::Matcher &m) {
|
||||
OV_ITT_SCOPED_TASK(ngraph::pass::itt::domains::SnippetsTransform, "Snippets::op::InsertLoad")
|
||||
auto root = m.get_match_root();
|
||||
@@ -41,7 +41,7 @@ ngraph::snippets::pass::InsertLoad::InsertLoad() {
|
||||
}
|
||||
}
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(InsertLoad);
|
||||
|
||||
return rewritten;
|
||||
});
|
||||
}
|
||||
@@ -49,7 +49,7 @@ ngraph::snippets::pass::InsertLoad::InsertLoad() {
|
||||
ngraph::snippets::pass::InsertStore::InsertStore() {
|
||||
MATCHER_SCOPE(InsertStore);
|
||||
register_matcher(std::make_shared<ngraph::pattern::Matcher>(
|
||||
ngraph::pattern::wrap_type<ngraph::opset1::Result>()),
|
||||
ngraph::pattern::wrap_type<ngraph::opset1::Result>(), matcher_name),
|
||||
[this](ngraph::pattern::Matcher &m) {
|
||||
OV_ITT_SCOPED_TASK(ngraph::pass::itt::domains::SnippetsTransform, "Snippets::op::InsertStore")
|
||||
auto root = m.get_match_root();
|
||||
@@ -64,7 +64,6 @@ ngraph::snippets::pass::InsertStore::InsertStore() {
|
||||
auto store = std::make_shared<ngraph::snippets::op::Store> (root->input_value(0));
|
||||
ngraph::copy_runtime_info(root, store);
|
||||
root->set_argument(0, store);
|
||||
MATCHER_SCOPE_ENABLE(InsertStore);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ ngraph::snippets::pass::InsertMoveBroadcast::InsertMoveBroadcast() {
|
||||
}
|
||||
|
||||
reset_broacast_config(root);
|
||||
MATCHER_SCOPE_ENABLE(InsertMoveBroadcast);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -177,5 +177,5 @@ ngraph::snippets::pass::InsertMoveBroadcast::InsertMoveBroadcast() {
|
||||
return ((ngraph::op::supports_auto_broadcast(n) || is_type<opset1::SquaredDifference>(n) || is_type<opset1::Mod>(n)) &&
|
||||
n->get_autob().m_type == ngraph::op::AutoBroadcastType::NUMPY) || is_type<opset1::PRelu>(n); });
|
||||
|
||||
register_matcher(std::make_shared<ngraph::pattern::Matcher>(any), callback);
|
||||
register_matcher(std::make_shared<ngraph::pattern::Matcher>(any, matcher_name), callback);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ ngraph::snippets::pass::LoadMoveBroadcastToBroadcastLoad::LoadMoveBroadcastToBro
|
||||
auto load_pattern = std::make_shared<ngraph::snippets::op::Load>(param_pattern);
|
||||
auto fbn = std::make_shared<ngraph::snippets::op::BroadcastMove>(load_pattern, Shape{1});
|
||||
|
||||
register_matcher(std::make_shared<ngraph::pattern::Matcher>(fbn),
|
||||
register_matcher(std::make_shared<ngraph::pattern::Matcher>(fbn, matcher_name),
|
||||
[load_pattern, param_pattern](ngraph::pattern::Matcher &m) {
|
||||
OV_ITT_SCOPED_TASK(ngraph::pass::itt::domains::SnippetsTransform, "Snippets::op::LoadMoveBroadcastToBroadcastLoad")
|
||||
auto root = m.get_match_root();
|
||||
@@ -50,7 +50,6 @@ ngraph::snippets::pass::LoadMoveBroadcastToBroadcastLoad::LoadMoveBroadcastToBro
|
||||
if (inshape.back() == 1 && outshape.back() != 1) {
|
||||
ngraph::copy_runtime_info(root, broadcastload);
|
||||
ngraph::replace_node(root, broadcastload);
|
||||
MATCHER_SCOPE_ENABLE(LoadMoveBroadcastToBroadcastLoad);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
ngraph::snippets::pass::ReplaceLoadsWithScalarLoads::ReplaceLoadsWithScalarLoads() {
|
||||
MATCHER_SCOPE(ReplaceLoadsWithScalarLoads);
|
||||
register_matcher(std::make_shared<ngraph::pattern::Matcher>(
|
||||
ngraph::pattern::wrap_type<ngraph::snippets::op::Load>()),
|
||||
ngraph::pattern::wrap_type<ngraph::snippets::op::Load>(), matcher_name),
|
||||
[this](ngraph::pattern::Matcher &m) {
|
||||
OV_ITT_SCOPED_TASK(ngraph::pass::itt::domains::SnippetsTransform, "Snippets::op::ReplaceLoadsWithScalarLoads_callback")
|
||||
auto root = m.get_match_root();
|
||||
@@ -24,7 +24,6 @@ ngraph::snippets::pass::ReplaceLoadsWithScalarLoads::ReplaceLoadsWithScalarLoads
|
||||
load->set_friendly_name(root->get_friendly_name());
|
||||
ngraph::copy_runtime_info(root, load);
|
||||
ngraph::replace_node(root, load);
|
||||
MATCHER_SCOPE_ENABLE(ReplaceLoadsWithScalarLoads);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
@@ -32,7 +31,7 @@ ngraph::snippets::pass::ReplaceLoadsWithScalarLoads::ReplaceLoadsWithScalarLoads
|
||||
ngraph::snippets::pass::ReplaceStoresWithScalarStores::ReplaceStoresWithScalarStores() {
|
||||
MATCHER_SCOPE(ReplaceStoresWithScalarStores);
|
||||
register_matcher(std::make_shared<ngraph::pattern::Matcher>(
|
||||
ngraph::pattern::wrap_type<ngraph::snippets::op::Store>()),
|
||||
ngraph::pattern::wrap_type<ngraph::snippets::op::Store>(), matcher_name),
|
||||
[this](ngraph::pattern::Matcher &m) {
|
||||
OV_ITT_SCOPED_TASK(ngraph::pass::itt::domains::SnippetsTransform, "Snippets::op::ReplaceStoresWithScalarStores_callback")
|
||||
auto root = m.get_match_root();
|
||||
@@ -42,7 +41,6 @@ ngraph::snippets::pass::ReplaceStoresWithScalarStores::ReplaceStoresWithScalarSt
|
||||
store->set_friendly_name(root->get_friendly_name());
|
||||
ngraph::copy_runtime_info(root, store);
|
||||
ngraph::replace_node(root, store);
|
||||
MATCHER_SCOPE_ENABLE(ReplaceStoresWithScalarStores);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -120,7 +120,6 @@ ngraph::pass::AddFakeQuantizeFusion::AddFakeQuantizeFusion() {
|
||||
new_fq->set_friendly_name(fq->get_friendly_name());
|
||||
copy_runtime_info({add_node, fq}, {new_input_low, new_input_high, new_fq});
|
||||
replace_node(fq, new_fq);
|
||||
MATCHER_SCOPE_ENABLE(AddFakeQuantizeFusion);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ ngraph::pass::BatchToSpaceFusion::BatchToSpaceFusion() {
|
||||
reshape_or_trans_after},
|
||||
batch_to_space);
|
||||
replace_node(reshape_or_trans_after, batch_to_space);
|
||||
MATCHER_SCOPE_ENABLE(BatchToSpaceFusion);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -199,7 +199,6 @@ pass::BinarizeWeights::BinarizeWeights() {
|
||||
{new_activations_fq, new_conv, activations_norm_factor_reshaped, mul, weights_norm_factor_reshaped, mul2});
|
||||
mul2->set_friendly_name(conv->get_friendly_name());
|
||||
replace_node(conv, mul2);
|
||||
MATCHER_SCOPE_ENABLE(BinarizeWeights);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ ngraph::pass::ClampFusion::ClampFusion() {
|
||||
|
||||
copy_runtime_info(nodes, clamp);
|
||||
replace_node(root_node, clamp);
|
||||
MATCHER_SCOPE_ENABLE(ClampFusion);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ ov::pass::CompressFloatConstantsImpl::CompressFloatConstantsImpl() {
|
||||
ov::mark_as_decompression(convert);
|
||||
|
||||
ov::replace_node(const_node, convert);
|
||||
MATCHER_SCOPE_ENABLE(CompressFloatConstantsImpl);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -69,7 +69,6 @@ ngraph::pass::PullSqueezeThroughEltwise::PullSqueezeThroughEltwise() {
|
||||
new_eltwise->set_friendly_name(squeeze->get_friendly_name());
|
||||
ngraph::copy_runtime_info({eltwise, squeeze}, new_eltwise);
|
||||
ngraph::replace_node(squeeze, new_eltwise);
|
||||
MATCHER_SCOPE_ENABLE(PullSqueezeThroughEltwise);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -73,7 +73,6 @@ ngraph::pass::ConvolutionMultiplyFusion::ConvolutionMultiplyFusion() {
|
||||
new_conv->set_friendly_name(m_mul->get_friendly_name());
|
||||
copy_runtime_info({m_conv, m_mul}, {new_conv, final_const.get_node_shared_ptr(), weights_multiply});
|
||||
replace_node(m_mul, new_conv);
|
||||
MATCHER_SCOPE_ENABLE(ConvolutionMultiplyFusion);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -161,7 +160,7 @@ ngraph::pass::GroupConvolutionMultiplyFusion::GroupConvolutionMultiplyFusion() {
|
||||
m_conv->set_friendly_name(m_mul->get_friendly_name());
|
||||
m_mul->output(0).replace(m_conv->output(0));
|
||||
copy_runtime_info(m_mul, {m_conv, new_weights});
|
||||
MATCHER_SCOPE_ENABLE(GroupConvolutionMultiplyFusion);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -228,7 +227,6 @@ ngraph::pass::ConvolutionBackpropDataMultiplyFusion::ConvolutionBackpropDataMult
|
||||
new_conv->set_friendly_name(m_mul->get_friendly_name());
|
||||
copy_runtime_info({m_conv, m_mul}, {new_conv, final_const.get_node_shared_ptr(), weights_multiply});
|
||||
replace_node(m_mul, new_conv);
|
||||
MATCHER_SCOPE_ENABLE(ConvolutionBackpropDataMultiplyFusion);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -297,7 +295,6 @@ ngraph::pass::GroupConvolutionBackpropDataMultiplyFusion::GroupConvolutionBackpr
|
||||
new_conv->set_friendly_name(m_mul->get_friendly_name());
|
||||
copy_runtime_info({m_conv, m_mul}, {new_conv, final_const.get_node_shared_ptr(), weights_multiply});
|
||||
replace_node(m_mul, new_conv);
|
||||
MATCHER_SCOPE_ENABLE(GroupConvolutionBackpropDataMultiplyFusion);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ ngraph::pass::ConvToBinaryConv::ConvToBinaryConv() {
|
||||
auto mul = std::make_shared<opset5::Multiply>(add, op::Constant::create(element::f32, Shape{}, {0.5}));
|
||||
copy_runtime_info(conv, {new_conv, add, mul});
|
||||
replace_node(conv, mul);
|
||||
MATCHER_SCOPE_ENABLE(ConvToBinaryConv);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ ov::pass::EnableDecompressionConvertConstantFolding::EnableDecompressionConvertC
|
||||
if (!ov::is_decompression(node))
|
||||
return false;
|
||||
enable_constant_folding(node);
|
||||
MATCHER_SCOPE_ENABLE(EnableDecompressionConvertConstantFolding);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@ public:
|
||||
for (const auto& out_node : out_nodes) {
|
||||
ov::set_nms_selected_indices(out_node.get_node());
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(InitNMSPath);
|
||||
return true;
|
||||
};
|
||||
auto m = make_shared<pattern::Matcher>(nms_pattern, matcher_name);
|
||||
@@ -59,7 +58,6 @@ public:
|
||||
auto node = m.get_match_root();
|
||||
const auto& inputs = node->input_values();
|
||||
if (any_of(inputs.begin(), inputs.end(), [](const Output<Node>& output) {
|
||||
MATCHER_SCOPE_ENABLE(PropagateNMSPath);
|
||||
return ov::has_nms_selected_indices(output.get_node());
|
||||
})) {
|
||||
ov::set_nms_selected_indices(node.get());
|
||||
@@ -92,7 +90,6 @@ public:
|
||||
gather->input(1).replace_source_output(new_convert_to_unsigned);
|
||||
copy_runtime_info(gather, new_convert_to_unsigned);
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(UpdateConvertGather);
|
||||
return true;
|
||||
};
|
||||
auto m = make_shared<pattern::Matcher>(node_pattern, matcher_name);
|
||||
|
||||
@@ -170,7 +170,7 @@ ngraph::pass::ConvertQuantizeDequantize::ConvertQuantizeDequantize() {
|
||||
|
||||
copy_runtime_info({fq, convert1.get_node_shared_ptr(), convert2.get_node_shared_ptr()}, new_fq);
|
||||
replace_node(mul, new_fq);
|
||||
MATCHER_SCOPE_ENABLE(ConvertQuantizeDequantize);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -194,7 +194,6 @@ ngraph::pass::DepthToSpaceFusion::DepthToSpaceFusion() {
|
||||
depth_to_space->set_friendly_name(reshape_after->get_friendly_name());
|
||||
ngraph::copy_runtime_info({reshape_before, permute, reshape_after}, depth_to_space);
|
||||
ngraph::replace_node(reshape_after, depth_to_space);
|
||||
MATCHER_SCOPE_ENABLE(DepthToSpaceFusion);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ ngraph::pass::DilatedConvolutionConverter::DilatedConvolutionConverter() {
|
||||
},
|
||||
new_conv);
|
||||
replace_node(batch_to_space, new_conv);
|
||||
MATCHER_SCOPE_ENABLE(DilatedConvolutionConverter);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ ngraph::pass::DivideFusion::DivideFusion() {
|
||||
div->set_friendly_name(mul->get_friendly_name());
|
||||
copy_runtime_info({mul, pow}, div);
|
||||
replace_node(mul, div);
|
||||
MATCHER_SCOPE_ENABLE(DivideFusion);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -71,7 +71,6 @@ ov::pass::DivisionByZeroFP16Resolver::DivisionByZeroFP16Resolver() {
|
||||
normalized_fp16_min);
|
||||
copy_runtime_info(eps_const, new_constant);
|
||||
replace_node(eps_const, new_constant);
|
||||
MATCHER_SCOPE_ENABLE(DivisionByZeroFP16Resolver);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ ngraph::pass::DropoutWithRandomUniformReplacer::DropoutWithRandomUniformReplacer
|
||||
broadcast->set_friendly_name(ru->get_friendly_name());
|
||||
copy_runtime_info(ru, broadcast);
|
||||
ngraph::replace_node(ru, broadcast);
|
||||
MATCHER_SCOPE_ENABLE(DropoutWithRandomUniformReplacer);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -54,11 +54,11 @@ ngraph::pass::EliminateUnsqueezeGather::EliminateUnsqueezeGather() {
|
||||
|
||||
ngraph::copy_runtime_info(m_gather.get_node_shared_ptr(), m_unsqueeze.get_node_shared_ptr());
|
||||
m_gather.replace(m_unsqueezeInput);
|
||||
MATCHER_SCOPE_ENABLE(EliminateUnsqueezeGather);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
auto m = std::make_shared<ngraph::pattern::Matcher>(gather, "EliminateUnsqueezeGather");
|
||||
auto m = std::make_shared<ngraph::pattern::Matcher>(gather, matcher_name);
|
||||
register_matcher(m, callback);
|
||||
}
|
||||
|
||||
@@ -91,10 +91,9 @@ ngraph::pass::EliminateGatherUnsqueeze::EliminateGatherUnsqueeze() {
|
||||
new_gather->set_friendly_name(gather->get_friendly_name());
|
||||
ngraph::copy_runtime_info({unsqueeze, gather}, {new_gather, new_indices});
|
||||
ngraph::replace_node(unsqueeze, new_gather);
|
||||
MATCHER_SCOPE_ENABLE(EliminateGatherUnsqueeze);
|
||||
return true;
|
||||
};
|
||||
|
||||
auto m = std::make_shared<ngraph::pattern::Matcher>(unsqueeze_label, "EliminateGatherUnsqueeze");
|
||||
auto m = std::make_shared<ngraph::pattern::Matcher>(unsqueeze_label, matcher_name);
|
||||
register_matcher(m, callback);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,6 @@ ov::pass::FoldSubgraphEmptyInputs::FoldSubgraphEmptyInputs() {
|
||||
const_empty_replacement);
|
||||
}
|
||||
multi_subgraph_op->set_arguments(multi_subgraph_op_inputs);
|
||||
MATCHER_SCOPE_ENABLE(FoldSubgraphEmptyInputs);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -142,7 +142,7 @@ ngraph::pass::FakeQuantizeMulFusion::FakeQuantizeMulFusion() {
|
||||
|
||||
new_fq_node->set_friendly_name(mul_node->get_friendly_name());
|
||||
copy_runtime_info({fq_node, mul_node}, new_fq_node);
|
||||
MATCHER_SCOPE_ENABLE(FakeQuantizeMulFusion);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -77,7 +77,6 @@ ngraph::pass::FakeQuantizeReshapeFusion::FakeQuantizeReshapeFusion() {
|
||||
replace_node(reshape_node, new_fq_node);
|
||||
new_fq_node->set_friendly_name(reshape_node->get_friendly_name());
|
||||
copy_runtime_info({fq_node, reshape_node}, new_fq_node);
|
||||
MATCHER_SCOPE_ENABLE(FakeQuantizeReshapeFusion)
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -69,7 +69,6 @@ ngraph::pass::GeluFusionWithErfOne::GeluFusionWithErfOne() {
|
||||
},
|
||||
gelu);
|
||||
ngraph::replace_node(m.get_match_root(), gelu);
|
||||
MATCHER_SCOPE_ENABLE(GeluFusionWithErfOne)
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -129,7 +128,6 @@ ngraph::pass::GeluFusionWithErfTwo::GeluFusionWithErfTwo() {
|
||||
},
|
||||
gelu);
|
||||
ngraph::replace_node(m.get_match_root(), gelu);
|
||||
MATCHER_SCOPE_ENABLE(GeluFusionWithErfTwo);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -189,7 +187,6 @@ ngraph::pass::GeluFusionWithErfThree::GeluFusionWithErfThree() {
|
||||
},
|
||||
gelu);
|
||||
ngraph::replace_node(m.get_match_root(), gelu);
|
||||
MATCHER_SCOPE_ENABLE(GeluFusionWithErfThree);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -273,7 +270,6 @@ ngraph::pass::GeluFusionWithTanh::GeluFusionWithTanh() {
|
||||
},
|
||||
gelu);
|
||||
ngraph::replace_node(m.get_match_root(), gelu);
|
||||
MATCHER_SCOPE_ENABLE(GeluFusionWithTanh);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -55,7 +55,6 @@ ngraph::pass::HSigmoidFusionWithReluDiv::HSigmoidFusionWithReluDiv() {
|
||||
},
|
||||
hsigmoid);
|
||||
ngraph::replace_node(m.get_match_root(), hsigmoid);
|
||||
MATCHER_SCOPE_ENABLE(HSigmoidFusionWithReluDiv);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -103,7 +102,6 @@ ngraph::pass::HSigmoidFusionWithReluMul::HSigmoidFusionWithReluMul() {
|
||||
pattern_to_output.at(mul_second).get_node_shared_ptr()},
|
||||
hsigmoid);
|
||||
ngraph::replace_node(m.get_match_root(), hsigmoid);
|
||||
MATCHER_SCOPE_ENABLE(HSigmoidFusionWithReluMul);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -156,7 +154,6 @@ ngraph::pass::HSigmoidFusionWithoutRelu::HSigmoidFusionWithoutRelu() {
|
||||
pattern_to_output.at(div).get_node_shared_ptr()},
|
||||
hsigmoid);
|
||||
ngraph::replace_node(m.get_match_root(), hsigmoid);
|
||||
MATCHER_SCOPE_ENABLE(HSigmoidFusionWithoutRelu);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -203,7 +200,6 @@ ngraph::pass::HSigmoidFusionWithClampMul::HSigmoidFusionWithClampMul() {
|
||||
pattern_to_output.at(mul_first).get_node_shared_ptr()},
|
||||
hsigmoid);
|
||||
ngraph::replace_node(m.get_match_root(), hsigmoid);
|
||||
MATCHER_SCOPE_ENABLE(HSigmoidFusionWithClampMul);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -250,7 +246,6 @@ ngraph::pass::HSigmoidFusionWithClampDiv::HSigmoidFusionWithClampDiv() {
|
||||
pattern_to_output.at(div).get_node_shared_ptr()},
|
||||
hsigmoid);
|
||||
ngraph::replace_node(m.get_match_root(), hsigmoid);
|
||||
MATCHER_SCOPE_ENABLE(HSigmoidFusionWithClampDiv);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -60,7 +60,6 @@ ngraph::pass::HSwishFusionWithReluDiv::HSwishFusionWithReluDiv() {
|
||||
},
|
||||
hswish);
|
||||
ngraph::replace_node(m.get_match_root(), hswish);
|
||||
MATCHER_SCOPE_ENABLE(HSwishFusionWithReluDiv);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -113,7 +112,6 @@ ngraph::pass::HSwishFusionWithReluMul::HSwishFusionWithReluMul() {
|
||||
pattern_to_output.at(mul_second).get_node_shared_ptr()},
|
||||
hswish);
|
||||
ngraph::replace_node(m.get_match_root(), hswish);
|
||||
MATCHER_SCOPE_ENABLE(HSwishFusionWithReluMul);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -137,7 +135,6 @@ ngraph::pass::HSwishFusionWithHSigmoid::HSwishFusionWithHSigmoid() {
|
||||
hswish->set_friendly_name(mul->get_friendly_name());
|
||||
ngraph::copy_runtime_info({hsigmoid, mul}, hswish);
|
||||
ngraph::replace_node(mul, hswish);
|
||||
MATCHER_SCOPE_ENABLE(HSwishFusionWithHSigmoid);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -180,7 +177,6 @@ ngraph::pass::HSwishFusionWithClamp::HSwishFusionWithClamp() {
|
||||
pattern_to_output.at(mul).get_node_shared_ptr()},
|
||||
{hswish, new_mul_const, new_mul});
|
||||
ngraph::replace_node(m.get_match_root(), new_mul);
|
||||
MATCHER_SCOPE_ENABLE(HSwishFusionWithClampMul);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@ ngraph::pass::InterpolateSequenceFusion::InterpolateSequenceFusion() {
|
||||
new_interpolate->set_friendly_name(snd_interpolate->get_friendly_name());
|
||||
copy_runtime_info({fst_interpolate, snd_interpolate}, new_subgraph);
|
||||
replace_node(snd_interpolate, new_interpolate);
|
||||
MATCHER_SCOPE_ENABLE(InterpolateSequenceFusion);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ ngraph::pass::LeakyReluFusion::LeakyReluFusion() {
|
||||
copy_runtime_info({pattern_map.at(multiply_pattern).get_node_shared_ptr(), maximum.get_node_shared_ptr()},
|
||||
leaky_relu);
|
||||
replace_node(maximum.get_node_shared_ptr(), leaky_relu);
|
||||
MATCHER_SCOPE_ENABLE(LeakyReluFusion);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -55,7 +55,6 @@ ngraph::pass::AddMultiplyFusion::AddMultiplyFusion() {
|
||||
copy_runtime_info({add, mul}, {new_mul, new_add});
|
||||
new_add->set_friendly_name(mul->get_friendly_name());
|
||||
replace_node(mul, new_add);
|
||||
MATCHER_SCOPE_ENABLE(AddMultiplyFusion);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -90,7 +89,6 @@ ngraph::pass::AddAddFusion::AddAddFusion() {
|
||||
copy_runtime_info({add1, add2}, new_add);
|
||||
new_add->set_friendly_name(add2->get_friendly_name());
|
||||
replace_node(add2, new_add);
|
||||
MATCHER_SCOPE_ENABLE(AddAddFusion);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -126,7 +124,6 @@ ngraph::pass::MultiplyMultiplyFusion::MultiplyMultiplyFusion() {
|
||||
copy_runtime_info({mul1, mul2}, new_mul);
|
||||
new_mul->set_friendly_name(mul2->get_friendly_name());
|
||||
replace_node(mul2, new_mul);
|
||||
MATCHER_SCOPE_ENABLE(MultiplyMultiplyFusion);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ pass::MatMulMultiplyFusion::MatMulMultiplyFusion() {
|
||||
register_new_node(new_mm);
|
||||
copy_runtime_info({mul, weights.get_node_shared_ptr(), matmul}, {new_weights, new_mm});
|
||||
replace_node(mul, new_mm);
|
||||
MATCHER_SCOPE_ENABLE(MatMulMultiplyFusion);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@ ngraph::pass::MishFusion::MishFusion() {
|
||||
pattern_to_output.at(exp).get_node_shared_ptr()},
|
||||
mish);
|
||||
ngraph::replace_node(m.get_match_root(), mish);
|
||||
MATCHER_SCOPE_ENABLE(MishFusion);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@ ngraph::pass::MultiplyConvolutionFusion::MultiplyConvolutionFusion() {
|
||||
new_conv->set_friendly_name(conv->get_friendly_name());
|
||||
copy_runtime_info({conv, pattern_to_output.at(mul_pattern).get_node_shared_ptr()}, {new_weights, new_conv});
|
||||
replace_node(conv, new_conv);
|
||||
MATCHER_SCOPE_ENABLE(MultiplyConvolutionFusion);
|
||||
|
||||
return true;
|
||||
};
|
||||
@@ -124,7 +123,7 @@ ngraph::pass::MultiplyGroupConvolutionFusion::MultiplyGroupConvolutionFusion() {
|
||||
new_conv->set_friendly_name(conv->get_friendly_name());
|
||||
copy_runtime_info({conv, pattern_to_output.at(mul_pattern).get_node_shared_ptr()}, {new_weights, new_conv});
|
||||
replace_node(conv, new_conv);
|
||||
MATCHER_SCOPE_ENABLE(MultiplyGroupConvolutionFusion);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -191,7 +190,7 @@ ngraph::pass::MultiplyConvolutionBackpropDataFusion::MultiplyConvolutionBackprop
|
||||
new_conv->set_friendly_name(conv->get_friendly_name());
|
||||
copy_runtime_info({conv, pattern_to_output.at(mul_pattern).get_node_shared_ptr()}, {new_weights, new_conv});
|
||||
replace_node(conv, new_conv);
|
||||
MATCHER_SCOPE_ENABLE(MultiplyConvolutionBackpropDataFusion);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -261,7 +260,7 @@ ngraph::pass::MultiplyGroupConvolutionBackpropDataFusion::MultiplyGroupConvoluti
|
||||
new_conv->set_friendly_name(conv->get_friendly_name());
|
||||
copy_runtime_info({conv, pattern_to_output.at(mul_pattern).get_node_shared_ptr()}, {new_weights, new_conv});
|
||||
replace_node(conv, new_conv);
|
||||
MATCHER_SCOPE_ENABLE(MultiplyGroupConvolutionBackpropDataFusion);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -116,7 +116,6 @@ ngraph::pass::MulFakeQuantizeFusion::MulFakeQuantizeFusion() {
|
||||
{new_const, new_input_low, new_input_high, new_fq});
|
||||
new_fq->set_friendly_name(fq->get_friendly_name());
|
||||
replace_node(fq, new_fq);
|
||||
MATCHER_SCOPE_ENABLE(MulFakeQuantizeFusion);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -184,7 +184,6 @@ ngraph::pass::MVNFusionWithoutConstants::MVNFusionWithoutConstants() {
|
||||
mvn->set_friendly_name(m.get_match_root()->get_friendly_name());
|
||||
ngraph::copy_runtime_info(nodes_to_copy_info, mvn);
|
||||
ngraph::replace_node(m.get_match_root(), mvn);
|
||||
MATCHER_SCOPE_ENABLE(MVNFusionWithoutConstants);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -300,7 +299,6 @@ ngraph::pass::MVNFusionWithConstantsInside::MVNFusionWithConstantsInside() {
|
||||
{mvn, const_gamma_node, mul_gamma, const_beta_node, add_beta});
|
||||
add_beta->set_friendly_name(m.get_match_root()->get_friendly_name());
|
||||
ngraph::replace_node(m.get_match_root(), add_beta);
|
||||
MATCHER_SCOPE_ENABLE(MVNFusionWithConstantsInside);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -372,7 +372,7 @@ ngraph::pass::NearestNeighborUpsamplingFusion::NearestNeighborUpsamplingFusion()
|
||||
{reshape_2_node, mul_node, mul_const_node, concat_1_node, concat_2_node, ss_before_concat_1, shapeof_node},
|
||||
{scales_node, sizes_node, axes_node, interpolate});
|
||||
replace_node(reshape_2_node, interpolate);
|
||||
MATCHER_SCOPE_ENABLE(NearestNeighborUpsamplingFusion);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -277,7 +277,6 @@ static bool eliminate_unsqueeze(const std::shared_ptr<Node>& node) {
|
||||
MATCHER_SCOPE(NAME); \
|
||||
auto match_node = ngraph::pattern::wrap_type<OP>(); \
|
||||
ngraph::matcher_pass_callback callback = [=](ngraph::pattern::Matcher& m) { \
|
||||
MATCHER_SCOPE_ENABLE(NAME); \
|
||||
return FUNC(m.get_match_root()); \
|
||||
}; \
|
||||
auto m = std::make_shared<ngraph::pattern::Matcher>(match_node, matcher_name); \
|
||||
@@ -317,7 +316,7 @@ pass::EliminatePad::EliminatePad() {
|
||||
})) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(EliminatePad);
|
||||
|
||||
return replace_output_update_name(pad->output(0), pad->input_value(0));
|
||||
};
|
||||
|
||||
@@ -335,7 +334,6 @@ pass::EliminateConvert::EliminateConvert() {
|
||||
return false;
|
||||
}
|
||||
if (convert->get_input_element_type(0) == convert->get_element_type()) {
|
||||
MATCHER_SCOPE_ENABLE(EliminateConvert);
|
||||
return replace_output_update_name(convert->output(0), convert->input_value(0));
|
||||
}
|
||||
return false;
|
||||
@@ -357,7 +355,6 @@ pass::EliminateConvertNonZero::EliminateConvertNonZero() {
|
||||
convert->output(0).replace(convert->input_value(0));
|
||||
// to make this elimination recursive we register NonZero as a node which will be used to repeat matching
|
||||
register_new_node(m.get_match_root());
|
||||
MATCHER_SCOPE_ENABLE(EliminateConvertNonZero);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -372,7 +369,6 @@ pass::EliminateConcat::EliminateConcat() {
|
||||
matcher_pass_callback callback = [](pattern::Matcher& m) {
|
||||
auto concat = m.get_match_root();
|
||||
if (concat->inputs().size() == 1) {
|
||||
MATCHER_SCOPE_ENABLE(EliminateConcat);
|
||||
return replace_output_update_name(concat->output(0), concat->input_value(0));
|
||||
}
|
||||
return false;
|
||||
@@ -391,7 +387,6 @@ pass::EliminateSplit::EliminateSplit() {
|
||||
if (!split || split->get_num_splits() != 1) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(EliminateSplit);
|
||||
return replace_output_update_name(split->output(0), split->input_value(0));
|
||||
};
|
||||
|
||||
@@ -404,7 +399,6 @@ pass::EliminateSqueeze::EliminateSqueeze() {
|
||||
auto squeeze_pattern = pattern::wrap_type<opset8::Squeeze>();
|
||||
|
||||
matcher_pass_callback callback = [](pattern::Matcher& m) {
|
||||
MATCHER_SCOPE_ENABLE(EliminateSqueeze);
|
||||
const auto node = m.get_match_root();
|
||||
auto out_shape = node->get_output_partial_shape(0);
|
||||
// try to replace all unsqueeze/squeeze with reshape
|
||||
@@ -503,7 +497,6 @@ pass::EliminateTranspose::EliminateTranspose() {
|
||||
}
|
||||
|
||||
auto transpose = m.get_match_root();
|
||||
MATCHER_SCOPE_ENABLE(EliminateTranspose);
|
||||
return replace_output_update_name(transpose->output(0), transpose->input_value(0));
|
||||
};
|
||||
|
||||
@@ -527,7 +520,7 @@ pass::EliminateEltwise::EliminateEltwise() {
|
||||
if (!op::util::can_eliminate_eltwise_node(eltwise, constant, non_const_input)) {
|
||||
return false;
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(EliminateEltwise);
|
||||
|
||||
return replace_output_update_name(eltwise->output(0), non_const_input);
|
||||
};
|
||||
|
||||
|
||||
@@ -120,7 +120,6 @@ ngraph::pass::NormalizeL2Fusion::NormalizeL2Fusion() {
|
||||
|
||||
ngraph::copy_runtime_info(as_node_vector(outputs_to_replace), normalize_l2);
|
||||
ngraph::replace_node(m.get_match_root(), normalize_l2);
|
||||
MATCHER_SCOPE_ENABLE(NormalizeL2Fusion);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ pass::PadFusionAvgPool::PadFusionAvgPool() {
|
||||
|
||||
copy_runtime_info({pad, avg_pool}, new_avg_pool);
|
||||
replace_node(avg_pool, new_avg_pool);
|
||||
MATCHER_SCOPE_ENABLE(PadFusionAvgPool);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -218,7 +218,7 @@ pass::PadFusionConvolution::PadFusionConvolution() {
|
||||
|
||||
copy_runtime_info({pad, conv}, new_conv);
|
||||
replace_node(conv, new_conv);
|
||||
MATCHER_SCOPE_ENABLE(PadFusionConvolution);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -276,7 +276,7 @@ pass::PadFusionConvolutionBackpropData::PadFusionConvolutionBackpropData() {
|
||||
|
||||
copy_runtime_info({pad, conv}, new_conv);
|
||||
replace_node(conv, new_conv);
|
||||
MATCHER_SCOPE_ENABLE(PadFusionConvolutionBackpropData);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -324,7 +324,7 @@ pass::PadFusionGroupConvolution::PadFusionGroupConvolution() {
|
||||
|
||||
copy_runtime_info({pad, conv}, new_conv);
|
||||
replace_node(conv, new_conv);
|
||||
MATCHER_SCOPE_ENABLE(PadFusionGroupConvolution);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -382,7 +382,7 @@ pass::PadFusionGroupConvolutionBackpropData::PadFusionGroupConvolutionBackpropDa
|
||||
|
||||
copy_runtime_info({pad, conv}, new_conv);
|
||||
replace_node(conv, new_conv);
|
||||
MATCHER_SCOPE_ENABLE(PadFusionGroupConvolutionBackpropData);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -47,7 +47,6 @@ ngraph::pass::PReluFusionNegativeAdd::PReluFusionNegativeAdd() {
|
||||
pattern_to_output.at(add).get_node_shared_ptr()};
|
||||
ngraph::copy_runtime_info(copy_from, prelu);
|
||||
ngraph::replace_node(add_node, prelu);
|
||||
MATCHER_SCOPE_ENABLE(PReluFusionNegativeAdd);
|
||||
return true;
|
||||
};
|
||||
auto m = std::make_shared<ngraph::pattern::Matcher>(add, matcher_name);
|
||||
@@ -78,7 +77,6 @@ ngraph::pass::PReluFusionNegativeSub::PReluFusionNegativeSub() {
|
||||
pattern_to_output.at(sub).get_node_shared_ptr()};
|
||||
ngraph::copy_runtime_info(copy_from, prelu);
|
||||
ngraph::replace_node(sub_node, prelu);
|
||||
MATCHER_SCOPE_ENABLE(PReluFusionNegativeSub);
|
||||
return true;
|
||||
};
|
||||
auto m = std::make_shared<ngraph::pattern::Matcher>(sub, matcher_name);
|
||||
@@ -126,7 +124,6 @@ ngraph::pass::PReluFusionMultiplyAdd::PReluFusionMultiplyAdd() {
|
||||
pattern_to_output.at(add).get_node_shared_ptr()};
|
||||
ngraph::copy_runtime_info(copy_from, {prelu, negative});
|
||||
ngraph::replace_node(add_node, prelu);
|
||||
MATCHER_SCOPE_ENABLE(PReluFusionMultiplyAdd);
|
||||
return true;
|
||||
};
|
||||
auto m = std::make_shared<ngraph::pattern::Matcher>(add, matcher_name);
|
||||
@@ -159,7 +156,6 @@ ngraph::pass::PReluFusionMultiplySub::PReluFusionMultiplySub() {
|
||||
pattern_to_output.at(sub).get_node_shared_ptr()};
|
||||
ngraph::copy_runtime_info(copy_from, prelu);
|
||||
ngraph::replace_node(sub_node, prelu);
|
||||
MATCHER_SCOPE_ENABLE(PReluFusionMultiplySub);
|
||||
return true;
|
||||
};
|
||||
auto m = std::make_shared<ngraph::pattern::Matcher>(sub, matcher_name);
|
||||
|
||||
@@ -74,7 +74,7 @@ ngraph::pass::PullTransposeThroughFQUp::PullTransposeThroughFQUp() {
|
||||
new_fq->set_friendly_name(transpose->get_friendly_name());
|
||||
ngraph::copy_runtime_info({fq, transpose}, new_ops);
|
||||
ngraph::replace_node(transpose, new_fq);
|
||||
MATCHER_SCOPE_ENABLE(PullTransposeThroughFQUp);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ ngraph::pass::RandomUniformFusion::RandomUniformFusion() {
|
||||
new_ru->set_friendly_name(m.get_match_root()->get_friendly_name());
|
||||
ngraph::replace_node(m.get_match_root(), new_ru);
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(RandomUniformFusion);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -93,7 +93,6 @@ pass::ReduceMerge::ReduceMerge() {
|
||||
reduce_sum_pattern});
|
||||
|
||||
ngraph::matcher_pass_callback callback = [=](ngraph::pattern::Matcher& m) {
|
||||
MATCHER_SCOPE_ENABLE(ReduceMerge);
|
||||
const auto node = m.get_match_root();
|
||||
if (ov::is_type<op::util::ArithmeticReductionKeepDims>(node)) {
|
||||
return fuse_reduce_operations<op::util::ArithmeticReductionKeepDims>(node);
|
||||
|
||||
@@ -51,7 +51,7 @@ ngraph::pass::ReluFakeQuantizeFusion::ReluFakeQuantizeFusion() {
|
||||
|
||||
copy_runtime_info({relu.get_node_shared_ptr(), fq}, new_fq);
|
||||
replace_node(fq, new_fq);
|
||||
MATCHER_SCOPE_ENABLE(ReluFakeQuantizeFusion);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ ov::pass::RemoveConcatZeroDimInput::RemoveConcatZeroDimInput() {
|
||||
MATCHER_SCOPE(RemoveConcatZeroDimInput);
|
||||
auto concat_pattern = pattern::wrap_type<opset8::Concat>();
|
||||
ngraph::matcher_pass_callback callback = [=](pattern::Matcher& m) {
|
||||
MATCHER_SCOPE_ENABLE(RemoveConcatZeroDimInput);
|
||||
auto concat = m.get_match_root();
|
||||
auto concat_inputs = concat->input_values();
|
||||
concat_inputs.erase(
|
||||
|
||||
@@ -108,7 +108,7 @@ ngraph::pass::RemoveFilteringBoxesBySize::RemoveFilteringBoxesBySize() {
|
||||
range->set_friendly_name(output->get_friendly_name());
|
||||
// TODO: add copy_runtime_info
|
||||
ngraph::replace_node(output, range);
|
||||
MATCHER_SCOPE_ENABLE(RemoveFilteringBoxesBySize);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ ov::pass::RemoveMultiSubGraphOpDanglingParams::RemoveMultiSubGraphOpDanglingPara
|
||||
MATCHER_SCOPE(RemoveMultiSubGraphOpDanglingParams);
|
||||
auto multi_subgraph_op_pattern = pattern::wrap_type<op::util::MultiSubGraphOp>();
|
||||
ov::matcher_pass_callback callback = [=](pattern::Matcher& m) {
|
||||
MATCHER_SCOPE_ENABLE(RemoveMultiSubGraphOpDanglingParams);
|
||||
auto multi_subgraph_op = std::dynamic_pointer_cast<op::util::MultiSubGraphOp>(m.get_match_root());
|
||||
if (multi_subgraph_op == nullptr) {
|
||||
return false;
|
||||
|
||||
@@ -108,7 +108,6 @@ ngraph::pass::ReshapeSequenceFusion::ReshapeSequenceFusion(bool use_shape_for_el
|
||||
return false; // because root node wasn't replaced
|
||||
}
|
||||
|
||||
MATCHER_SCOPE_ENABLE(ReshapeSequenceFusion);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -221,7 +221,6 @@ public:
|
||||
|
||||
// Mark-up RIC output
|
||||
ric_attr::init(concat, order, concat->get_axis());
|
||||
MATCHER_SCOPE_ENABLE(SplitConcat);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -278,7 +277,6 @@ public:
|
||||
return false;
|
||||
}
|
||||
ric_attr::init(output, order_values, axis_value);
|
||||
MATCHER_SCOPE_ENABLE(Gather);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -385,7 +383,6 @@ public:
|
||||
}
|
||||
|
||||
ric_attr::set(m.get_match_value(), ric);
|
||||
MATCHER_SCOPE_ENABLE(Binary);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -440,7 +437,6 @@ public:
|
||||
} else {
|
||||
ric_attr::set(conv->input(1), ric);
|
||||
}
|
||||
MATCHER_SCOPE_ENABLE(Convolution);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -516,7 +512,6 @@ public:
|
||||
|
||||
ric.set_order(new_order);
|
||||
ric_attr::set(conv->output(0), ric);
|
||||
MATCHER_SCOPE_ENABLE(GroupConvolution);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -533,7 +528,6 @@ public:
|
||||
|
||||
auto callback = [=](pattern::Matcher& m) {
|
||||
// Skip propagation for ShapeOf path
|
||||
MATCHER_SCOPE_ENABLE(ShapeOf);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -554,7 +548,6 @@ public:
|
||||
if (!ric_attr::has(root->input_value(0)))
|
||||
return false;
|
||||
ric_attr::set(root->output(0), ric_attr::get(root->input_value(0)).propagate());
|
||||
MATCHER_SCOPE_ENABLE(PassThrough);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -584,7 +577,6 @@ public:
|
||||
ric.set_axis(new_axis);
|
||||
|
||||
ric_attr::set(m.get_match_value(), ric);
|
||||
MATCHER_SCOPE_ENABLE(Transpose);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -631,7 +623,6 @@ public:
|
||||
MATCHER_SCOPE(InsertReverseInputChannel);
|
||||
auto pattern_root = pattern::any_input();
|
||||
auto callback = [](pattern::Matcher& m) {
|
||||
MATCHER_SCOPE_ENABLE(InsertReverseInputChannel);
|
||||
const auto& node = m.get_match_root();
|
||||
for (const auto& input : node->inputs()) {
|
||||
if (!ric_attr::has(input))
|
||||
@@ -662,7 +653,6 @@ public:
|
||||
auto output = pattern_map.at(pattern_root);
|
||||
auto input = pattern_map.at(input_p);
|
||||
output.replace(input);
|
||||
MATCHER_SCOPE_ENABLE(EraseSplitConcat);
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -679,7 +669,6 @@ public:
|
||||
auto pattern_root = pattern::wrap_type<opset8::Gather>({input_p, pattern::any_input(), pattern::any_input()},
|
||||
need_to_erase_ric);
|
||||
auto callback = [=](pattern::Matcher& m) {
|
||||
MATCHER_SCOPE_ENABLE(EraseGather);
|
||||
const auto& pattern_map = m.get_pattern_value_map();
|
||||
auto output = pattern_map.at(pattern_root);
|
||||
auto input = pattern_map.at(input_p);
|
||||
|
||||
@@ -151,7 +151,6 @@ ngraph::pass::ShuffleChannelsFusion::ShuffleChannelsFusion(const bool reshape_co
|
||||
shuffle_shannels->set_friendly_name(reshape_after->get_friendly_name());
|
||||
ngraph::copy_runtime_info({reshape_before, transpose, reshape_after}, shuffle_shannels);
|
||||
ngraph::replace_node(reshape_after, shuffle_shannels);
|
||||
MATCHER_SCOPE_ENABLE(ShuffleChannelsFusion);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -63,7 +63,6 @@ ngraph::pass::GroupedGatherElimination::GroupedGatherElimination() {
|
||||
auto concat_label = ngraph::pattern::wrap_type<ngraph::opset1::Concat>(pattern::rank_equals(1));
|
||||
|
||||
ngraph::matcher_pass_callback callback = [=](pattern::Matcher& m) {
|
||||
MATCHER_SCOPE_ENABLE(GroupedGatherElimination);
|
||||
auto concat = m.get_match_root();
|
||||
OutputVector inputs = concat->input_values();
|
||||
NodeVector new_ops;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user