From 72e7927e3d817fea5b345281e466a67baa4f0915 Mon Sep 17 00:00:00 2001 From: taoxiangdong Date: Sat, 12 Dec 2020 19:03:15 +0800 Subject: [PATCH] update some code --- ge/graph/load/new_model_manager/model_manager.cc | 4 ++-- ge/hybrid/model/hybrid_model_builder.cc | 10 +++++----- ge/hybrid/model/hybrid_model_builder.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ge/graph/load/new_model_manager/model_manager.cc b/ge/graph/load/new_model_manager/model_manager.cc index 5973b030..7d776eb7 100755 --- a/ge/graph/load/new_model_manager/model_manager.cc +++ b/ge/graph/load/new_model_manager/model_manager.cc @@ -1681,14 +1681,14 @@ Status ModelManager::LaunchKernelCheckAicpuOp(std::vector &aicpu_op for (uint32_t i = 0; i < res_op_nums; i++) { ReturnCode ret_code = res_ret_code_list.at(i); SysOpInfo aicpu_info = res_aicpu_op_info_list.at(i); - GELOGI("Not surpport aicpu op type: %lu, kernel_type:%d, opLen:%d, ret_code:%d", aicpu_info.opType, aicpu_info.kernelsType, aicpu_info.opLen, ret_code); + GELOGI("Not support aicpu op type: %lu, kernel_type:%d, opLen:%d, ret_code:%d", aicpu_info.opType, aicpu_info.kernelsType, aicpu_info.opLen, ret_code); std::vector op_name; op_name.clear(); op_name.resize(kOpNameMaxSize); GE_CHK_RT(rtMemcpy(op_name.data(), aicpu_info.opLen, reinterpret_cast(aicpu_info.opType), aicpu_info.opLen, RT_MEMCPY_DEVICE_TO_HOST)); std::string kernel_type = (static_cast(aicpu_info.kernelsType) == TF_KERNEL) ? "TF_KERNEL" : "CPU_KERNEL"; string op_name_str(op_name.data()); - fail_reason += "op_type: " + op_name_str + " kernel_type: " + kernel_type + " ret code:" + to_string(static_cast(ret_code)) + "<0: op_type, 1: format, 2: datatype> \n"; + fail_reason += "op_type: " + op_name_str + " kernel_type: " + kernel_type + " ret code:" + std::to_string(static_cast(ret_code)) + "<0: op_type, 1: format, 2: datatype> \n"; } fail_reason += "not support."; GELOGE(FAILED, "Check aicpu op_type failed. details: %s", fail_reason.c_str()); diff --git a/ge/hybrid/model/hybrid_model_builder.cc b/ge/hybrid/model/hybrid_model_builder.cc index e1c35008..3ffb2dc6 100755 --- a/ge/hybrid/model/hybrid_model_builder.cc +++ b/ge/hybrid/model/hybrid_model_builder.cc @@ -922,7 +922,7 @@ Status HybridModelBuilder::InitWeights() { } Status HybridModelBuilder::LoadTasks() { - GE_CHK_STATUS_RET(CheckAicpuOp(), "Check Aicpu op failed."); + GE_CHK_STATUS_RET(CheckAicpuOpList(), "Check Aicpu op failed."); for (auto &it : hybrid_model_.node_items_) { auto &node_item = it.second; auto &node_ptr = node_item->node; @@ -1560,21 +1560,20 @@ Status HybridModelBuilder::BuildInputMapping(GraphItem &graph_item, return SUCCESS; } -Status HybridModelBuilder::CheckAicpuOp() { +Status HybridModelBuilder::CheckAicpuOpList() { std::vector aicpu_optype_list; std::vector aicpu_tf_optype_list; std::set aicpu_optype_set; std::set aicpu_tf_optype_set; - const auto &root_graph = ge_root_model_->GetRootGraph(); for (auto &it : ge_root_model_->GetSubgraphInstanceNameToModel()) { auto &name = it.first; auto &ge_model = it.second; GE_CHECK_NOTNULL(ge_model); - if (ge::AttrUtils::GetListStr(ge_model, "needCheckCpu", aicpu_optype_list)) { + if (ge::AttrUtils::GetListStr(*ge_model, "needCheckCpu", aicpu_optype_list)) { aicpu_optype_set.insert(aicpu_optype_list.begin(), aicpu_optype_list.end()); } - if (ge::AttrUtils::GetListStr(ge_model, "needCheckTf", aicpu_tf_optype_list)) { + if (ge::AttrUtils::GetListStr(*ge_model, "needCheckTf", aicpu_tf_optype_list)) { aicpu_tf_optype_set.insert(aicpu_tf_optype_list.begin(), aicpu_tf_optype_list.end()); } } @@ -1582,6 +1581,7 @@ Status HybridModelBuilder::CheckAicpuOp() { aicpu_optype_list.assign(aicpu_optype_set.begin(), aicpu_optype_set.end()); aicpu_tf_optype_list.assign(aicpu_tf_optype_set.begin(), aicpu_tf_optype_set.end()); GE_CHK_STATUS_RET(ModelManager::GetInstance()->LaunchKernelCheckAicpuOp(aicpu_optype_list, aicpu_tf_optype_list), "Launch check aicpu op type failed."); + return SUCCESS; } } // namespace hybrid } // namespace ge diff --git a/ge/hybrid/model/hybrid_model_builder.h b/ge/hybrid/model/hybrid_model_builder.h index a549a9f1..bb349d86 100644 --- a/ge/hybrid/model/hybrid_model_builder.h +++ b/ge/hybrid/model/hybrid_model_builder.h @@ -78,7 +78,7 @@ class HybridModelBuilder { Status ParseVarOutputs(NodeItem &node_item); Status LoadKnownShapedSubgraph(ComputeGraph &graph, NodeItem *parent_node_item); Status RecoverGraphUnknownFlag(); - Status CheckAicpuOp(); + Status CheckAicpuOpList(); const char* GetGraphName() const { return hybrid_model_.model_name_.c_str();