From 42d0aad75e5c879afc23122ba68b943ebd7b04bb Mon Sep 17 00:00:00 2001 From: huanruizhi Date: Thu, 26 Sep 2024 16:36:57 +0800 Subject: [PATCH] log --- .../optimizers/om_partition_subgraphs_pass.cc | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/tf_adapter/optimizers/om_partition_subgraphs_pass.cc b/tf_adapter/optimizers/om_partition_subgraphs_pass.cc index eef34c856..2c4e5ab52 100644 --- a/tf_adapter/optimizers/om_partition_subgraphs_pass.cc +++ b/tf_adapter/optimizers/om_partition_subgraphs_pass.cc @@ -645,6 +645,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() << " not supported on npu because setting not support"; (void) outSet.insert(node); } } @@ -666,6 +667,9 @@ 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() + << " not supported on npu because there are operators in the control flow that are not supported " + "on the npu"; (void) outSet.insert(*it); it = candidates->erase(it); } else { @@ -692,8 +696,8 @@ Status FindNpuSupportCandidates(const Graph &graph, OrderedNodeSet *candidates, if (IsRefType(dtype_dst) && candidates->count(edge->dst()) > 0) { (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."; + ADP_LOG(INFO) << "Remove node : " << edge->dst()->name() << " from npu, because of node : " + << node->name() << " REF output."; continue; } if ((dtype_dst == DT_STRING) || (dtype_dst == DT_RESOURCE) || (dtype_dst == DT_VARIANT)) { @@ -701,7 +705,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 npu, because of node : " + << node->name() << " DT_STRING/DT_RESOURCE/DT_VARIANT output."; + (void) outSet.insert(edge->dst()); + } } } } @@ -714,8 +722,8 @@ Status FindNpuSupportCandidates(const Graph &graph, OrderedNodeSet *candidates, if (IsRefType(dtype_dst) && 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 ((dtype_dst == DT_STRING) || (dtype_dst == DT_RESOURCE) || (dtype_dst == DT_VARIANT)) { @@ -730,7 +738,11 @@ Status FindNpuSupportCandidates(const Graph &graph, OrderedNodeSet *candidates, ADP_LOG(EVENT) << "GetNext: " << src_node_type << " node should sink if enable_data_pre_proc is true"; 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/DT_RESOURCE/DT_VARIANT input."; + (void) outSet.insert(edge->src()); + } } } } -- Gitee