From 4d19add4629e525e0487f6aac17223d9bc50e597 Mon Sep 17 00:00:00 2001 From: huanruizhi Date: Wed, 19 Apr 2023 19:08:33 +0800 Subject: [PATCH] add debug log --- .../optimizers/om_partition_subgraphs_pass.cc | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tf_adapter/optimizers/om_partition_subgraphs_pass.cc b/tf_adapter/optimizers/om_partition_subgraphs_pass.cc index 21dcd05e6..d3354e7f0 100644 --- a/tf_adapter/optimizers/om_partition_subgraphs_pass.cc +++ b/tf_adapter/optimizers/om_partition_subgraphs_pass.cc @@ -607,6 +607,7 @@ Status FindNpuSupportCandidates(const Graph &graph, OrderedNodeSet *candidates, !IsVariableExecuteOnHost(node, pass_options["variable_location"])) { (void) candidates->insert(node); } else { + ADP_LOG(INFO) << "node:" << node->name() << "is not supported on npu."; (void) outSet.insert(node); } } @@ -628,6 +629,8 @@ Status FindNpuSupportCandidates(const Graph &graph, OrderedNodeSet *candidates, for (auto it = candidates->cbegin(); it != candidates->cend();) { auto cfInfo = cfInfos[static_cast((*it)->id())]; if (unsupportedFrames.find(cfInfo.frame_name) != unsupportedFrames.cend()) { + ADP_LOG(INFO) << "node:" << (*it)->name() + << "is not supported on npu because there's not supported node in frames."; (void) outSet.insert(*it); it = candidates->erase(it); } else { @@ -655,7 +658,7 @@ Status FindNpuSupportCandidates(const Graph &graph, OrderedNodeSet *candidates, (void) candidates->erase(edge->dst()); (void) outSet.insert(edge->dst()); ADP_LOG(INFO) << "Remove node : " << edge->dst()->name() << " from candidates, because of node : " - << node->name() << " REF input."; + << node->name() << " REF output."; continue; } if ((dtypeDst == DT_STRING) || (dtypeDst == DT_RESOURCE)) { @@ -663,7 +666,11 @@ Status FindNpuSupportCandidates(const Graph &graph, OrderedNodeSet *candidates, if (attr_value != nullptr) { continue; } if (edge->dst()->type_string() == "Assert") { continue; } if (node->type_string() == "Const") { continue; } - if (candidates->erase(edge->dst()) > 0) { (void) outSet.insert(edge->dst()); } + if (candidates->erase(edge->dst()) > 0) { + ADP_LOG(INFO) << "Remove node : " << edge->dst()->name() << " from candidates, because of node : " + << node->name() << " DT_STRING output or DT_RESOURCE output."; + (void) outSet.insert(edge->dst()); + } } } } @@ -676,8 +683,8 @@ Status FindNpuSupportCandidates(const Graph &graph, OrderedNodeSet *candidates, if (IsRefType(dtypeDst) && candidates->count(edge->src()) > 0) { (void) candidates->erase(edge->src()); (void) outSet.insert(edge->src()); - ADP_LOG(INFO) << "Remove node : " << edge->dst()->name() << " from candidates, because of node : " - << node->name() << " REF Output."; + ADP_LOG(INFO) << "Remove node : " << edge->src()->name() << " from candidates, because of node : " + << node->name() << " REF input."; continue; } if ((dtypeDst == DT_STRING) || (dtypeDst == DT_RESOURCE)) { @@ -686,7 +693,11 @@ Status FindNpuSupportCandidates(const Graph &graph, OrderedNodeSet *candidates, ADP_LOG(INFO) << "Node : " << node->name() << " add to candidates, because of had max size."; continue; } - if (candidates->erase(edge->src()) > 0) { (void) outSet.insert(edge->src()); } + if (candidates->erase(edge->src()) > 0) { + ADP_LOG(INFO) << "Remove node : " << edge->src()->name() << " from candidates, because of node : " + << node->name() << " DT_STRING input or DT_RESOURCE input."; + (void) outSet.insert(edge->src()); + } } } } -- Gitee