Browse Source

!29218 Show IsDumpEnabled warning message only once

Merge pull request !29218 from parastooashtari/kernel_level_dump
feature/build-system-rewrite
i-robot Gitee 4 years ago
parent
commit
f254f9a295
No known key found for this signature in database GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 12 additions and 3 deletions
  1. +8
    -3
      mindspore/ccsrc/debug/data_dump/dump_json_parser.cc
  2. +1
    -0
      mindspore/ccsrc/debug/data_dump/dump_json_parser.h
  3. +3
    -0
      mindspore/ccsrc/debug/data_dump/e2e_dump.cc

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

@@ -1,5 +1,5 @@
/**
* Copyright 2020-2021 Huawei Technologies Co., Ltd
* Copyright 2020-2022 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -72,8 +72,13 @@ bool DumpJsonParser::IsDumpEnabled() {
}
// Dump is supported with Ascend kernel-by-kernel mode (mindRT) when kGraphOpRun is set.
if (!single_op.empty() && single_op == "1" && !MsContext::GetInstance()->get_param<bool>(MS_CTX_ENABLE_MINDRT)) {
MS_LOG(WARNING) << "Dump is not supported when task is not sink. Please set env GRAPH_OP_RUN to 0 to enable task "
"sink, so that the data can be dumped.";
if (!dump_enabled_warning_printed_) {
MS_LOG(WARNING) << "Dump is not supported when task is not sink. Please set env GRAPH_OP_RUN to 0 to enable task "
"sink, so that the data can be dumped.";
// Only print the warning once.
dump_enabled_warning_printed_ = true;
}

return false;
}
MS_LOG(INFO) << "Dump config path is " << config_path;


+ 1
- 0
mindspore/ccsrc/debug/data_dump/dump_json_parser.h View File

@@ -95,6 +95,7 @@ class DumpJsonParser {
bool trans_flag_{false};
uint32_t cur_dump_iter_{0};
bool already_parsed_{false};
bool dump_enabled_warning_printed_{false};

// Save graphs for dump.
std::vector<session::KernelGraph *> graphs_;


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

@@ -459,6 +459,9 @@ void E2eDump::DumpData(const session::KernelGraph *graph, uint32_t rank_id, cons
bool success = false;
auto &dump_json_parser = DumpJsonParser::GetInstance();
uint32_t graph_id = graph->graph_id();
if (!dump_json_parser.e2e_dump_enabled()) {
return;
}

if (dump_json_parser.GetIterDumpFlag()) {
MS_LOG(INFO) << "Start e2e dump. Current iteration is " << dump_json_parser.cur_dump_iter();


Loading…
Cancel
Save