Browse Source

fixed overflow, offline debugger and online debugger check wp bug

r1.4
Parastoo Ashtari 4 years ago
parent
commit
ed837dea58
2 changed files with 10 additions and 6 deletions
  1. +6
    -6
      mindspore/ccsrc/debug/debug_services.cc
  2. +4
    -0
      mindspore/ccsrc/debug/debug_services.h

+ 6
- 6
mindspore/ccsrc/debug/debug_services.cc View File

@@ -764,7 +764,7 @@ void DebugServices::ReadDumpedTensor(std::vector<std::string> backend_name, std:
std::string slot_string_to_check;
std::string prefix_dump_file_name;
SetPrefixToCheck(&prefix_dump_file_name, &slot_string_to_check, &dump_style_kernel_name, slot[i], is_output[i]);
std::string prefix_dump_to_check = dump_style_kernel_name;
std::string prefix_dump_to_check = dump_style_kernel_name + '.';
GetNodeNameWithoutScope(&prefix_dump_to_check);

std::string specific_dump_dir = dump_dir + "/rank_" + std::to_string(device_id[i]) + "/" + net_name + "/" +
@@ -1097,12 +1097,12 @@ bool DebugServices::CheckOpOverflow(std::string node_name_to_find, unsigned int
#ifdef ONLINE_DBG_MODE
auto debugger = Debugger::GetInstance();
overflow_bin_path = DumpJsonParser::GetInstance().GetOpOverflowBinPath(debugger->GetGraphPtr()->graph_id());
auto realpath = Common::GetRealPath(overflow_bin_path);
if (!realpath.has_value()) {
MS_LOG(ERROR) << "Get real path failed for overflow_bin_path.";
std::string check_overflow_bin_path = RealPath(overflow_bin_path);
if (check_overflow_bin_path.empty()) {
MS_LOG(WARNING) << "Get real path failed for overflow_bin_path.";
return false;
}
overflow_bin_path = realpath.value();
overflow_bin_path = check_overflow_bin_path;
#else
overflow_bin_path = dump_dir + "/rank_" + std::to_string(device_id) + "/" + net_name + "/" +
std::to_string(root_graph_id) + "/" + IterationString(iteration) + "/";
@@ -1284,7 +1284,7 @@ std::string DebugServices::RealPath(const std::string &input_path) {
MS_LOG(EXCEPTION) << "The length of file name : " << file_name.length() << " exceeds limit: " << NAME_MAX;
}
if (realpath(prefix_path.c_str(), real_path) == nullptr) {
MS_LOG(ERROR) << "The dir " << prefix_path << " does not exist.";
MS_LOG(WARNING) << "The dir " << prefix_path << " does not exist.";
return "";
}



+ 4
- 0
mindspore/ccsrc/debug/debug_services.h View File

@@ -136,6 +136,10 @@ class DebugServices {
bool check_tensor_name = found != std::string::npos && w_name.substr(found + 1) == tensor_name;
bool check_node_name = (w_type && (node_name == w_name || w_name == "*")) || (!w_type && node_name == w_name);
if (check_tensor_name || check_node_name) {
// online debugger only support single card
if (check_node_device_list.empty()) {
return w_name;
}
auto device_vec = std::get<1>(check_node_device_list[indx]);
auto root_graph_vec = std::get<1>(check_node_graph_list[indx]);
auto iter1 = std::find(device_vec.begin(), device_vec.end(), tensor_device_id);


Loading…
Cancel
Save