Fix CC issues for transformation and snippets (#11798)

* Fix CC issues for transformation and snippets

Matcher should be enabled if it was hit during analyze stage.

* Fixed 3 naming issue
This commit is contained in:
River Li 2022-06-13 13:36:35 +08:00 committed by GitHub
parent c848e138f8
commit 0571124fd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
192 changed files with 274 additions and 73 deletions

View File

@ -20,6 +20,7 @@ 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)
@ -35,9 +36,11 @@ 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

View File

@ -102,6 +102,7 @@ AddTransformation::AddTransformation(const Params& params) : EltwiseBaseTransfor
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(AddTransformation);
return transform(*context, m);
};

View File

@ -39,6 +39,7 @@ AssignAndReadValueTransformation::AssignAndReadValueTransformation(const std::sh
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(AssignAndReadValueTransformation);
return transform(*context, m);
};

View File

@ -26,6 +26,7 @@ AvgPoolTransformation::AvgPoolTransformation(const Params& params) : LayerTransf
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(AvgPoolTransformation);
return transform(*context, m);
};

View File

@ -24,6 +24,7 @@ ClampTransformation::ClampTransformation(const Params& params) : LayerTransforma
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(ClampTransformation);
return transform(*context, m);
};

View File

@ -30,7 +30,7 @@ ConcatTransformation::ConcatTransformation(const Params& params) : LayerTransfor
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(ConcatTransformation);
return transform(*context, m);
};

View File

@ -29,6 +29,7 @@ ConvertTransformation::ConvertTransformation(const Params& params) : LayerTransf
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(ConvertTransformation);
return transform(*context, m);
};

View File

@ -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;
};

View File

@ -36,6 +36,7 @@ ConvolutionTransformation::ConvolutionTransformation(const Params& params) : Wei
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(ConvolutionTransformation);
return transform(*context, m);
};

View File

@ -48,6 +48,7 @@ ConvolutionBackpropDataTransformation::ConvolutionBackpropDataTransformation(con
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(ConvolutionBackpropDataTransformation);
return transform(*context, m);
};

View File

@ -22,6 +22,7 @@ DepthToSpaceTransformation::DepthToSpaceTransformation(const Params& params) : T
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(DepthToSpaceTransformation);
return transform(*context, m);
};

View File

@ -25,7 +25,7 @@ FakeQuantizeTransformation::FakeQuantizeTransformation(const Params& params) : L
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(FakeQuantizeTransformation);
return transform(*context, m);
};

View File

@ -29,7 +29,7 @@ FakeQuantizeDecompositionTransformation::FakeQuantizeDecompositionTransformation
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(FakeQuantizeDecompositionTransformation);
return transform(*context, m);
};

View File

@ -24,6 +24,7 @@ FoldConvertTransformation::FoldConvertTransformation(const Params& params) : Lay
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(FoldConvertTransformation);
return transform(*context, m);
};

View File

@ -25,6 +25,7 @@ FoldFakeQuantizeTransformation::FoldFakeQuantizeTransformation(const Params& par
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(FoldFakeQuantizeTransformation);
return transform(*context, m);
};

View File

@ -38,6 +38,7 @@ FuseConvertTransformation::FuseConvertTransformation(const Params& params) : Lay
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(FuseConvertTransformation);
return transform(*context, m);
};

View File

@ -24,6 +24,7 @@ FuseMultiplyToFakeQuantizeTransformation::FuseMultiplyToFakeQuantizeTransformati
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(FuseMultiplyToFakeQuantizeTransformation);
return transform(*context, m);
};

View File

@ -23,6 +23,7 @@ FuseSubtractToFakeQuantizeTransformation::FuseSubtractToFakeQuantizeTransformati
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(FuseSubtractToFakeQuantizeTransformation);
return transform(*context, m);
};

View File

@ -25,6 +25,7 @@ GroupConvolutionTransformation::GroupConvolutionTransformation(const Params& par
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(GroupConvolutionTransformation);
return transform(*context, m);
};

View File

