From a86a38080f044622fc80e3e53a0d8f0813675978 Mon Sep 17 00:00:00 2001 From: Parastoo Ashtari Date: Mon, 5 Jul 2021 10:37:05 -0400 Subject: [PATCH] Fixed CPU dump error --- mindspore/ccsrc/debug/data_dump/dump_json_parser.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mindspore/ccsrc/debug/data_dump/dump_json_parser.cc b/mindspore/ccsrc/debug/data_dump/dump_json_parser.cc index 5278943be76..32e0ce9e94b 100644 --- a/mindspore/ccsrc/debug/data_dump/dump_json_parser.cc +++ b/mindspore/ccsrc/debug/data_dump/dump_json_parser.cc @@ -325,6 +325,7 @@ void DumpJsonParser::ParseNetName(const nlohmann::json &content) { void DumpJsonParser::ParseIteration(const nlohmann::json &content) { CheckJsonStringType(content, kIteration); + auto context = MsContext::GetInstance(); if (e2e_dump_enabled_ || async_dump_enabled_) { iteration_ = content; if (iteration_.empty() || (!std::all_of(iteration_.begin(), iteration_.end(), [](char c) { @@ -332,6 +333,8 @@ void DumpJsonParser::ParseIteration(const nlohmann::json &content) { }) && iteration_ != "all")) { MS_LOG(EXCEPTION) << "iteration only supports digits, {'-', '|'}, or just \"all\" but got: " << iteration_; } + } else if (context->get_param(MS_CTX_DEVICE_TARGET) == kCPUDevice) { + MS_LOG(WARNING) << "Dump not enabled. "; } else { MS_LOG(EXCEPTION) << "Dump Json Parse Failed. Async or E2E should be enabled. "; }