Browse Source

!7452 Check absolute dump path

Merge pull request !7452 from caifubi/dump
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
5461dd056b
2 changed files with 6 additions and 2 deletions
  1. +3
    -0
      mindspore/ccsrc/debug/data_dump/dump_json_parser.cc
  2. +3
    -2
      mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.cc

+ 3
- 0
mindspore/ccsrc/debug/data_dump/dump_json_parser.cc View File

@@ -218,6 +218,9 @@ void DumpJsonParser::ParseDumpPath(const nlohmann::json &content) {
if (path_.empty()) { if (path_.empty()) {
MS_LOG(EXCEPTION) << "Dump path is empty"; MS_LOG(EXCEPTION) << "Dump path is empty";
} }
if (path_[0] != '/') {
MS_LOG(EXCEPTION) << "Dump path only support absolute path and should start with '/'";
}
} }


void DumpJsonParser::ParseNetName(const nlohmann::json &content) { void DumpJsonParser::ParseNetName(const nlohmann::json &content) {


+ 3
- 2
mindspore/ccsrc/runtime/device/ascend/dump/data_dumper.cc View File

@@ -138,10 +138,11 @@ void DataDumper::SetOpMappingInfo(NotNull<aicpu::dump::OpMappingInfo *> dump_inf
MS_LOG(EXCEPTION) << "Dump path invalid"; MS_LOG(EXCEPTION) << "Dump path invalid";
} }
auto device_id = context_ptr->get_param<uint32_t>(MS_CTX_DEVICE_ID); auto device_id = context_ptr->get_param<uint32_t>(MS_CTX_DEVICE_ID);
dump_info->set_dump_path("/" + dump_path + "_" + std::to_string(device_id) + "/");
dump_info->set_dump_path("/" + dump_path + "/device_" + std::to_string(device_id) + "/");
MS_LOG(INFO) << "[DataDump] dump_path:" << dump_path; MS_LOG(INFO) << "[DataDump] dump_path:" << dump_path;


dump_info->set_model_name(DumpJsonParser::GetInstance().net_name() + "_" + std::to_string(kernel_graph_->graph_id()));
dump_info->set_model_name(DumpJsonParser::GetInstance().net_name() + "_graph_" +
std::to_string(kernel_graph_->graph_id()));
dump_info->set_dump_step(std::to_string(DumpJsonParser::GetInstance().iteration())); dump_info->set_dump_step(std::to_string(DumpJsonParser::GetInstance().iteration()));
dump_info->set_model_id(kernel_graph_->graph_id()); dump_info->set_model_id(kernel_graph_->graph_id());
dump_info->set_flag(kAicpuLoadFlag); dump_info->set_flag(kAicpuLoadFlag);


Loading…
Cancel
Save