@ -42,6 +42,7 @@ InterpolateTransformation::InterpolateTransformation(const Params& params) : Lay
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(InterpolateTransformation);
return transform(*context, m);
};

View File

@ -127,6 +127,7 @@ 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;
};

View File

@ -31,6 +31,7 @@ MatMulTransformation::MatMulTransformation(const Params& params) : LayerTransfor
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(MatMulTransformation);
return transform(*context, m);
};

View File

@ -26,6 +26,7 @@ MaxPoolTransformation::MaxPoolTransformation(const Params& params) : LayerTransf
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(MaxPoolTransformation);
return transform(*context, m);
};

View File

@ -21,7 +21,7 @@ namespace pass {
namespace low_precision {
MoveFakeQuantize::MoveFakeQuantize(const Params& params) : LayerTransformation(params) {
MATCHER_SCOPE(MaxPoolTransformation);
MATCHER_SCOPE(MoveFakeQuantize);
const auto concat = ngraph::pattern::wrap_type<opset1::Concat>(pattern::consumers_count(1));
const auto operation = ngraph::pattern::wrap_type<opset1::Relu>({ concat });
const auto input_low = ngraph::pattern::wrap_type<ngraph::opset1::Constant>();
@ -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);
};

View File

@ -31,6 +31,7 @@ MultiplyTransformation::MultiplyTransformation(const Params& params) : EltwiseBa
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(MultiplyTransformation);
return transform(*context, m);
};

View File

@ -24,6 +24,7 @@ MultiplyToGroupConvolutionTransformation::MultiplyToGroupConvolutionTransformati
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(MultiplyToGroupConvolutionTransformation);
return transform(*context, m);
};

View File

@ -53,6 +53,7 @@ MVNTransformation::MVNTransformation(const Params& params) : LayerTransformation
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(MVNTransformation);
return transform(*context, m);
};

View File

@ -46,6 +46,7 @@ NormalizeL2Transformation::NormalizeL2Transformation(const Params& params) : Lay
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(NormalizeL2Transformation);
return transform(*context, m);
};

View File

@ -28,6 +28,7 @@ PadTransformation::PadTransformation(const Params& params) : LayerTransformation
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(PadTransformation);
return transform(*context, m);
};

View File

@ -27,6 +27,7 @@ PReluTransformation::PReluTransformation(const Params& params) : LayerTransforma
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(PReluTransformation)
return transform(*context, m);
};

View File

@ -132,7 +132,7 @@ ngraph::pass::low_precision::PullReshapeThroughDequantization::PullReshapeThroug
THROW_IE_LPT_EXCEPTION(*parent) << "unexepcted operation type";
}
}
MATCHER_SCOPE_ENABLE(PullReshapeThroughDequantization);
return true;
};

View File

@ -125,7 +125,7 @@ ngraph::pass::low_precision::PullTransposeThroughDequantization::PullTransposeTh
THROW_IE_LPT_EXCEPTION(*parent) << "unexepcted operation type";
}
}
MATCHER_SCOPE_ENABLE(PullTransposeThroughDequantization);
return true;
};

View File

@ -23,6 +23,7 @@ ReduceMaxTransformation::ReduceMaxTransformation(const Params& params) : ReduceB
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(ReduceMaxTransformation);
return transform(*context, m);
};

View File

@ -23,6 +23,7 @@ ReduceMeanTransformation::ReduceMeanTransformation(const Params& params) : Reduc
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(ReduceMeanTransformation);
return transform(*context, m);
};

View File

@ -23,6 +23,7 @@ ReduceMinTransformation::ReduceMinTransformation(const Params& params) : ReduceB
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(ReduceMinTransformation);
return transform(*context, m);
};

View File

@ -23,6 +23,7 @@ ReduceSumTransformation::ReduceSumTransformation(const Params& params) : ReduceB
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(ReduceSumTransformation);
return transform(*context, m);
};

View File

@ -27,6 +27,7 @@ ReluTransformation::ReluTransformation(const Params& params) : LayerTransformati
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(ReluTransformation);
return transform(*context, m);
};

