fix d-chip wacthpoints, latest value for GPU inputs

This commit is contained in:
John Tzanakakis 2020-08-11 19:41:53 -04:00
parent 2905fb8c64
commit 3569513232
3 changed files with 25 additions and 22 deletions

View File

@ -172,9 +172,14 @@ void Debugger::PostExecute() {
return; return;
} }
if (debugger_enabled_ && !is_dataset_graph_) { if (debugger_enabled_ && !is_dataset_graph_) {
if (device_target_ != kGPUDevice) {
num_step_++;
MS_LOG(INFO) << "Debugger suspend at end of step; number of steps executed: " << num_step_; MS_LOG(INFO) << "Debugger suspend at end of step; number of steps executed: " << num_step_;
SendWatchpointsAndSuspend(CheckWatchpoints());
} else {
CommandLoop(); CommandLoop();
} }
}
} }
bool Debugger::ReadNodeDataRequired() { bool Debugger::ReadNodeDataRequired() {

View File

@ -46,7 +46,7 @@ class TensorLoader {
} }
} }
tensor_list.push_back(tensor); tensor_list.push_back(tensor);
tensor_list_map.insert({tensor->GetName(), tensor}); tensor_list_map[tensor->GetName()] = tensor; // use [] instead of insert to ensure latest value
auto node_name = tensor->GetName(); auto node_name = tensor->GetName();
node_name = node_name.substr(0, node_name.find_first_of(":")); node_name = node_name.substr(0, node_name.find_first_of(":"));
node_tensor_map.insert({node_name, tensor}); node_tensor_map.insert({node_name, tensor});

View File

@ -241,7 +241,6 @@ void LoadKernelData(Debugger *debugger, const CNodePtr &kernel,
} }
// get inputs // get inputs
if (!dump_enabled) {
auto input_size = AnfAlgo::GetInputTensorNum(kernel); auto input_size = AnfAlgo::GetInputTensorNum(kernel);
for (size_t j = 0; j < input_size; ++j) { for (size_t j = 0; j < input_size; ++j) {
auto input_kernel = kernel->input(j + 1); auto input_kernel = kernel->input(j + 1);
@ -261,7 +260,6 @@ void LoadKernelData(Debugger *debugger, const CNodePtr &kernel,
<< ", tensor_name:" << input_tensor_name << ", host_format:" << format << ".!"; << ", tensor_name:" << input_tensor_name << ", host_format:" << format << ".!";
} }
} }
}
// get outputs // get outputs
auto output_size = AnfAlgo::GetOutputTensorNum(kernel); auto output_size = AnfAlgo::GetOutputTensorNum(kernel);