From e77e816f1dba1fd058fcf0e8db8794549b770886 Mon Sep 17 00:00:00 2001 From: Harshvardhan Gupta Date: Thu, 8 Oct 2020 12:14:06 -0400 Subject: [PATCH] fix overflow dump path --- mindspore/ccsrc/debug/data_dump/dump_json_parser.cc | 2 +- mindspore/ccsrc/debug/debugger/debugger.cc | 4 ++-- mindspore/ccsrc/debug/debugger/debugger.h | 2 +- mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.cc | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mindspore/ccsrc/debug/data_dump/dump_json_parser.cc b/mindspore/ccsrc/debug/data_dump/dump_json_parser.cc index dfc367dee2..bca47a74ed 100644 --- a/mindspore/ccsrc/debug/data_dump/dump_json_parser.cc +++ b/mindspore/ccsrc/debug/data_dump/dump_json_parser.cc @@ -364,7 +364,7 @@ void DumpJsonParser::PrintUnusedKernel() { } std::string DumpJsonParser::GetOpOverflowBinPath(uint32_t graph_id, uint32_t device_id) const { - std::string bin_path = "/var/log/npu/ide_daemon/dump"; + std::string bin_path; bin_path.append(path_); bin_path.append("_"); bin_path.append(std::to_string(device_id)); diff --git a/mindspore/ccsrc/debug/debugger/debugger.cc b/mindspore/ccsrc/debug/debugger/debugger.cc index 4d09df8f84..3773beef88 100644 --- a/mindspore/ccsrc/debug/debugger/debugger.cc +++ b/mindspore/ccsrc/debug/debugger/debugger.cc @@ -318,8 +318,8 @@ void Debugger::PostDebugOp() { } } -std::map, std::string> Debugger::GetStreamTaskToOpnameMap() const { - return stream_task_to_opname_; +void Debugger::SetStreamTaskToOpnameMap(const std::map, std::string> &mapping) { + stream_task_to_opname_ = mapping; } void Debugger::CheckGraphPtr(const KernelGraphPtr &graph_ptr) { diff --git a/mindspore/ccsrc/debug/debugger/debugger.h b/mindspore/ccsrc/debug/debugger/debugger.h index 6e4407b0c5..38e98feb5e 100644 --- a/mindspore/ccsrc/debug/debugger/debugger.h +++ b/mindspore/ccsrc/debug/debugger/debugger.h @@ -94,7 +94,7 @@ class Debugger : public std::enable_shared_from_this { int32_t step_num() const; - std::map, std::string> GetStreamTaskToOpnameMap() const; + void SetStreamTaskToOpnameMap(const std::map, std::string> &mapping); // check if any feature that uses the debugger backend is enabled bool DebuggerBackendEnabled(); diff --git a/mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.cc b/mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.cc index 19eaa13257..eb6c53daf6 100644 --- a/mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.cc +++ b/mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.cc @@ -115,7 +115,7 @@ void DataDumper::LoadDumpInfo() { auto debugger = mindspore::Debugger::GetInstance(); MS_EXCEPTION_IF_NULL(debugger); if (debugger->DebuggerBackendEnabled()) { - std::map, std::string> stream_task_to_opname = debugger->GetStreamTaskToOpnameMap(); + std::map, std::string> stream_task_to_opname; // extract stream id, task id and opname from runtime_info_map for overflow detection std::transform(runtime_info_map_.begin(), runtime_info_map_.end(), std::inserter(stream_task_to_opname, stream_task_to_opname.end()), @@ -123,6 +123,7 @@ void DataDumper::LoadDumpInfo() { -> std::pair, std::string> { return {{std::get<1>(*p.second), std::get<0>(*p.second)}, p.first}; }); + debugger->SetStreamTaskToOpnameMap(stream_task_to_opname); } #endif MS_LOG(INFO) << "[DataDump] LoadDumpInfo end";