From d488c042a57344e7b0759c335860eeb49a132155 Mon Sep 17 00:00:00 2001 From: lichun Date: Sat, 3 Jul 2021 15:38:36 +0800 Subject: [PATCH] add global step info for known subgraph in unknown model and generate om for remained cases when some single op cases run atc failed --- ge/graph/load/model_manager/davinci_model.cc | 5 +++++ ge/graph/load/model_manager/davinci_model.h | 2 +- .../compiledsubgraph/known_node_executor.cc | 9 +++++---- .../node_executor/compiledsubgraph/known_node_executor.h | 4 ++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ge/graph/load/model_manager/davinci_model.cc b/ge/graph/load/model_manager/davinci_model.cc index 7d82879f..6bf2c6d5 100755 --- a/ge/graph/load/model_manager/davinci_model.cc +++ b/ge/graph/load/model_manager/davinci_model.cc @@ -1480,6 +1480,11 @@ Status DavinciModel::GetLabelGotoAddr(uint32_t label_index, rtMemType_t mem_type return SUCCESS; } +void DavinciModel::SetGlobalStep(void *global_step, uint64_t global_step_size) { + global_step_addr_ = global_step; + global_step_size_ = global_step_size; +} + /// @ingroup ge /// @brief LabelSet Op Initialize. /// @param [in] op_desc: LabelSet Op descriptor. diff --git a/ge/graph/load/model_manager/davinci_model.h b/ge/graph/load/model_manager/davinci_model.h index daf0c7e6..db53d80f 100755 --- a/ge/graph/load/model_manager/davinci_model.h +++ b/ge/graph/load/model_manager/davinci_model.h @@ -300,7 +300,7 @@ class DavinciModel { return op_list_.at(index); } - void SetGlobalStep(void *global_step) { global_step_addr_ = global_step; } + void SetGlobalStep(void *global_step, uint64_t global_step_size); void *GetGlobalStep() const { return global_step_addr_; } // get task info for profiling diff --git a/ge/hybrid/node_executor/compiledsubgraph/known_node_executor.cc b/ge/hybrid/node_executor/compiledsubgraph/known_node_executor.cc index 753cf4ba..292969b6 100755 --- a/ge/hybrid/node_executor/compiledsubgraph/known_node_executor.cc +++ b/ge/hybrid/node_executor/compiledsubgraph/known_node_executor.cc @@ -182,7 +182,7 @@ Status KnownNodeExecutor::PrepareTask(NodeTask &task, TaskContext &context) cons return SUCCESS; } -void KnownNodeExecutor::SetDaviciModel(const HybridModel &model, const NodePtr &node, +Status KnownNodeExecutor::SetDaviciModel(const HybridModel &model, const NodePtr &node, std::shared_ptr &davinci_model) const { // set known node flag as true davinci_model->SetKnownNode(true); @@ -190,10 +190,11 @@ void KnownNodeExecutor::SetDaviciModel(const HybridModel &model, const NodePtr & davinci_model->SetDumpModelName(model.GetModelName()); davinci_model->SetOmName(model.GetOmName()); TensorValue *global_step_var = model.GetVariable(NODE_NAME_GLOBAL_STEP); - GE_CHK_BOOL_EXEC(global_step_var != nullptr, return); - davinci_model->SetGlobalStep(global_step_var->MutableData()); + GE_CHECK_NOTNULL(global_step_var); + davinci_model->SetGlobalStep(global_step_var->MutableData(), global_step_var->GetSize()); // set model id as root node's node id davinci_model->SetSubModelId(node->GetOpDesc()->GetId()); + return SUCCESS; } Status KnownNodeExecutor::LoadTask(const HybridModel &model, const NodePtr &node, @@ -213,7 +214,7 @@ Status KnownNodeExecutor::LoadTask(const HybridModel &model, const NodePtr &node std::shared_ptr davinci_model = MakeShared(0, nullptr); GE_CHECK_NOTNULL(davinci_model); - SetDaviciModel(model, node, davinci_model); + GE_CHK_STATUS_RET_NOLOG(SetDaviciModel(model, node, davinci_model)); GELOGD("KnownNodeExecutor::LoadTask node id %ld.", node->GetOpDesc()->GetId()); GE_CHK_STATUS_RET(davinci_model->Assign(ge_model), diff --git a/ge/hybrid/node_executor/compiledsubgraph/known_node_executor.h b/ge/hybrid/node_executor/compiledsubgraph/known_node_executor.h index 2d51db58..37b5a3d8 100644 --- a/ge/hybrid/node_executor/compiledsubgraph/known_node_executor.h +++ b/ge/hybrid/node_executor/compiledsubgraph/known_node_executor.h @@ -59,8 +59,8 @@ class KnownNodeExecutor : public NodeExecutor { const NodePtr &node, GeModelPtr &ge_model, ComputeGraphPtr &graph); - void SetDaviciModel(const HybridModel &model, const NodePtr &node, - std::shared_ptr &davinci_model) const; + Status SetDaviciModel(const HybridModel &model, const NodePtr &node, + std::shared_ptr &davinci_model) const; }; } // namespace hybrid } // namespace ge