Change debugger version from 1.1.0 to 1.2.0

pull/12229/head
maning202007 4 years ago
parent d02f41d2c2
commit b437c0d418

@ -102,7 +102,7 @@ void Debugger::Init(const uint32_t device_id, const std::string device_target) {
device_id_ = device_id;
MS_LOG(INFO) << "Debugger got device_target: " << device_target;
device_target_ = device_target;
version_ = "1.1.0";
version_ = "1.2.0";
}
void Debugger::EnableDebugger() {
@ -617,6 +617,29 @@ void Debugger::CommandLoop() {
run = true;
break;
case DebuggerCommand::kRunCMD:
ProcessRunCMD(reply);
// exit loop
run = true;
break;
case DebuggerCommand::kSetCMD:
ProcessKSetCMD(reply);
break;
case DebuggerCommand::kViewCMD:
ProcessKViewCMD(reply);
break;
case DebuggerCommand::kVersionMatchedCMD:
MS_LOG(ERROR) << "Received unexpected Version Matched CMD from Mindinsight.";
Exit();
break;
default:
MS_LOG(ERROR) << "Received unknown CMD from Mindinsight";
Exit();
break;
}
}
}
void Debugger::ProcessRunCMD(const EventReply &reply) {
MS_LOG(INFO) << "RunCMD";
if (GetRunLevel(reply) == "recheck") {
MS_LOG(INFO) << "rechecking all watchpoints";
@ -631,12 +654,10 @@ void Debugger::CommandLoop() {
MS_LOG(INFO) << "run_level: " << run_level_;
MS_LOG(INFO) << "node_name_: " << node_name_;
// exit loop
run = true;
}
break;
case DebuggerCommand::kSetCMD:
}
void Debugger::ProcessKSetCMD(const EventReply &reply) {
MS_LOG(INFO) << "SetCMD";
MS_LOG(INFO) << "id: " << GetWatchpointID(reply);
MS_LOG(INFO) << "delete: " << GetWatchpointDelete(reply);
@ -659,8 +680,9 @@ void Debugger::CommandLoop() {
}
SetWatchpoint(GetWatchnodes(reply), GetWatchcondition(reply), GetWatchpointID(reply), GetParameters(reply));
}
break;
case DebuggerCommand::kViewCMD: {
}
void Debugger::ProcessKViewCMD(const EventReply &reply) {
MS_LOG(INFO) << "ViewCMD";
// print view cmd content
ProtoVector<TensorProto> received_tensors = GetTensors(reply);
@ -690,17 +712,6 @@ void Debugger::CommandLoop() {
if (send_tensors_reply.status() != send_tensors_reply.OK) {
MS_LOG(ERROR) << "Error: SendTensors failed";
}
} break;
case DebuggerCommand::kVersionMatchedCMD:
MS_LOG(ERROR) << "Received unexpected Version Matched CMD from Mindinsight.";
Exit();
break;
default:
MS_LOG(ERROR) << "Received unknown CMD from Mindinsight";
Exit();
break;
}
}
}
void AddTensorProtoInfo(TensorProto *tensor_item, TensorProto tensor) {
@ -967,7 +978,7 @@ ProtoVector<TensorProto> GetTensors(const EventReply &reply) {
std::string GetTensorFullName(const TensorProto &tensor) {
string node_name = tensor.node_name();
if (tensor.truncate()) {
// scopes in node name are seperated by '/'
// scopes in node name are separated by '/'
// use the name without scope if truncate is true
std::size_t found = node_name.find_last_of("/");
node_name = node_name.substr(found + 1);

@ -41,7 +41,7 @@ template <class T>
using ProtoVector = google::protobuf::RepeatedPtrField<T>;
namespace mindspore {
// different types of command recieved by debugger
// different types of command received by debugger
// need to keep sync with client-side proto and server-side proto
enum class DebuggerCommand {
kExitCMD = 2,
@ -124,7 +124,7 @@ class Debugger : public std::enable_shared_from_this<Debugger> {
void SetTrainingDone(bool training_done);
// returns true if reply received and mindspore version matched with mindinsight version
// version_check should be true if you want the function to do backend compability check with Mindinsight
// version_check should be true if you want the function to do backend compatibility check with Mindinsight
bool SendMetadata(bool version_check);
void LoadParametersAndConst();
@ -187,6 +187,13 @@ class Debugger : public std::enable_shared_from_this<Debugger> {
// break if RunCMD
void CommandLoop();
// Process the RunCMD
void ProcessRunCMD(const EventReply &reply);
// Process the KSetCMD
void ProcessKSetCMD(const EventReply &reply);
// Process the KViewCMD
void ProcessKViewCMD(const EventReply &reply);
// set what nodes and conditions to watch
void SetWatchpoint(const ProtoVector<WatchNode> &nodes, const WatchCondition &condition, const int32_t id,
const ProtoVector<WatchCondition_Parameter> &parameters);

Loading…
Cancel
Save