View File

@ -46,7 +46,7 @@ ReshapeTransformation::ReshapeTransformation(const Params& params) : LayerTransf
return false;
}
}
MATCHER_SCOPE_ENABLE(ReshapeTransformation);
return transform(*context, m);
};

View File

@ -26,6 +26,7 @@ ShuffleChannelsTransformation::ShuffleChannelsTransformation(const Params& param
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(ShuffleChannelsTransformation);
return transform(*context, m);
};

View File

@ -23,6 +23,7 @@ SplitTransformation::SplitTransformation(const Params& params) : LayerTransforma
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(SplitTransformation);
return transform(*context, m);
};

View File

@ -26,6 +26,7 @@ SqueezeTransformation::SqueezeTransformation(const Params& params) : LayerTransf
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(SqueezeTransformation);
return transform(*context, m);
};

View File

@ -89,6 +89,7 @@ StridedSliceTransformation::StridedSliceTransformation(const Params& params) : L
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(StridedSliceTransformation);
return transform(*context, m);
};

View File

@ -34,6 +34,7 @@ SubtractTransformation::SubtractTransformation(const Params& params) : LayerTran
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(SubtractTransformation);
return transform(*context, m);
};

View File

@ -26,6 +26,7 @@ TransposeTransformation::TransposeTransformation(const Params& params) : LayerTr
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(TransposeTransformation);
return transform(*context, m);
};

View File

@ -26,6 +26,7 @@ UnsqueezeTransformation::UnsqueezeTransformation(const Params& params) : LayerTr
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(UnsqueezeTransformation);
return transform(*context, m);
};

View File

@ -26,6 +26,7 @@ VariadicSplitTransformation::VariadicSplitTransformation(const Params& params) :
if (transformation_callback(op)) {
return false;
}
MATCHER_SCOPE_ENABLE(VariadicSplitTransformation);
return transform(*context, m);
};

View File

@ -523,6 +523,7 @@ 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);

View File

@ -21,7 +21,7 @@ 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);

View File

@ -24,7 +24,7 @@ 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);

View File

@ -41,7 +41,7 @@ ngraph::snippets::pass::InsertLoad::InsertLoad() {
}
}
}
MATCHER_SCOPE_ENABLE(InsertLoad);
return rewritten;
});
}
@ -64,6 +64,7 @@ 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;
});
}

View File

@ -166,7 +166,7 @@ ngraph::snippets::pass::InsertMoveBroadcast::InsertMoveBroadcast() {
}
reset_broacast_config(root);
MATCHER_SCOPE_ENABLE(InsertMoveBroadcast);
return true;
};

View File

@ -50,6 +50,7 @@ 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;

View File

@ -24,6 +24,7 @@ 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;
});
}
@ -41,6 +42,7 @@ 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;
});
}

View File

@ -120,6 +120,7 @@ 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;
};

View File

@ -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;
};

View File

@ -199,6 +199,7 @@ 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;
};

View File

@ -64,7 +64,7 @@ ngraph::pass::ClampFusion::ClampFusion() {
copy_runtime_info(nodes, clamp);
replace_node(root_node, clamp);
MATCHER_SCOPE_ENABLE(ClampFusion);
return true;
};

View File

@ -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;
};

View File

@ -69,6 +69,7 @@ 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;
};

View File

@ -73,6 +73,7 @@ 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;
};
@ -160,7 +161,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;
};
@ -227,6 +228,7 @@ 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;
};
@ -295,6 +297,7 @@ 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;
};

View File

@ -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;
}

View File

@ -21,6 +21,7 @@ ov::pass::EnableDecompressionConvertConstantFolding::EnableDecompressionConvertC
if (!ov::is_decompression(node))
return false;
enable_constant_folding(node);
MATCHER_SCOPE_ENABLE(EnableDecompressionConvertConstantFolding);
return true;
};

View File

@ -33,6 +33,7 @@ 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);
@ -58,6 +59,7 @@ 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());
@ -90,6 +92,7 @@ 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);

