Browse Source

fix the bugs of cannot open virtual node

tags/v1.1.0
maning202007 5 years ago
parent
commit
830a761575
5 changed files with 45 additions and 3007 deletions
  1. +41
    -22
      mindinsight/debugger/stream_cache/debugger_multigraph.py
  2. +1
    -672
      tests/st/func/debugger/expect_results/restful_results/multi_retrieve_aggregation_scope_node.json
  3. +1
    -44
      tests/st/func/debugger/expect_results/restful_results/multi_retrieve_all.json
  4. +1
    -534
      tests/st/func/debugger/expect_results/restful_results/multi_retrieve_scope_node.json
  5. +1
    -1735
      tests/st/func/debugger/expect_results/restful_results/multi_retrieve_single_node.json

+ 41
- 22
mindinsight/debugger/stream_cache/debugger_multigraph.py View File

@@ -42,28 +42,7 @@ class DebuggerMultiGraph(DebuggerGraph):
# add nodes
normal_nodes = copy.deepcopy(graph.normal_node_map)
for _, node_obj in normal_nodes.items():
pre_scope = graph_name + "/"
node_obj.name = pre_scope + node_obj.name
node_obj.full_name = pre_scope + node_obj.full_name
if node_obj.scope:
node_obj.scope = pre_scope + node_obj.scope
else:
node_obj.scope = graph_name

# update inputs
old_inputs = copy.deepcopy(node_obj.inputs)
for src_name, input_attr in old_inputs.items():
new_src_name = graph_name + "/" + src_name
node_obj.add_inputs(new_src_name, input_attr)
node_obj.delete_inputs(src_name)

# update_outputs
old_outputs = copy.deepcopy(node_obj.outputs)
for dst_name, output_attr in old_outputs.items():
new_dst_name = graph_name + "/" + dst_name
node_obj.add_outputs(new_dst_name, output_attr)
node_obj.delete_outputs(dst_name)

self._add_graph_scope(node_obj, graph_name)
self._cache_node(node_obj)

# add graph_node
@@ -79,3 +58,43 @@ class DebuggerMultiGraph(DebuggerGraph):
"Build multi_graph end, all node count: %s, const count: %s, parameter count: %s.",
self.normal_node_count, len(self._const_node_temp_cache),
len(self._parameter_node_temp_cache))

def _add_graph_scope(self, node, graph_name):
"""Add graph scope to the inputs and outputs in node"""

# add graph scope to node name
pre_scope = graph_name + "/"
node.name = pre_scope + node.name
node.full_name = pre_scope + node.full_name
if node.scope:
node.scope = pre_scope + node.scope
else:
node.scope = graph_name

# update inputs
old_inputs = copy.deepcopy(node.inputs)
for src_name, input_attr in old_inputs.items():
new_src_name = graph_name + "/" + src_name
node.add_inputs(new_src_name, input_attr)
node.delete_inputs(src_name)

# update outputs
old_outputs = copy.deepcopy(node.outputs)
for dst_name, output_attr in old_outputs.items():
new_dst_name = graph_name + "/" + dst_name
node.add_outputs(new_dst_name, output_attr)
node.delete_outputs(dst_name)

# update proxy_inputs
old_proxy_inputs = copy.deepcopy(node.proxy_inputs)
for src_name, input_attr in old_proxy_inputs.items():
new_src_name = graph_name + "/" + src_name
node.add_proxy_inputs(new_src_name, input_attr)
node.delete_proxy_inputs(src_name)

# update proxy_outputs
old_proxy_outputs = copy.deepcopy(node.proxy_outputs)
for dst_name, output_attr in old_proxy_outputs.items():
new_dst_name = graph_name + "/" + dst_name
node.add_proxy_outputs(new_dst_name, output_attr)
node.delete_proxy_outputs(dst_name)

+ 1
- 672
tests/st/func/debugger/expect_results/restful_results/multi_retrieve_aggregation_scope_node.json
File diff suppressed because it is too large
View File


+ 1
- 44
tests/st/func/debugger/expect_results/restful_results/multi_retrieve_all.json View File

@@ -1,44 +1 @@
{
"metadata": {
"state": "waiting",
"step": 1,
"device_name": "0",
"node_name": "",
"backend": "Ascend",
"enable_recheck": false,
"graph_name": ""
},
"graph": {
"graph_names": [
"graph_0",
"graph_1"
],
"nodes": [
{
"name": "graph_0",
"type": "name_scope",
"attr": {},
"input": {},
"output": {},
"output_i": 0,
"proxy_input": {},
"proxy_output": {},
"subnode_count": 2,
"independent_layout": false
},
{
"name": "graph_1",
"type": "name_scope",
"attr": {},
"input": {},
"output": {},
"output_i": 0,
"proxy_input": {},
"proxy_output": {},
"subnode_count": 2,
"independent_layout": false
}
]
},
"watch_points": []
}
{"metadata": {"state": "waiting", "step": 1, "device_name": "0", "node_name": "", "backend": "Ascend", "enable_recheck": false, "graph_name": ""}, "graph": {"graph_names": ["graph_0", "graph_1"], "nodes": [{"name": "graph_0", "type": "name_scope", "attr": {}, "input": {}, "output": {}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 2, "independent_layout": false}, {"name": "graph_1", "type": "name_scope", "attr": {}, "input": {}, "output": {}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 2, "independent_layout": false}]}, "watch_points": []}

+ 1
- 534
tests/st/func/debugger/expect_results/restful_results/multi_retrieve_scope_node.json
File diff suppressed because it is too large
View File


+ 1
- 1735
tests/st/func/debugger/expect_results/restful_results/multi_retrieve_single_node.json
File diff suppressed because it is too large
View File


Loading…
Cancel
Save