Browse Source

fix the bug about sending watchpoints

tags/v1.1.0
yelihua 5 years ago
parent
commit
59afb81190
2 changed files with 6 additions and 7 deletions
  1. +6
    -6
      mindinsight/debugger/stream_handler/watchpoint_handler.py
  2. +0
    -1
      mindinsight/debugger/stream_operator/training_control_operator.py

+ 6
- 6
mindinsight/debugger/stream_handler/watchpoint_handler.py View File

@@ -111,16 +111,16 @@ class WatchpointHandler(StreamHandlerBase):
Returns:
list[SetCMD], updated watchpoint to be sent to MindSpore.
"""
res = []
newly_set_cmds = []
for _, watchpoint in self._updated_watchpoints.items():
# construct set command with leaf nodes
watch_nodes = watchpoint.get_watch_nodes()
leaf_watch_nodes = self._expand_to_leaf_nodes(graph_stream, watch_nodes)
res.append(watchpoint.get_pending_cmd(leaf_watch_nodes))
res.extend(self._deleted_watchpoints)
for _, set_cmd in self._cache_set_cmd.items():
res.append(set_cmd)
return res
newly_set_cmds.append(watchpoint.get_pending_cmd(leaf_watch_nodes))
newly_set_cmds.extend(self._deleted_watchpoints)
self.sync_set_cmd(newly_set_cmds)
return list(self._cache_set_cmd.values())

@staticmethod
def _expand_to_leaf_nodes(graph_stream, watch_nodes):


+ 0
- 1
mindinsight/debugger/stream_operator/training_control_operator.py View File

@@ -202,7 +202,6 @@ class TrainingControlOperator:
event.set_cmd.CopyFrom(set_cmd)
self._cache_store.put_command(event)
log.debug("Send SetCMD to MindSpore. %s", event)
self._watchpoint_stream.sync_set_cmd(set_commands)

def pause_training(self):
"""


Loading…
Cancel
Save