Browse Source

add global step info for known subgraph in unknown model and generate om for remained cases when some single op cases run atc failed

tags/v1.5.1
lichun 3 years ago
parent
commit
9287ca4c4c
4 changed files with 5 additions and 13 deletions
  1. +1
    -1
      ge/graph/load/model_manager/davinci_model.cc
  2. +0
    -7
      ge/graph/load/model_manager/davinci_model.h
  3. +3
    -4
      ge/hybrid/node_executor/compiledsubgraph/known_node_executor.cc
  4. +1
    -1
      ge/hybrid/node_executor/compiledsubgraph/known_node_executor.h

+ 1
- 1
ge/graph/load/model_manager/davinci_model.cc View File

@@ -4365,7 +4365,7 @@ void DavinciModel::SetDataDumperArgs(const ComputeGraphPtr &graph, const map<str
data_dumper_.SetDeviceId(device_id);

if (known_node_) {
data_dumper_.SetLoopAddr(known_shape_global_step_, nullptr, nullptr);
data_dumper_.SetLoopAddr(global_step_addr_, nullptr, nullptr);
} else {
// set loop count addr
auto get_var_addr = [&](const string &name) -> void *{


+ 0
- 7
ge/graph/load/model_manager/davinci_model.h View File

@@ -499,10 +499,6 @@ class DavinciModel {
return exception_dumper_.DumpExceptionInfo(exception_infos);
}

void SetKnownShapeGlobalStep(void *global_step) {
known_shape_global_step_ = global_step;
}

void DumperShrink() {
data_dumper_.DumpShrink();
}
@@ -1109,9 +1105,6 @@ class DavinciModel {
vector<InputOutputDescInfo> output_descs_;
vector<uint32_t> output_formats_;

// known shape node for dump
void *known_shape_global_step_;

// op name to attrs mapping
std::map<std::string, std::map<std::string, std::vector<std::string>>> op_name_to_attrs_;
};


+ 3
- 4
ge/hybrid/node_executor/compiledsubgraph/known_node_executor.cc View File

@@ -145,8 +145,6 @@ Status KnownNodeTask::InitDavinciModel(const HybridModel &model, TensorBuffer *w
auto dump_properties = DumpManager::GetInstance().GetDumpProperties(model.GetSessionId());
if (dump_properties.IsDumpOpen() || dump_properties.IsOpDebugOpen()) {
davinci_model_->SetDumpProperties(dump_properties);
void *global_step = model.GetGlobalStep();
davinci_model_->SetKnownShapeGlobalStep(global_step);
}

void *weight = nullptr;
@@ -182,7 +180,7 @@ Status KnownNodeExecutor::PrepareTask(NodeTask &task, TaskContext &context) cons
return SUCCESS;
}

void KnownNodeExecutor::SettingDaviciModel(const HybridModel &model, const NodePtr &node,
void KnownNodeExecutor::SetDaviciModel(const HybridModel &model, const NodePtr &node,
std::shared_ptr<DavinciModel> &davinci_model) const {
// set known node flag as true
davinci_model->SetKnownNode(true);
@@ -190,6 +188,7 @@ void KnownNodeExecutor::SettingDaviciModel(const HybridModel &model, const NodeP
davinci_model->SetDumpModelName(model.GetModelName());
davinci_model->SetOmName(model.GetOmName());
TensorValue *global_step_var = model.GetVariable(NODE_NAME_GLOBAL_STEP);
GE_CHECK_NOTNULL(global_step_var);
davinci_model->SetGlobalStep(global_step_var->MutableData());
// set model id as root node's node id
davinci_model->SetSubModelId(node->GetOpDesc()->GetId());
@@ -212,7 +211,7 @@ Status KnownNodeExecutor::LoadTask(const HybridModel &model, const NodePtr &node
std::shared_ptr<DavinciModel> davinci_model = MakeShared<DavinciModel>(0, nullptr);
GE_CHECK_NOTNULL(davinci_model);

SettingDaviciModel(model, node, davinci_model);
SetDaviciModel(model, node, davinci_model);
GELOGD("KnownNodeExecutor::LoadTask node id %ld.", node->GetOpDesc()->GetId());

GE_CHK_STATUS_RET(davinci_model->Assign(ge_model),


+ 1
- 1
ge/hybrid/node_executor/compiledsubgraph/known_node_executor.h View File

@@ -59,7 +59,7 @@ class KnownNodeExecutor : public NodeExecutor {
const NodePtr &node,
GeModelPtr &ge_model,
ComputeGraphPtr &graph);
void SettingDaviciModel(const HybridModel &model, const NodePtr &node,
void SetDaviciModel(const HybridModel &model, const NodePtr &node,
std::shared_ptr<DavinciModel> &davinci_model) const;
};
} // namespace hybrid


Loading…
Cancel
Save