From dbed33a2ad65f5969fdd72bdb031a9504e8535bb Mon Sep 17 00:00:00 2001 From: TinaMengtingZhang Date: Tue, 21 Sep 2021 17:53:01 -0400 Subject: [PATCH] Fix online debugger terminate with 1 issue: I3YAPB --- mindspore/ccsrc/debug/debugger/debugger.cc | 6 +++--- mindspore/ccsrc/debug/debugger/debugger.h | 2 +- mindspore/ccsrc/pipeline/jit/pipeline.cc | 7 ++++++- mindspore/ccsrc/pipeline/jit/pipeline.h | 6 +++++- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/mindspore/ccsrc/debug/debugger/debugger.cc b/mindspore/ccsrc/debug/debugger/debugger.cc index 031dc412ac5..7a341c55042 100644 --- a/mindspore/ccsrc/debug/debugger/debugger.cc +++ b/mindspore/ccsrc/debug/debugger/debugger.cc @@ -768,7 +768,7 @@ void Debugger::CommandLoop() { break; case DebuggerCommand::kExitCMD: MS_LOG(INFO) << "ExitCMD"; - Exit(); + Exit(true); // Used for debugger termination run = true; break; @@ -1077,11 +1077,11 @@ std::list Debugger::LoadTensorsStat(const ProtoVector Debugger::CheckWatchpoints(const std::string &watchnode, const CNodePtr &kernel, diff --git a/mindspore/ccsrc/debug/debugger/debugger.h b/mindspore/ccsrc/debug/debugger/debugger.h index 1ac0c5e1a68..3eb5f940f02 100644 --- a/mindspore/ccsrc/debug/debugger/debugger.h +++ b/mindspore/ccsrc/debug/debugger/debugger.h @@ -223,7 +223,7 @@ class Debugger : public std::enable_shared_from_this { std::list LoadTensorsStat(const ProtoVector &tensors) const; // terminate training process - void Exit(); + void Exit(bool exit_success = false); // analyze tensors and check watchpoint conditions // return names of tensors and what condition they hit diff --git a/mindspore/ccsrc/pipeline/jit/pipeline.cc b/mindspore/ccsrc/pipeline/jit/pipeline.cc index 6fe4ea0d01a..6f891f3ab1e 100644 --- a/mindspore/ccsrc/pipeline/jit/pipeline.cc +++ b/mindspore/ccsrc/pipeline/jit/pipeline.cc @@ -107,6 +107,7 @@ GraphExecutorPyPtr GraphExecutorPy::executor_ = nullptr; std::mutex GraphExecutorPy::instance_lock_; #ifdef ENABLE_DEBUGGER bool GraphExecutorPy::debugger_terminate_ = false; +bool GraphExecutorPy::exit_success_ = false; #endif std::unordered_map { static void ClearRes(); #ifdef ENABLE_DEBUGGER static bool GetDebugTerminate() { return debugger_terminate_; } - static void DebugTerminate(bool val) { debugger_terminate_ = val; } + static void DebugTerminate(bool val, bool exit_success) { + debugger_terminate_ = val; + exit_success_ = exit_success; + } void TerminateDebugger(); #endif @@ -131,6 +134,7 @@ class GraphExecutorPy : public std::enable_shared_from_this { static std::mutex instance_lock_; #ifdef ENABLE_DEBUGGER static bool debugger_terminate_; + static bool exit_success_; #endif std::map stra_dict_; std::string phase_ = "";