From: @zhou_chao1993 Reviewed-by: @youui,@xchu42,@youui Signed-off-by: @youuitags/v1.2.0
| @@ -820,6 +820,7 @@ Status DataDumper::UnloadDumpInfo() { | |||||
| for (const auto &op_iter : op_list_) { | for (const auto &op_iter : op_list_) { | ||||
| aicpu::dump::Task task; | aicpu::dump::Task task; | ||||
| task.set_task_id(op_iter.task_id); | task.set_task_id(op_iter.task_id); | ||||
| task.set_stream_id(op_iter.stream_id); | |||||
| op_mapping_info.mutable_task()->Add(std::move(task)); | op_mapping_info.mutable_task()->Add(std::move(task)); | ||||
| } | } | ||||
| auto ret = ExecuteUnLoadDumpInfo(op_mapping_info); | auto ret = ExecuteUnLoadDumpInfo(op_mapping_info); | ||||
| @@ -834,7 +835,6 @@ void DataDumper::DumpShrink() { | |||||
| compute_graph_.reset(); | compute_graph_.reset(); | ||||
| input_map_.clear(); | input_map_.clear(); | ||||
| ref_info_.clear(); | ref_info_.clear(); | ||||
| op_list_.clear(); | |||||
| } | } | ||||
| void DataDumper::PrintCheckLog(string &dump_list_key) { | void DataDumper::PrintCheckLog(string &dump_list_key) { | ||||
| @@ -3967,8 +3967,11 @@ void DavinciModel::SetDataDumperArgs(const ComputeGraphPtr &graph, const map<str | |||||
| } | } | ||||
| data_dumper_.SetDeviceId(device_id); | data_dumper_.SetDeviceId(device_id); | ||||
| // set loop count addr | |||||
| auto get_var_addr = [&](const string &name) -> void *{ | |||||
| if (known_node_) { | |||||
| data_dumper_.SetLoopAddr(known_shape_global_step_, nullptr, nullptr); | |||||
| } else { | |||||
| // set loop count addr | |||||
| auto get_var_addr = [&](const string &name) -> void *{ | |||||
| const auto it = variable_by_name.find(name); | const auto it = variable_by_name.find(name); | ||||
| if (it != variable_by_name.end()) { | if (it != variable_by_name.end()) { | ||||
| const auto output_sizes = ModelUtils::GetOutputSize(it->second); | const auto output_sizes = ModelUtils::GetOutputSize(it->second); | ||||
| @@ -3981,10 +3984,10 @@ void DavinciModel::SetDataDumperArgs(const ComputeGraphPtr &graph, const map<str | |||||
| GELOGD("op: %s is null.", name.c_str()); | GELOGD("op: %s is null.", name.c_str()); | ||||
| return nullptr; | return nullptr; | ||||
| }; | }; | ||||
| data_dumper_.SetLoopAddr(get_var_addr(NODE_NAME_GLOBAL_STEP), | data_dumper_.SetLoopAddr(get_var_addr(NODE_NAME_GLOBAL_STEP), | ||||
| get_var_addr(NODE_NAME_FLOWCTRL_LOOP_PER_ITER), | get_var_addr(NODE_NAME_FLOWCTRL_LOOP_PER_ITER), | ||||
| get_var_addr(NODE_NAME_FLOWCTRL_LOOP_COND)); | get_var_addr(NODE_NAME_FLOWCTRL_LOOP_COND)); | ||||
| } | |||||
| } | } | ||||
| uint32_t DavinciModel::GetFlowctrlIndex(uint32_t op_index) { | uint32_t DavinciModel::GetFlowctrlIndex(uint32_t op_index) { | ||||
| @@ -470,6 +470,10 @@ class DavinciModel { | |||||
| data_dumper_.SaveDumpTask(task_id, stream_id, op_desc, args); | data_dumper_.SaveDumpTask(task_id, stream_id, op_desc, args); | ||||
| } | } | ||||
| void SetKnownShapeGlobalStep(void *global_step) { | |||||
| known_shape_global_step_ = global_step; | |||||
| } | |||||
| void DumperShrink() { | void DumperShrink() { | ||||
| data_dumper_.DumpShrink(); | data_dumper_.DumpShrink(); | ||||
| } | } | ||||
| @@ -1057,6 +1061,9 @@ class DavinciModel { | |||||
| vector<uint32_t> input_formats_; | vector<uint32_t> input_formats_; | ||||
| 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_; | |||||
| }; | }; | ||||
| } // namespace ge | } // namespace ge | ||||
| #endif // GE_GRAPH_LOAD_NEW_MODEL_MANAGER_DAVINCI_MODEL_H_ | #endif // GE_GRAPH_LOAD_NEW_MODEL_MANAGER_DAVINCI_MODEL_H_ | ||||
| @@ -192,7 +192,7 @@ void KernelExTaskInfo::InitDumpTask(void *addr, const OpDescPtr &op_desc) { | |||||
| if (davinci_model_->GetDumpProperties().IsLayerNeedDump(davinci_model_->Name(), davinci_model_->OmName(), | if (davinci_model_->GetDumpProperties().IsLayerNeedDump(davinci_model_->Name(), davinci_model_->OmName(), | ||||
| op_desc->GetName())) { | op_desc->GetName())) { | ||||
| dump_flag_ = RT_KERNEL_DUMPFLAG; | dump_flag_ = RT_KERNEL_DUMPFLAG; | ||||
| dump_args_ = input_output_addr_; | |||||
| dump_args_ = addr; | |||||
| } | } | ||||
| } | } | ||||
| @@ -126,6 +126,12 @@ Status KnownNodeTask::Init(TaskContext &context) { | |||||
| auto dump_properties = context.GetDumpProperties(); | auto dump_properties = context.GetDumpProperties(); | ||||
| if (dump_properties.IsDumpOpen()) { | if (dump_properties.IsDumpOpen()) { | ||||
| davinci_model_->SetDumpProperties(dump_properties); | davinci_model_->SetDumpProperties(dump_properties); | ||||
| void *global_step = nullptr; | |||||
| TensorValue *varible_global_step = context.GetVariable(NODE_NAME_GLOBAL_STEP); | |||||
| if (varible_global_step != nullptr) { | |||||
| global_step = varible_global_step->MutableData(); | |||||
| } | |||||
| davinci_model_->SetKnownShapeGlobalStep(global_step); | |||||
| } | } | ||||
| int32_t device_id = 0; | int32_t device_id = 0; | ||||
| rtError_t rt_ret = rtGetDevice(&device_id); | rtError_t rt_ret = rtGetDevice(&device_id); | ||||