View File

@ -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;
};

View File

@ -194,6 +194,7 @@ 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;
};

View File

@ -89,7 +89,7 @@ ngraph::pass::DilatedConvolutionConverter::DilatedConvolutionConverter() {
},
new_conv);
replace_node(batch_to_space, new_conv);
MATCHER_SCOPE_ENABLE(DilatedConvolutionConverter);
return true;
};

View File

@ -37,6 +37,7 @@ 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;
};

View File

@ -71,6 +71,7 @@ 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;
};

View File

@ -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;
};

View File

@ -54,7 +54,7 @@ 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;
};
@ -91,6 +91,7 @@ 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;
};

View File

@ -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;
};

View File

@ -77,6 +77,7 @@ 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;
};

View File

@ -69,6 +69,7 @@ ngraph::pass::GeluFusionWithErfOne::GeluFusionWithErfOne() {
},
gelu);
ngraph::replace_node(m.get_match_root(), gelu);
MATCHER_SCOPE_ENABLE(GeluFusionWithErfOne)
return true;
};
@ -128,6 +129,7 @@ ngraph::pass::GeluFusionWithErfTwo::GeluFusionWithErfTwo() {
},
gelu);
ngraph::replace_node(m.get_match_root(), gelu);
MATCHER_SCOPE_ENABLE(GeluFusionWithErfTwo);
return true;
};
@ -187,6 +189,7 @@ ngraph::pass::GeluFusionWithErfThree::GeluFusionWithErfThree() {
},
gelu);
ngraph::replace_node(m.get_match_root(), gelu);
MATCHER_SCOPE_ENABLE(GeluFusionWithErfThree);
return true;
};
@ -270,6 +273,7 @@ ngraph::pass::GeluFusionWithTanh::GeluFusionWithTanh() {
},
gelu);
ngraph::replace_node(m.get_match_root(), gelu);
MATCHER_SCOPE_ENABLE(GeluFusionWithTanh);
return true;
};

View File

@ -55,6 +55,7 @@ ngraph::pass::HSigmoidFusionWithReluDiv::HSigmoidFusionWithReluDiv() {
},
hsigmoid);
ngraph::replace_node(m.get_match_root(), hsigmoid);
MATCHER_SCOPE_ENABLE(HSigmoidFusionWithReluDiv);
return true;
};
@ -102,6 +103,7 @@ 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;
};
@ -154,6 +156,7 @@ 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;
};
@ -200,6 +203,7 @@ 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;
};
@ -246,6 +250,7 @@ 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;
};

View File

@ -60,6 +60,7 @@ ngraph::pass::HSwishFusionWithReluDiv::HSwishFusionWithReluDiv() {
},
hswish);
ngraph::replace_node(m.get_match_root(), hswish);
MATCHER_SCOPE_ENABLE(HSwishFusionWithReluDiv);
return true;
};
@ -112,6 +113,7 @@ 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;
};
@ -135,6 +137,7 @@ 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;
};
@ -177,6 +180,7 @@ 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;
};

View File

@ -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;
};

View File

@ -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;
};

View File

@ -55,6 +55,7 @@ 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;
};
@ -89,6 +90,7 @@ 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;
};
@ -124,6 +126,7 @@ 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;
};

View File

@ -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;
};

View File

@ -35,6 +35,7 @@ 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;
};

View File

@ -58,6 +58,7 @@ 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;
};
@ -123,7 +124,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;
};
@ -190,7 +191,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;
};
@ -260,7 +261,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;
};

View File

@ -116,6 +116,7 @@ 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;
};

View File

@ -184,6 +184,7 @@ 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;
};
@ -299,6 +300,7 @@ 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;
};

View File

@ -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;
};

View File

