Browse Source

!27839 Save non-tensor value in pb

Merge pull request !27839 from sabrinasun_59ee/fix
tags/v1.6.0
i-robot Gitee 4 years ago
parent
commit
ec90e501dc
3 changed files with 8 additions and 2 deletions
  1. +3
    -2
      mindspore/ccsrc/debug/data_dump/dump_utils.cc
  2. +1
    -0
      mindspore/ccsrc/debug/data_dump/e2e_dump.cc
  3. +4
    -0
      mindspore/ccsrc/debug/debugger/proto_exporter.cc

+ 3
- 2
mindspore/ccsrc/debug/data_dump/dump_utils.cc View File

@@ -46,9 +46,10 @@ std::string GenerateDumpPath(uint32_t graph_id, uint32_t rank_id, bool is_cst) {
dump_path += "/";
}
if (is_cst) {
dump_path += ("rank_" + std::to_string(rank_id) + "/" + net_name + "/" + std::to_string(graph_id) + "/constants");
dump_path += ("rank_" + std::to_string(rank_id) + "/" + net_name + "/" + std::to_string(graph_id) + "/constants/");
} else {
dump_path += ("rank_" + std::to_string(rank_id) + "/" + net_name + "/" + std::to_string(graph_id) + "/" + iterator);
dump_path +=
("rank_" + std::to_string(rank_id) + "/" + net_name + "/" + std::to_string(graph_id) + "/" + iterator + "/");
}
return dump_path;
}


+ 1
- 0
mindspore/ccsrc/debug/data_dump/e2e_dump.cc View File

@@ -351,6 +351,7 @@ void E2eDump::DumpConstantData(const session::KernelGraph *graph, uint32_t rank_
if (!IsDeviceTargetGPU() || !dump_json_parser.e2e_dump_enabled()) {
return;
}
MS_LOG(INFO) << "DumpConstants. Current iteration is " << dump_json_parser.cur_dump_iter();
uint32_t graph_id = graph->graph_id();
std::string cst_path = GenerateDumpPath(graph_id, rank_id, true);
DumpConstantData(graph, cst_path, debugger);


+ 4
- 0
mindspore/ccsrc/debug/debugger/proto_exporter.cc View File

@@ -507,6 +507,10 @@ void DebuggerProtoExporter::ExportValueNodes(const std::map<AnfNodePtr, size_t>
std::string node_name = GetKernelNodeName(item.first);
GetFileKernelName(NOT_NULL(&node_name));
named_value->set_full_name(node_name);
if (GetValueNode(item.first)->isa<tensor::Tensor>()) {
continue;
}
SetValueToProto(GetValueNode(item.first), named_value->mutable_value());
}
}



Loading…
Cancel
Save