From 52e2c83e58595a3d468216ef42f6d1a509a9371c Mon Sep 17 00:00:00 2001 From: Pei Yang Date: Tue, 20 Jul 2021 19:05:34 +0800 Subject: [PATCH] optimize fusion pass logs to avoid duplication (#34261) --- paddle/fluid/framework/ir/fuse_pass_base.cc | 2 ++ paddle/fluid/framework/ir/graph_pattern_detector.cc | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/framework/ir/fuse_pass_base.cc b/paddle/fluid/framework/ir/fuse_pass_base.cc index 9dfc8bf6037..4f89750daee 100644 --- a/paddle/fluid/framework/ir/fuse_pass_base.cc +++ b/paddle/fluid/framework/ir/fuse_pass_base.cc @@ -53,6 +53,8 @@ void FusePassBase::AddStatis(int count_of_fused) const { auto& info = graph_->Get>(kFuseStatisAttr); info[repr_] = count_of_fused; + if (count_of_fused > 0) + LOG(INFO) << "--- detected " << count_of_fused << " subgraphs"; } FuseOptions FusePassBase::FindFuseOption(const Node& node1, diff --git a/paddle/fluid/framework/ir/graph_pattern_detector.cc b/paddle/fluid/framework/ir/graph_pattern_detector.cc index 7717bcfc3e9..9d06a4de954 100644 --- a/paddle/fluid/framework/ir/graph_pattern_detector.cc +++ b/paddle/fluid/framework/ir/graph_pattern_detector.cc @@ -88,7 +88,7 @@ void GraphPatternDetector::operator()(Graph *graph, ValidateByNodeRole(&subgraphs); if (subgraphs.empty()) return; - LOG(INFO) << "--- detected " << subgraphs.size() << " subgraphs"; + int id = 0; for (auto &g : subgraphs) { VLOG(3) << "optimizing #" << id++ << " subgraph"; -- GitLab