From 6eba89b1bcde767d5ab9f9389998e37de1dc48ff Mon Sep 17 00:00:00 2001 From: caifubi Date: Mon, 17 Aug 2020 09:37:16 +0800 Subject: [PATCH] fix profiling log bug --- mindspore/ccsrc/debug/data_dump_parser.cc | 16 +++++++++------- .../device/ascend/profiling/profiling_utils.cc | 6 +++--- .../profiling/reporter/graph_desc_reporter.cc | 1 + .../profiling/reporter/task_desc_reporter.cc | 2 +- mindspore/ccsrc/runtime/device/kernel_adjust.cc | 2 +- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/mindspore/ccsrc/debug/data_dump_parser.cc b/mindspore/ccsrc/debug/data_dump_parser.cc index 49618059c7..85f8961583 100644 --- a/mindspore/ccsrc/debug/data_dump_parser.cc +++ b/mindspore/ccsrc/debug/data_dump_parser.cc @@ -137,18 +137,20 @@ bool DataDumpParser::NeedDump(const std::string &op_full_name) const { return iter != kernel_map_.end(); } -bool DataDumpParser::IsConfigExist(const nlohmann::json &dump_settings) const { - if (dump_settings.find(kConfigDumpMode) == dump_settings.end() || - dump_settings.find(kConfigNetName) == dump_settings.end() || - dump_settings.find(kConfigOpDebugMode) == dump_settings.end() || - dump_settings.find(kConfigIteration) == dump_settings.end() || - dump_settings.find(kConfigKernels) == dump_settings.end()) { - MS_LOG(ERROR) << "[DataDump] DumpSettings keys are not exist."; +bool CheckConfigKey(const nlohmann::json &dump_settings, const std::string &key) { + if (dump_settings.find(key) == dump_settings.end()) { + MS_LOG(ERROR) << "[DataDump] DumpSettings key:" << key << " is not exist."; return false; } return true; } +bool DataDumpParser::IsConfigExist(const nlohmann::json &dump_settings) const { + return CheckConfigKey(dump_settings, kConfigDumpMode) && CheckConfigKey(dump_settings, kConfigNetName) && + CheckConfigKey(dump_settings, kConfigOpDebugMode) && CheckConfigKey(dump_settings, kConfigIteration) && + CheckConfigKey(dump_settings, kConfigKernels); +} + bool DataDumpParser::ParseDumpSetting(const nlohmann::json &dump_settings) { auto mode = dump_settings.at(kConfigDumpMode); auto op_debug_mode = dump_settings.at(kConfigOpDebugMode); diff --git a/mindspore/ccsrc/runtime/device/ascend/profiling/profiling_utils.cc b/mindspore/ccsrc/runtime/device/ascend/profiling/profiling_utils.cc index 643e35ac0b..8bc5f258b7 100644 --- a/mindspore/ccsrc/runtime/device/ascend/profiling/profiling_utils.cc +++ b/mindspore/ccsrc/runtime/device/ascend/profiling/profiling_utils.cc @@ -120,7 +120,7 @@ void ProfilingUtils::GetCNodeOutputRealNode(const std::string &node_name, const } } if (getnext_outputs->empty()) { - MS_LOG(WARNING) << "GetNext not found"; + MS_LOG(INFO) << "GetNext not found"; } } @@ -174,7 +174,7 @@ std::string ProfilingUtils::GetGraphLastTbeKernelName(const std::vector gra void ProfilingUtils::ReportProfilingData(const std::vector &task_ids, const std::vector &stream_ids, NotNull graph) { if (!ValidComputeGraph(graph)) { - MS_LOG(WARNING) << "Not a valid compute graph:" << graph->graph_id(); + MS_LOG(INFO) << "Not a valid compute graph:" << graph->graph_id(); return; } diff --git a/mindspore/ccsrc/runtime/device/ascend/profiling/reporter/graph_desc_reporter.cc b/mindspore/ccsrc/runtime/device/ascend/profiling/reporter/graph_desc_reporter.cc index fffa4d1903..0397328756 100644 --- a/mindspore/ccsrc/runtime/device/ascend/profiling/reporter/graph_desc_reporter.cc +++ b/mindspore/ccsrc/runtime/device/ascend/profiling/reporter/graph_desc_reporter.cc @@ -25,6 +25,7 @@ namespace ascend { void GraphDescReporter::ReportData() { for (const auto &node : cnode_list_) { if (AnfAlgo::GetKernelType(node) != TBE_KERNEL && AnfAlgo::GetKernelType(node) != AKG_KERNEL) { + MS_LOG(INFO) << "Skip non tbe kernel:" << node->fullname_with_scope(); continue; } std::vector input_data_list; diff --git a/mindspore/ccsrc/runtime/device/ascend/profiling/reporter/task_desc_reporter.cc b/mindspore/ccsrc/runtime/device/ascend/profiling/reporter/task_desc_reporter.cc index 26d722aa1a..df2fc91de2 100644 --- a/mindspore/ccsrc/runtime/device/ascend/profiling/reporter/task_desc_reporter.cc +++ b/mindspore/ccsrc/runtime/device/ascend/profiling/reporter/task_desc_reporter.cc @@ -32,7 +32,7 @@ void TaskDescReporter::ReportData() { size_t task_index = 0; for (const auto &node : cnode_list_) { if (AnfAlgo::GetKernelType(node) != TBE_KERNEL && AnfAlgo::GetKernelType(node) != AKG_KERNEL) { - MS_LOG(WARNING) << "Skip non tbe kernel"; + MS_LOG(INFO) << "Skip non tbe kernel:" << node->fullname_with_scope(); ++task_index; continue; } diff --git a/mindspore/ccsrc/runtime/device/kernel_adjust.cc b/mindspore/ccsrc/runtime/device/kernel_adjust.cc index b3a94a1f6c..7c780618f0 100644 --- a/mindspore/ccsrc/runtime/device/kernel_adjust.cc +++ b/mindspore/ccsrc/runtime/device/kernel_adjust.cc @@ -568,7 +568,7 @@ void KernelAdjust::Profiling(NotNull kernel_graph_ptr) { } ProfilingTraceInfo profiling_trace_info = ProfilingUtils::GetProfilingTraceFromEnv(kernel_graph_ptr); if (!profiling_trace_info.IsValid()) { - MS_LOG(WARNING) << "[profiling] no profiling node found!"; + MS_LOG(INFO) << "[profiling] no profiling node found!"; return; } InsertProfilingKernel(profiling_trace_info, kernel_graph_ptr);