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 4 years ago
parent
commit
6bfd96b540
3 changed files with 13 additions and 21 deletions
  1. +11
    -9
      ge/graph/load/model_manager/davinci_model.cc
  2. +0
    -7
      ge/graph/load/model_manager/davinci_model.h
  3. +2
    -5
      ge/hybrid/node_executor/compiledsubgraph/known_node_executor.cc

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

@@ -1547,14 +1547,16 @@ Status DavinciModel::InitLabelSet(const OpDescPtr &op_desc) {
} }


Status DavinciModel::InitVariable(const OpDescPtr &op_desc, map<string, OpDescPtr> &variable_by_name) { Status DavinciModel::InitVariable(const OpDescPtr &op_desc, map<string, OpDescPtr> &variable_by_name) {
if (op_desc->GetName() == NODE_NAME_GLOBAL_STEP) {
const auto output_sizes = ModelUtils::GetOutputSize(op_desc);
if (!output_sizes.empty()) {
global_step_size_ = output_sizes[0];
}
const auto output_addrs = ModelUtils::GetOutputDataAddrs(runtime_param_, op_desc);
if (!output_addrs.empty()) {
global_step_addr_ = output_addrs[0];
if (!known_node_) {
if (op_desc->GetName() == NODE_NAME_GLOBAL_STEP) {
const auto output_sizes = ModelUtils::GetOutputSize(op_desc);
if (!output_sizes.empty()) {
global_step_size_ = output_sizes[0];
}
const auto output_addrs = ModelUtils::GetOutputDataAddrs(runtime_param_, op_desc);
if (!output_addrs.empty()) {
global_step_addr_ = output_addrs[0];
}
} }
} }


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


if (known_node_) { if (known_node_) {
data_dumper_.SetLoopAddr(known_shape_global_step_, nullptr, nullptr);
data_dumper_.SetLoopAddr(global_step_addr, nullptr, nullptr);
} else { } else {
// set loop count addr // set loop count addr
auto get_var_addr = [&](const string &name) -> void *{ 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); return exception_dumper_.DumpExceptionInfo(exception_infos);
} }


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

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


// known shape node for dump
void *known_shape_global_step_;

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


+ 2
- 5
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()); auto dump_properties = DumpManager::GetInstance().GetDumpProperties(model.GetSessionId());
if (dump_properties.IsDumpOpen() || dump_properties.IsOpDebugOpen()) { if (dump_properties.IsDumpOpen() || dump_properties.IsOpDebugOpen()) {
davinci_model_->SetDumpProperties(dump_properties); davinci_model_->SetDumpProperties(dump_properties);
void *global_step = model.GetGlobalStep();
davinci_model_->SetKnownShapeGlobalStep(global_step);
} }


void *weight = nullptr; void *weight = nullptr;
@@ -189,9 +187,8 @@ Status KnownNodeExecutor::SetDaviciModel(const HybridModel &model, const NodePtr
davinci_model->SetId(model.GetModelId()); davinci_model->SetId(model.GetModelId());
davinci_model->SetDumpModelName(model.GetModelName()); davinci_model->SetDumpModelName(model.GetModelName());
davinci_model->SetOmName(model.GetOmName()); 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(), global_step_var->GetSize());
void *global_step = model.GetGlobalStep();
davinci_model->SetGlobalStep(global_step, sizeof(int64_t));
// set model id as root node's node id // set model id as root node's node id
davinci_model->SetSubModelId(node->GetOpDesc()->GetId()); davinci_model->SetSubModelId(node->GetOpDesc()->GetId());
return SUCCESS; return SUCCESS;


Loading…
Cancel
Save