diff --git a/mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.cc b/mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.cc index ca9a74022ac9afa4c421eeefb9713c43436d3054..e1e3ee61a7de126b7baba6a843e0ba45f4b7047c 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 d99eb4db6862954cd9baef3ddb7784367a14b1e8..82cfd1919dcef9aecf83f5939bbed2a049491945 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_;