@ -277,6 +277,7 @@ 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); \
@ -316,7 +317,7 @@ pass::EliminatePad::EliminatePad() {
})) {
return false;
}
MATCHER_SCOPE_ENABLE(EliminatePad);
return replace_output_update_name(pad->output(0), pad->input_value(0));
};
@ -334,6 +335,7 @@ 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;
@ -355,6 +357,7 @@ 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;
};
@ -369,6 +372,7 @@ 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;
@ -379,7 +383,7 @@ pass::EliminateConcat::EliminateConcat() {
}
pass::EliminateSplit::EliminateSplit() {
MATCHER_SCOPE(EliminateConcat);
MATCHER_SCOPE(EliminateSplit);
auto convert_pattern = pattern::wrap_type<opset8::Split>();
matcher_pass_callback callback = [](pattern::Matcher& m) {
@ -387,6 +391,7 @@ 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));
};
@ -399,6 +404,7 @@ 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
@ -497,6 +503,7 @@ 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));
};
@ -520,7 +527,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);
};

View File

@ -120,6 +120,7 @@ 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;
};

View File

@ -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;
};

View File

@ -47,6 +47,7 @@ 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);
@ -77,6 +78,7 @@ 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);
@ -124,6 +126,7 @@ 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);
@ -156,6 +159,7 @@ 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);

View File

@ -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;
};

View File

@ -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;
};

View File

@ -93,6 +93,7 @@ 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);

View File

@ -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;
};

View File

@ -18,6 +18,7 @@ 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(

View File

@ -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;
};

View File

@ -18,6 +18,7 @@ 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;

View File

@ -108,6 +108,7 @@ ngraph::pass::ReshapeSequenceFusion::ReshapeSequenceFusion(bool use_shape_for_el
return false; // because root node wasn't replaced
}
MATCHER_SCOPE_ENABLE(ReshapeSequenceFusion);
return true;
};

View File

@ -221,6 +221,7 @@ public:
// Mark-up RIC output
ric_attr::init(concat, order, concat->get_axis());
MATCHER_SCOPE_ENABLE(SplitConcat);
return true;
};
@ -277,6 +278,7 @@ public:
return false;
}
ric_attr::init(output, order_values, axis_value);
MATCHER_SCOPE_ENABLE(Gather);
return true;
};
@ -383,6 +385,7 @@ public:
}
ric_attr::set(m.get_match_value(), ric);
MATCHER_SCOPE_ENABLE(Binary);
return true;
};
@ -437,6 +440,7 @@ public:
} else {
ric_attr::set(conv->input(1), ric);
}
MATCHER_SCOPE_ENABLE(Convolution);
return true;
};
@ -512,6 +516,7 @@ public:
ric.set_order(new_order);
ric_attr::set(conv->output(0), ric);
MATCHER_SCOPE_ENABLE(GroupConvolution);
return true;
};
@ -528,6 +533,7 @@ public:
auto callback = [=](pattern::Matcher& m) {
// Skip propagation for ShapeOf path
MATCHER_SCOPE_ENABLE(ShapeOf);
return true;
};
@ -548,6 +554,7 @@ 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;
};
@ -577,6 +584,7 @@ public:
ric.set_axis(new_axis);
ric_attr::set(m.get_match_value(), ric);
MATCHER_SCOPE_ENABLE(Transpose);
return true;
};
@ -623,6 +631,7 @@ 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))
@ -653,6 +662,7 @@ public:
auto output = pattern_map.at(pattern_root);
auto input = pattern_map.at(input_p);
output.replace(input);
MATCHER_SCOPE_ENABLE(EraseSplitConcat);
return true;
};
@ -669,6 +679,7 @@ 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);

View File

@ -151,6 +151,7 @@ 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;
};

View File

@ -63,6 +63,7 @@ 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;

View File

@ -82,7 +82,7 @@ ngraph::pass::SkipGatherBeforeTransposeAndReshape::SkipGatherBeforeTransposeAndR
new_transpose->set_friendly_name(transpose->get_friendly_name());
ngraph::copy_runtime_info({transpose, gather}, new_transpose);
ngraph::replace_node(transpose, new_transpose);
MATCHER_SCOPE_ENABLE(SkipGatherBeforeTransposeAndReshape);
return false;
};

Some files were not shown because too many files have changed in this diff Show More