From 236d65b7d31c1c653446a3d696e348237213f91b Mon Sep 17 00:00:00 2001 From: caifubi Date: Thu, 16 Jul 2020 10:00:05 +0800 Subject: [PATCH] Fix graph id changed in data dump release --- mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.cc | 7 ++++--- mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.h | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.cc b/mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.cc index ca9a74022..e1e3ee61a 100644 --- a/mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.cc +++ b/mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.cc @@ -71,6 +71,8 @@ void DataDumper::LoadDumpInfo() { } RtLoadDumpData(dump_info, &dev_load_mem_); load_flag_ = true; + // graph id may changed in Unload + graph_id_ = kernel_graph_->graph_id(); MS_LOG(INFO) << "[DataDump] LoadDumpInfo end"; } @@ -135,11 +137,10 @@ void DataDumper::UnloadDumpInfo() { MS_LOG(WARNING) << "Load not success, no need to unload"; return; } - MS_EXCEPTION_IF_NULL(kernel_graph_); - MS_LOG(INFO) << "[DataDump] UnloadDumpInfo start. graphId:" << kernel_graph_->graph_id(); + MS_LOG(INFO) << "[DataDump] UnloadDumpInfo start. graphId:" << graph_id_; aicpu::dump::OpMappingInfo op_mapping_info; - op_mapping_info.set_model_id(kernel_graph_->graph_id()); + op_mapping_info.set_model_id(graph_id_); op_mapping_info.set_flag(kAicpuUnloadFlag); for (const auto &kernel_name : dump_kernel_names_) { diff --git a/mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.h b/mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.h index d99eb4db6..82cfd1919 100644 --- a/mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.h +++ b/mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.h @@ -42,6 +42,7 @@ class DataDumper { : load_flag_(false), dev_load_mem_(nullptr), dev_unload_mem_(nullptr), + graph_id_(UINT32_MAX), kernel_graph_(kernel_graph), runtime_info_map_(runtime_info_map) {} ~DataDumper(); @@ -58,6 +59,7 @@ class DataDumper { bool load_flag_; void *dev_load_mem_; void *dev_unload_mem_; + uint32_t graph_id_; std::vector dump_kernel_names_; const session::KernelGraph *kernel_graph_; std::map> runtime_info_map_; -- GitLab