From a3e617b568adb6c7bf5610bc9f25c57f6155c1a7 Mon Sep 17 00:00:00 2001 From: maning202007 Date: Thu, 4 Jul 2024 20:14:21 +0800 Subject: [PATCH 1/2] Delete debugger entry --- docs/api_python/mindinsight.debugger.rst | 634 ------ mindinsight/common/hook/debugger.py | 194 -- mindinsight/debugger/__init__.py | 23 - mindinsight/debugger/api/__init__.py | 15 - mindinsight/debugger/api/conditions.py | 1179 ----------- mindinsight/debugger/api/debugger_engine.py | 45 - mindinsight/debugger/api/debugger_tensor.py | 219 -- mindinsight/debugger/api/dump_analyzer.py | 867 -------- mindinsight/debugger/api/node.py | 359 ---- mindinsight/debugger/api/statistic.py | 62 - .../debugger/debugger_folder_analyzer.py | 21 +- .../src/views/train-manage/summary-manage.vue | 74 +- tests/st/func/debugger/__init__.py | 20 - tests/st/func/debugger/api/__init__.py | 20 - .../func/debugger/api/test_dump_analyzer.py | 140 -- tests/st/func/debugger/api/test_node.py | 109 - tests/st/func/debugger/conftest.py | 71 - .../debugger/debugger_services/__init__.py | 20 - .../debugger_services/mock_dbg_services.py | 199 -- .../test_debugger_services.py | 78 - .../rank_0/.dump_metadata/data_dump.json | 12 - .../async/rank_0/.dump_metadata/hccl.json | 23 - .../sync/rank_0/.dump_metadata/data_dump.json | 15 - .../sync/rank_0/.dump_metadata/hccl.json | 23 - .../sync/rank_0/.dump_metadata/data_dump.json | 15 - ...ph_handler_get_1_no_filter_condintion.json | 1 - .../graph_handler_get_2_list_nodes.json | 1 - .../offline_debugger/get_graph_runs.json | 55 - .../get_graph_runs_exception.json | 1 - .../load_device_info_ascend.json | 21 - .../retrieve_aggregation_scope_node.json | 708 ------- .../offline_debugger/retrieve_all.json | 575 ------ .../retrieve_empty_tensor_history.json | 21 - .../retrieve_full_tensor_history.json | 43 - .../offline_debugger/retrieve_scope_node.json | 1185 ----------- .../retrieve_single_node.json | 1724 ---------------- .../retrieve_tensor_graph-0.json | 521 ----- .../retrieve_tensor_value.json | 54 - .../search_unwatched_leaf_node.json | 39 - .../restful_results/before_train_begin.json | 1 - .../restful_results/compare_tensors.json | 1 - .../create_and_delete_watchpoint.json | 1 - .../get_conditions_for_ascend.json | 1 - .../get_conditions_for_gpu.json | 1 - .../restful_results/multi_next_node.json | 61 - ...multi_retrieve_aggregation_scope_node.json | 1 - .../restful_results/multi_retrieve_all.json | 61 - .../multi_retrieve_scope_node.json | 1 - .../multi_retrieve_single_node.json | 1 - .../multi_retrieve_watchpoint.json | 1 - .../restful_results/multi_run_steps.json | 1 - .../recommended_watchpoints_at_startup.json | 1 - .../retrieve_aggregation_scope_node.json | 1 - .../restful_results/retrieve_all.json | 563 ------ .../retrieve_empty_tensor_history.json | 1 - .../retrieve_empty_watchpoint_hit_list | 1 - .../retrieve_full_tensor_history.json | 1 - .../retrieve_next_node_on_gpu.json | 563 ------ .../restful_results/retrieve_node_by_bfs.json | 1 - .../retrieve_node_by_bfs_ascend.json | 1 - .../restful_results/retrieve_scope_node.json | 1 - .../restful_results/retrieve_single_node.json | 1724 ---------------- .../retrieve_single_watchpoint_hit.json | 1754 ----------------- .../retrieve_tensor_graph-0.json | 195 -- .../retrieve_tensor_graph-1.json | 120 -- .../retrieve_tensor_hits-0.json | 1 - .../retrieve_tensor_hits-1.json | 1 - .../retrieve_tensor_value.json | 31 - .../retrieve_watchpoint_hit.json | 59 - .../restful_results/search_activation.json | 56 - .../search_activation_multi_graph.json | 122 -- .../restful_results/search_gradient.json | 114 -- .../search_gradient_multi_graph.json | 610 ------ .../search_unwatched_leaf_node.json | 39 - .../restful_results/search_weight.json | 75 - .../search_weight_multi_graph.json | 212 -- .../restful_results/version_mismatch.json | 23 - .../expect_results/search_nodes_0.json | 1 - tests/st/func/debugger/mock_ms_client.py | 227 --- .../func/debugger/stream_operator/__init__.py | 20 - .../test_graph_runs_operator.py | 98 - tests/st/func/debugger/test_data_loader.py | 215 -- tests/st/func/debugger/test_offline_api.py | 308 --- tests/st/func/debugger/test_restful_api.py | 750 ------- tests/st/func/debugger/utils.py | 291 --- tests/ut/debugger/__init__.py | 20 - tests/ut/debugger/configurations.py | 171 -- .../debugger_server/retrieve_all.json | 1 - .../retrieve_tensor_history.json | 37 - .../graph/get_tensor_graph-0.json | 1 - .../graph/get_tensor_graph-1.json | 1 - .../graph/get_tensor_graph-2.json | 1 - ...ph_handler_get_1_no_filter_condintion.json | 1 - .../graph/graph_handler_get_2_list_nodes.json | 1 - .../graph_handler_get_3_single_node.json | 1 - .../expected_results/graph/search_node_1.json | 310 --- .../graph/search_nodes_0.json | 58 - .../graph/search_nodes_by_type_0.json | 101 - .../graph/search_nodes_by_type_1.json | 44 - .../expected_results/graph/tensor_hist_0.json | 18 - .../expected_results/graph/tensor_hist_1.json | 53 - .../watchpoint/watchpoint_handler_get_0.json | 80 - .../watchpoint/watchpoint_handler_get_1.json | 1 - .../watchpoint_hit_group_focused_node_0.json | 30 - .../watchpoint_hit_group_focused_node_1.json | 30 - .../watchpoint_hit_handler_get_0.json | 52 - .../watchpoint_hit_handler_get_1.json | 1 - .../watchpoint_hit_handler_group_by_None.json | 54 - ...watchpoint_hit_handler_group_by_graph.json | 30 - ...point_hit_handler_group_by_watchpoint.json | 30 - tests/ut/debugger/stream_cache/__init__.py | 15 - .../stream_cache/test_node_type_identifier.py | 77 - tests/ut/debugger/stream_handler/__init__.py | 15 - .../stream_handler/test_graph_handler.py | 137 -- .../stream_handler/test_metadata_handler.py | 91 - .../stream_handler/test_tensor_handler.py | 90 - .../stream_handler/test_watchpoint_handler.py | 283 --- tests/ut/debugger/stream_operator/__init__.py | 15 - .../test_training_control_operator.py | 77 - .../ut/debugger/test_debugger_grpc_server.py | 255 --- .../debugger/test_debugger_offline_server.py | 102 - tests/ut/debugger/test_debugger_server.py | 276 --- 122 files changed, 2 insertions(+), 20256 deletions(-) delete mode 100644 docs/api_python/mindinsight.debugger.rst delete mode 100644 mindinsight/common/hook/debugger.py delete mode 100644 mindinsight/debugger/api/__init__.py delete mode 100644 mindinsight/debugger/api/conditions.py delete mode 100644 mindinsight/debugger/api/debugger_engine.py delete mode 100644 mindinsight/debugger/api/debugger_tensor.py delete mode 100644 mindinsight/debugger/api/dump_analyzer.py delete mode 100644 mindinsight/debugger/api/node.py delete mode 100644 mindinsight/debugger/api/statistic.py delete mode 100644 tests/st/func/debugger/__init__.py delete mode 100644 tests/st/func/debugger/api/__init__.py delete mode 100644 tests/st/func/debugger/api/test_dump_analyzer.py delete mode 100644 tests/st/func/debugger/api/test_node.py delete mode 100644 tests/st/func/debugger/conftest.py delete mode 100644 tests/st/func/debugger/debugger_services/__init__.py delete mode 100644 tests/st/func/debugger/debugger_services/mock_dbg_services.py delete mode 100644 tests/st/func/debugger/debugger_services/test_debugger_services.py delete mode 100644 tests/st/func/debugger/dump_files/Ascend/async/rank_0/.dump_metadata/data_dump.json delete mode 100644 tests/st/func/debugger/dump_files/Ascend/async/rank_0/.dump_metadata/hccl.json delete mode 100644 tests/st/func/debugger/dump_files/Ascend/sync/rank_0/.dump_metadata/data_dump.json delete mode 100644 tests/st/func/debugger/dump_files/Ascend/sync/rank_0/.dump_metadata/hccl.json delete mode 100644 tests/st/func/debugger/dump_files/GPU/sync/rank_0/.dump_metadata/data_dump.json delete mode 100644 tests/st/func/debugger/expect_results/graph_handler_get_1_no_filter_condintion.json delete mode 100644 tests/st/func/debugger/expect_results/graph_handler_get_2_list_nodes.json delete mode 100644 tests/st/func/debugger/expect_results/offline_debugger/get_graph_runs.json delete mode 100644 tests/st/func/debugger/expect_results/offline_debugger/get_graph_runs_exception.json delete mode 100644 tests/st/func/debugger/expect_results/offline_debugger/load_device_info_ascend.json delete mode 100644 tests/st/func/debugger/expect_results/offline_debugger/retrieve_aggregation_scope_node.json delete mode 100644 tests/st/func/debugger/expect_results/offline_debugger/retrieve_all.json delete mode 100644 tests/st/func/debugger/expect_results/offline_debugger/retrieve_empty_tensor_history.json delete mode 100644 tests/st/func/debugger/expect_results/offline_debugger/retrieve_full_tensor_history.json delete mode 100644 tests/st/func/debugger/expect_results/offline_debugger/retrieve_scope_node.json delete mode 100644 tests/st/func/debugger/expect_results/offline_debugger/retrieve_single_node.json delete mode 100644 tests/st/func/debugger/expect_results/offline_debugger/retrieve_tensor_graph-0.json delete mode 100644 tests/st/func/debugger/expect_results/offline_debugger/retrieve_tensor_value.json delete mode 100644 tests/st/func/debugger/expect_results/offline_debugger/search_unwatched_leaf_node.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/before_train_begin.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/compare_tensors.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/create_and_delete_watchpoint.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/get_conditions_for_ascend.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/get_conditions_for_gpu.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/multi_next_node.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/multi_retrieve_aggregation_scope_node.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/multi_retrieve_all.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/multi_retrieve_scope_node.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/multi_retrieve_single_node.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/multi_retrieve_watchpoint.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/multi_run_steps.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/recommended_watchpoints_at_startup.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/retrieve_aggregation_scope_node.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/retrieve_all.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/retrieve_empty_tensor_history.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/retrieve_empty_watchpoint_hit_list delete mode 100644 tests/st/func/debugger/expect_results/restful_results/retrieve_full_tensor_history.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/retrieve_next_node_on_gpu.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/retrieve_node_by_bfs.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/retrieve_node_by_bfs_ascend.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/retrieve_scope_node.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/retrieve_single_node.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/retrieve_single_watchpoint_hit.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/retrieve_tensor_graph-0.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/retrieve_tensor_graph-1.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/retrieve_tensor_hits-0.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/retrieve_tensor_hits-1.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/retrieve_tensor_value.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/retrieve_watchpoint_hit.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/search_activation.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/search_activation_multi_graph.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/search_gradient.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/search_gradient_multi_graph.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/search_unwatched_leaf_node.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/search_weight.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/search_weight_multi_graph.json delete mode 100644 tests/st/func/debugger/expect_results/restful_results/version_mismatch.json delete mode 100644 tests/st/func/debugger/expect_results/search_nodes_0.json delete mode 100644 tests/st/func/debugger/mock_ms_client.py delete mode 100644 tests/st/func/debugger/stream_operator/__init__.py delete mode 100644 tests/st/func/debugger/stream_operator/test_graph_runs_operator.py delete mode 100644 tests/st/func/debugger/test_data_loader.py delete mode 100644 tests/st/func/debugger/test_offline_api.py delete mode 100644 tests/st/func/debugger/test_restful_api.py delete mode 100644 tests/st/func/debugger/utils.py delete mode 100644 tests/ut/debugger/__init__.py delete mode 100644 tests/ut/debugger/configurations.py delete mode 100644 tests/ut/debugger/expected_results/debugger_server/retrieve_all.json delete mode 100644 tests/ut/debugger/expected_results/debugger_server/retrieve_tensor_history.json delete mode 100644 tests/ut/debugger/expected_results/graph/get_tensor_graph-0.json delete mode 100644 tests/ut/debugger/expected_results/graph/get_tensor_graph-1.json delete mode 100644 tests/ut/debugger/expected_results/graph/get_tensor_graph-2.json delete mode 100644 tests/ut/debugger/expected_results/graph/graph_handler_get_1_no_filter_condintion.json delete mode 100644 tests/ut/debugger/expected_results/graph/graph_handler_get_2_list_nodes.json delete mode 100644 tests/ut/debugger/expected_results/graph/graph_handler_get_3_single_node.json delete mode 100644 tests/ut/debugger/expected_results/graph/search_node_1.json delete mode 100644 tests/ut/debugger/expected_results/graph/search_nodes_0.json delete mode 100644 tests/ut/debugger/expected_results/graph/search_nodes_by_type_0.json delete mode 100644 tests/ut/debugger/expected_results/graph/search_nodes_by_type_1.json delete mode 100644 tests/ut/debugger/expected_results/graph/tensor_hist_0.json delete mode 100644 tests/ut/debugger/expected_results/graph/tensor_hist_1.json delete mode 100644 tests/ut/debugger/expected_results/watchpoint/watchpoint_handler_get_0.json delete mode 100644 tests/ut/debugger/expected_results/watchpoint/watchpoint_handler_get_1.json delete mode 100644 tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_group_focused_node_0.json delete mode 100644 tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_group_focused_node_1.json delete mode 100644 tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_handler_get_0.json delete mode 100644 tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_handler_get_1.json delete mode 100644 tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_handler_group_by_None.json delete mode 100644 tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_handler_group_by_graph.json delete mode 100644 tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_handler_group_by_watchpoint.json delete mode 100644 tests/ut/debugger/stream_cache/__init__.py delete mode 100644 tests/ut/debugger/stream_cache/test_node_type_identifier.py delete mode 100644 tests/ut/debugger/stream_handler/__init__.py delete mode 100644 tests/ut/debugger/stream_handler/test_graph_handler.py delete mode 100644 tests/ut/debugger/stream_handler/test_metadata_handler.py delete mode 100644 tests/ut/debugger/stream_handler/test_tensor_handler.py delete mode 100644 tests/ut/debugger/stream_handler/test_watchpoint_handler.py delete mode 100644 tests/ut/debugger/stream_operator/__init__.py delete mode 100644 tests/ut/debugger/stream_operator/test_training_control_operator.py delete mode 100644 tests/ut/debugger/test_debugger_grpc_server.py delete mode 100644 tests/ut/debugger/test_debugger_offline_server.py delete mode 100644 tests/ut/debugger/test_debugger_server.py diff --git a/docs/api_python/mindinsight.debugger.rst b/docs/api_python/mindinsight.debugger.rst deleted file mode 100644 index e4cd88ce..00000000 --- a/docs/api_python/mindinsight.debugger.rst +++ /dev/null @@ -1,634 +0,0 @@ -mindinsight.debugger -==================== - -MindSpore调试器是为图模式训练提供的调试工具,可以用来查看并分析计算图节点的中间结果。 在MindSpore图模式的训练过程中,用户无法方便地获取到计算图中间节点的结果,使得训练调试变得很困难。 - -使用MindSpore调试器,用户可以:在MindInsight调试器界面结合计算图,查看图节点的输出结果;设置监测点,监测训练异常情况(比如检查张量溢出),在异常发生时追踪错误原因;查看权重等参数的变化情况;查看图节点和源代码的对应关系。 - -调试器API是为离线调试提供的Python API接口,使用之前需要先保存Dump数据。保存Dump数据的方法参考 `使用Dump功能在Graph模式调试 `_ 。 - -.. py:class:: mindinsight.debugger.DumpAnalyzer(dump_dir, mem_limit=None) - - 用来检查Dump数据的分析器。 - - .. warning:: - 此类中的所有API均为实验版本,将来可能更改或者删除。 - - 参数: - - **dump_dir** (str) - 存储Dump数据文件的目录。 - - **mem_limit** (int,可选) - 检查监测点的内存限制(以MB为单位),可选值:从2048MB到2147483647MB, ``None`` 表示不设限制,只受限于计算机内存。默认值: ``None``。 - - .. py:method:: check_watchpoints(watchpoints, error_on_no_value=False) - - 批量检查给定监测点。 - - .. note:: - 1. 为了提升速度,应该同时给出迭代下的所有监测点,避免多次读取张量。 - 2. `check_watchpoints` 函数在调用的时候会启动新的进程,需要通过 `if __name__ == '__main__'` 进行调用。 - - 参数: - - **watchpoints** (Iterable[Watchpoint]) - 监测点列表。 - - **error_on_no_value** (bool,可选) - 当指定的张量没有存储在 `dump_dir` 路径中时,是否抛出错误码。默认值: ``False``。 - - 返回: - Iterable[WatchpointHit],监测点命中列表,并按张量落盘时间排序。 - - .. py:method:: export_graphs(output_dir=None) - - 将计算图导出到 `output_dir` 路径下的xlsx文件中。 - - 这些文件将包含图节点的堆栈信息。 - - 参数: - - **output_dir** (str,可选) - 保存文件的输出目录, ``None`` 表示使用当前的工作目录。默认值: ``None``。 - - 返回: - str,生成文件的路径。 - - .. py:method:: get_input_nodes(node) - - 获取指定节点的输入节点信息。 - - 参数: - - **node** (Node) - 指定节点。 - - 返回: - Iterable[Node],指定节点的输入节点。 - - .. py:method:: get_iterations(ranks=None) - - 获取有Dump数据的迭代序号列表。 - - 参数: - - **ranks** (Union[int, list[int], None],可选) - 指定逻辑卡号。逻辑卡号是指运行分布式训练时,将使用的设备从0开始编号,此编号称为逻辑卡号,例如,对于8卡计算机,指定训练时只使用4-7卡,那么4-7卡分别对应逻辑卡号0-3。如果设置成 ``None``,将返回所有逻辑卡的迭代序号列表。默认值:``None``。 - - 返回: - Iterable[int],有Dump数据的迭代序号列表,按从小到大排序。 - - .. py:method:: get_output_nodes(node) - - 获取指定节点的输出节点。 - - 参数: - - **node** (Node) - 指定节点。 - - 返回: - Iterable[Node],该节点的输出节点。 - - .. py:method:: get_ranks() - - 获取有Dump数据的逻辑卡号列表。 - - 返回: - Iterable[int],当前Dump目录中的逻辑卡号列表。 - - .. py:method:: list_affected_nodes(tensor) - - 列出使用指定张量作为输入的节点。 - - 受影响的节点是指使用给定张量作为输入的节点。如果一个节点受到给定张量的影响,那么当给定的张量发生变化时,该节点的输出值很可能会发生变化。 - - 参数: - - **tensor** (DebuggerTensor) - 指定张量。 - - 返回: - Iterable[Node],受指定张量影响的节点。 - - .. py:method:: select_nodes(query_string, use_regex=False, select_by="node_name", ranks=None, case_sensitive=True) - - 筛选节点。 - - 根据节点名称或节点堆栈信息选择符合要求的节点,具体用法请参考参数说明。 - - 参数: - - **query_string** (str) - 查询字符串。对于要选择的节点,匹配目标字段必须包含或能匹配到查询的字符串。 - - **use_regex** (bool,可选) - 是否对目标字段按照查询字符串进行正则匹配。默认值:``False``。 - - **select_by** (str,可选) - 选择节点时要搜索的字段。可用值为 ``""node_name"``、 ``"code_stack"``。 ``"node_name"`` 表示根据节点的名称进行筛选。 ``"code_stack"`` 表示对系统的堆栈信息进行筛选。默认值: ``"node_name"``。 - - **ranks** (Union[int, list[int], None],可选) - 要选择的逻辑卡号或者逻辑卡号列表, ``None`` 表示将考虑所有逻辑卡。选定的节点必须存在于指定的逻辑卡上。默认值: ``None``。 - - **case_sensitive** (bool,可选) - 对目标字段进行匹配时是否区分大小写。默认值: ``True``。 - - 返回: - Iterable[Node],匹配的节点。 - - .. py:method:: select_tensor_statistics(iterations=None, ranks=None) - - 筛选张量统计信息。 - - 根据给定的筛选条件选择目录中匹配的张量统计信息,具体用法请参考参数说明。 - - 参数: - - **iterations** (Union[int, list[int], None],可选) - 要选择的迭代序号或迭代序号列表, ``None`` 表示选择保存的所有迭代。默认值: ``None``。 - - **ranks** (Union[int, list[int], None],可选) - 要选择的逻辑卡号或逻辑卡号列表, ``None`` 表示将选择所有逻辑卡。默认值: ``None``。 - - 返回: - Dict[TensorStatistic],匹配的张量统计信息。格式如下, - - .. code-block:: - - { - "rank_id": - { - "iteration_id":[TensorStatistic], - ... - } - ... - } - - .. py:method:: select_tensors(query_string, use_regex=False, select_by="node_name", iterations=None, ranks=None, slots=None, case_sensitive=True) - - 筛选张量。 - - 根据给定的筛选条件选择目录中匹配的张量,具体用法请参考参数说明。 - - 参数: - - **query_string** (str) - 查询字符串。对于要选择的张量,匹配目标字段必须包含或能匹配到查询字符串。 - - **use_regex** (bool,可选) - 指明查询对象是否为正则表达式。默认值: ``False``。 - - **select_by** (str,可选) - 选择张量时要搜索的字段。可用值为 ``""node_name"``、 ``"code_stack"``。 ``"node_name"`` 表示在图中搜索张量的节点名称。 ``"code_stack"`` 表示输出该张量的节点的堆栈信息。默认值: ``"node_name"``。 - - **iterations** (Union[int, list[int], None],可选) - 要选择的迭代序号或迭代序号列表, ``None`` 表示选择保存的所有迭代。默认值: ``None``。 - - **ranks** (Union[int, list[int], None],可选) - 要选择的逻辑卡号或逻辑卡号列表, ``None`` 表示将选择所有逻辑卡。默认值: ``None``。 - - **slots** (list[int],可选) - 所选张量的编号, ``None`` 表示将选择所有编号。默认值: ``None``。 - - **case_sensitive** (bool,可选) - 选择张量时是否区分大小写。默认值: ``True``。 - - 返回: - Iterable[DebuggerTensor],匹配的张量。 - - .. py:method:: summary_statistics(statistics, overflow_value=65500, out_path="./") - - 汇总不同卡号、迭代的统计信息,并保存到指定路径。 - - 参数: - - **statistics** (Dict[TensorStatistic]) - 给定的张量统计信息。它可以是 `select_tensor_statistics` 的返回值。 - - **overflow_value** (int, 可选) - 给定的溢出阈值。 默认值: ``65500`` 。 - - **out_path** (str, 可选) - 指定保存统计信息的路径。 默认值: ``"./"`` 。 - -.. py:class:: mindinsight.debugger.Node(node_feature) - - 计算图中的节点。 - - .. warning:: - 此类中的所有API均为实验版本,将来可能更改或者删除。 - - 参数: - - **node_feature** (namedtuple) - 节点特征,包含以下信息: - - - **name** (str) - 节点名称。 - - **rank** (int) - 逻辑卡号。 - - **stack** (iterable[dict]) - 堆栈信息,每一项的格式为: - - .. code-block:: - - { - 'file_path': str, - 'line_no': int, - 'code_line': str - } - - - **graph_name** (str) - 图名称。 - - **root_graph_id** (int) - 根图id。 - - .. note:: - 用户不应该手动实例化此类。 - 这个类的实例是不可修改的。 - - .. py:method:: get_input_tensors(iterations=None, slots=None) - - 获取当前节点的输入张量。 - - 参数: - - **iterations** (Iterable[int],可选) - 指定迭代序号列表,``None`` 表示将考虑所有可用的迭代。默认值:``None``。 - - **slots** (Iterable[int],可选) - 指定输入张量的编号列表,``None`` 表示会返回所有的输入张量。默认值:``None``。 - - 返回: - Iterable[DebuggerTensor],节点的输入张量列表。 - - .. py:method:: get_output_tensors(iterations=None, slots=None) - - 获取当前节点的输出张量。 - - 参数: - - **iterations** (Iterable[int],可选) - 指定迭代序号列表,``None`` 表示将考虑所有可用的迭代。默认值:``None``。 - - **slots** (Iterable[int],可选) - 指定输出张量的编号列表,``None`` 表示会返回所有的输出张量。默认值:``None``。 - - 返回: - Iterable[DebuggerTensor],节点的输出张量。 - - .. py:method:: graph_name - :property: - - 获取当前节点的图名称。 - - 返回: - str,图名称。 - - .. py:method:: name - :property: - - 获取当前节点的全名。 - - 返回: - str,当前节点的全名。 - - .. py:method:: rank - :property: - - 获取当前节点逻辑卡号。 - - 返回: - int,当前节点所属的逻辑卡号。 - - .. py:method:: root_graph_id - :property: - - 获取当前节点所属的根图id。 - - 返回: - int,根图id。 - - .. py:method:: stack - :property: - - 获取当前节点的堆栈信息。 - - 返回: - iterable[dict],每一项的格式如下: - - .. code-block:: - - { - 'file_path': str, - 'line_no': int, - 'code_line': str - } - -.. py:class:: mindinsight.debugger.DebuggerTensor(node, slot, iteration) - - 具有特定逻辑卡号、迭代序号和调试信息的张量。 - - .. warning:: - 此类中的所有API均为实验版本,将来可能更改或者删除。 - - 参数: - - **node** (Node) - 输出此张量的节点。 - - **slot** (int) - 节点上张量的编号。 - - **iteration** (int) - 张量的迭代序号。 - - .. note:: - 用户不应该手动实例化此类。 - 这个类的实例是不可修改的。 - `DebuggerTensor` 始终是节点的输出张量。 - - .. py:method:: iteration - :property: - - 获取张量的迭代序号。 - - 返回: - int,张量的迭代序号。 - - .. py:method:: node - :property: - - 获取输出此张量的节点。 - - 返回: - Node,输出这个张量的节点。 - - .. py:method:: rank - :property: - - rank代表的是生成张量的设备逻辑卡的卡号。 - - 返回: - int,生成张量的设备的逻辑卡的卡号。 - - .. py:method:: slot - :property: - - 节点的输出可能有几个张量,slot指的是张量的编号。 - - 返回: - int,节点上生成张量的编号。 - - .. py:method:: value() - - 获取张量的值。 - - 返回: - Union[numpy.array, None],如果在相关迭代中找不到数据文件,则该值可能为None。 - -.. py:class:: mindinsight.debugger.Watchpoint(tensors, condition) - - 用来检查指定张量是否满足指定检查条件的监测点。 - - .. warning:: - 此类中的所有API均为实验版本,将来可能更改或者删除。 - - 参数: - - **tensors** (Iterable[DebuggerTensor]) - 要检查的张量。 - - **condition** (ConditionBase) - 应用于张量的检查条件。 - - .. py:method:: condition - :property: - - 获取应用于张量的检查条件。 - - 返回: - ConditionBase,应用于张量的检查条件。 - - .. py:method:: tensors - :property: - - 获取要检查的张量。 - - 返回: - Iterable[DebuggerTensor],要检查的张量。 - -.. py:class:: mindinsight.debugger.WatchpointHit - - 监测点命中情况。 - - .. warning:: - 此类中的所有API均为实验版本,将来可能更改或者删除。 - - .. note:: - 此类不能由用户实例化。 - 这个类的实例是无法修改的。 - - .. py:method:: error_code - :property: - - 获取错误码,当检查到监测点发生错误时。返回对应的错误码,0表示没有错误发生。 - - 返回: - int,错误码。 - - .. py:method:: error_msg - :property: - - 如果出现错误,获取检查监测点过程中的错误信息。 - - 返回: - list[str],错误信息列表。 - - .. py:method:: get_hit_detail() - - 获取被触发的检测条件对象,内含造成触发的张量的实际值情况。例如,命中监测点的监测条件为 `TensorTooLargeCondition(max_gt=None)` ,监测张量值的最大值是否大于0, `get_hit_detail` 返回该监测条件对象,且该对象中包含张量值的最大值。如果 `error_code` 不为0,则返回None。 - - 返回: - Union[ConditionBase, None],对应的监测条件的监测值的实际值,如果 `error_code` 不为0,则返回None。 - - .. py:method:: get_threshold() - - 获取用户设置的监测条件。 - - 返回: - ConditionBase,用户设置的监测条件。 - - .. py:method:: tensor - :property: - - 获取监测点命中的张量。 - - 返回: - DebuggerTensor,监测点命中的张量。 - -.. py:class:: mindinsight.debugger.TensorTooLargeCondition(abs_mean_gt=None, max_gt=None, min_gt=None, mean_gt=None) - - 检查张量值过大的监测条件。至少应该指定其中一个参数。 - - 当指定多个参数时,只要有一个参数满足检查条件,就会在检查后命中该监测点。 - - .. warning:: - 此类中的所有API均为实验版本,将来可能更改或者删除。 - - 参数: - - **abs_mean_gt** (float,可选) - 张量绝对值的均值阈值。当实际值大于该阈值时,则满足该检查条件。默认值:``None``。 - - **max_gt** (float,可选) - 张量最大值的阈值。当实际值大于该阈值时,则满足该检查条件。默认值:``None``。 - - **min_gt** (float,可选) - 张量最小值的阈值。当实际值大于该阈值时,则满足该检查条件。默认值:``None``。 - - **mean_gt** (float,可选) - 张量均值的阈值。当实际值大于该阈值时,则满足该检查条件。默认值:``None``。 - - .. py:method:: param_names - :property: - - 返回参数名称的列表。 - - 返回: - list[str],参数名称列表。 - -.. py:class:: mindinsight.debugger.TensorTooSmallCondition(abs_mean_lt=None, max_lt=None, min_lt=None, mean_lt=None) - - 检查张量值过小的监测条件。至少应该指定其中一个参数。 - - 当指定多个参数时,只要有一个参数满足检查条件,就会在检查后命中该监测点。 - - .. warning:: - 此类中的所有API均为实验版本,将来可能更改或者删除。 - - 参数: - - **abs_mean_lt** (float,可选) - 张量绝对值的均值阈值。当实际值小于该阈值时,则满足该检查条件。默认值:``None``。 - - **max_lt** (float,可选) - 张量最大值的阈值。当实际值小于该阈值时,则满足该检查条件。默认值:``None``。 - - **min_lt** (float,可选) - 张量最小值的阈值。当实际值小于该阈值时,则满足该检查条件。默认值:``None``。 - - **mean_lt** (float,可选) - 张量均值的阈值。当实际值小于该阈值时,则满足该检查条件。默认值:``None``。 - - .. py:method:: param_names - :property: - - 返回参数名称的列表。 - - 返回: - list[str],参数名称。 - -.. py:class:: mindinsight.debugger.TensorRangeCondition(range_start_inclusive=None, range_end_inclusive=None, range_percentage_lt=None, range_percentage_gt=None, max_min_lt=None, max_min_gt=None) - - 检查张量值范围的监测条件。 - - 设置阈值以检查张量值范围。有四个选项: `range_percentage_lt` 、 `range_percentage_gt` 、 `max_min_lt和max_min_gt` 。至少应指定四个选项之一。如果阈值设置为前两个选项之一,则必须设置 `range_start_inclusive` 和 `range_end_inclusive` 。当指定多个参数时,只要有一个参数满足检查条件,就会在检查后命中该监测点。 - - .. warning:: - 此类中的所有API均为实验版本,将来可能更改或者删除。 - - 参数: - - **range_start_inclusive** (float,可选) - 指定区间范围的开始。默认值:``None``。 - - **range_end_inclusive** (float,可选) - 指定区间范围的结束。默认值:``None``。 - - **range_percentage_lt** (float,可选) - `[range_start_inclusive, range_end_inclusive]` 范围内张量百分比的阈值。当指定范围内张量的百分比小于该值时,将满足检查条件。默认值:``None``。 - - **range_percentage_gt** (float,可选) - `[range_start_inclusive, range_end_inclusive]` 范围内张量百分比的阈值。当指定范围内张量的百分比大于该值时,将满足检查条件。默认值:``None``。 - - **max_min_lt** (float,可选) - 张量的最大值和最小值之差的下限阈值。默认值:``None``。 - - **max_min_gt** (float,可选) - 张量的最大值和最小值之差的上限阈值。默认值:``None``。 - - .. py:method:: param_names - :property: - - 返回参数名称的列表。 - - 返回: - list[str],参数名称。 - -.. py:class:: mindinsight.debugger.TensorOverflowCondition - - 检查张量溢出的监测条件。 - - 张量溢出的监测条件检查 `Inf` 和 `NaN` 张量。 - - .. warning:: - 此类中的所有API均为实验版本,将来可能更改或者删除。 - - .. py:method:: param_dict - :property: - - 获取参数列表。 - - 返回: - dict,检查条件的参数。 - - .. py:method:: param_names - :property: - - 返回参数的名称列表。 - - 返回: - list[str],参数名称列表。 - -.. py:class:: mindinsight.debugger.OperatorOverflowCondition - - 检查算子溢出的监测条件。 - - 算子溢出监测点检查算子计算过程中是否发生溢出。仅支持昇腾AI处理器。 - - .. warning:: - 此类中的所有API均为实验版本,将来可能更改或者删除。 - - .. py:method:: param_dict - :property: - - 获取参数列表。 - - 返回: - dict,检查条件的参数。 - - .. py:method:: param_names - :property: - - 返回参数的名称列表。 - - 返回: - list[str],参数名称列表。 - -.. py:class:: mindinsight.debugger.TensorAllZeroCondition(zero_percentage_ge) - - 检查张量值全为零的监测条件。 - - .. warning:: - 此类中的所有API均为实验版本,将来可能更改或者删除。 - - 参数: - - **zero_percentage_ge** (float) - 检查零张量值的百分比是否大于此值的阈值。 - - .. py:method:: param_names - :property: - - 返回参数名称列表。 - - 返回: - list[str],参数名称列表。 - -.. py:class:: mindinsight.debugger.TensorUnchangedCondition(rtol=1e-5, atol=1e-8) - - 检查张量值不变的监测条件。 - - 检查先前和当前张量的allclose函数。只有当张量中的每个元素都满足公式 :math:`|element\_in\_current\_tensor - element\_in\_previous\_tensor| - \leq atol + rtol\times |previous\_tensor|` 时,监测点才会被命中。 - - .. warning:: - 此类中的所有API均为实验版本,将来可能更改或者删除。 - - 参数: - - **rtol** (float,可选) - 相对容差参数。默认值:``1e-5``。 - - **atol** (float,可选) - 绝对容差参数。默认值:``1e-8``。 - - .. py:method:: param_names - :property: - - 返回参数名称列表。 - - 返回: - list[str],参数名称列表。 - -.. py:class:: mindinsight.debugger.TensorChangeBelowThresholdCondition(abs_mean_update_ratio_lt, epsilon=1e-9) - - 检查张量值变化率低于给定阈值的监测条件。 - - 当张量变化满足公式 :math:`\frac {abs\_mean(current\_tensor - previous\_tensor)} {abs\_mean(previous\_tensor)} + epsilon < mean\_update\_ratio\_lt` 时,监测点被命中。 - - .. warning:: - 此类中的所有API均为实验版本,将来可能更改或者删除。 - - 参数: - - **abs_mean_update_ratio_lt** (float) - 平均变化比例的阈值。如果平均更新率小于该值,则将触发监测点。 - - **epsilon** (float,可选) - `Epsilon` 值。默认值:``1e-9``。 - - .. py:method:: param_names - :property: - - 返回参数名称列表。 - - 返回: - list[str],参数名称列表。 - -.. py:class:: mindinsight.debugger.TensorChangeAboveThresholdCondition(abs_mean_update_ratio_gt, epsilon=1e-9) - - 检查张量值变化率超过给定阈值的监测条件。 - - 当张量变化满足公式 :math:`\frac {abs\_mean(current\_tensor - - previous\_tensor)} {abs\_mean(previous\_tensor)} + epsilon > mean\_update\_ratio\_lt` 时,监测点被命中。 - - .. warning:: - 此类中的所有API均为实验版本,将来可能更改或者删除。 - - 参数: - - **abs_mean_update_ratio_gt** (float) - 平均变化率的阈值,如果平均变化率大于此值,则将触发监测点。 - - **epsilon** (float,可选) - `Epsilon` 值。默认值:``1e-9``。 - - .. py:method:: param_names - :property: - - 返回参数名称列表。 - - 返回: - list[str],参数名称列表。 - -.. py:class:: mindinsight.debugger.ConditionBase - - 检查条件的基类。 - - .. warning:: - 此类中的所有API均为实验版本,将来可能更改或者删除。 - - .. note:: - 如果为一个条件实例指定了多个检查参数,只要有一个参数满足检查条件,就会在检查后命中该监测点。 - - .. py:method:: condition_id - :property: - - 获取检查条件id的名称。 - - 返回: - int, 检查条件的id。 - - .. py:method:: name - :property: - - 获取检查条件的名称。 - - 返回: - str, 检查条件的名称。 - - .. py:method:: param_dict - :property: - - 获取检查条件的参数。 - - 返回: - dict, 检查条件的参数。 - - - diff --git a/mindinsight/common/hook/debugger.py b/mindinsight/common/hook/debugger.py deleted file mode 100644 index abb3d078..00000000 --- a/mindinsight/common/hook/debugger.py +++ /dev/null @@ -1,194 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Debugger hook.""" - -import argparse - -from mindinsight.conf import settings -from mindinsight.utils.hook import BaseHook - - -def enable_debugger_string(string): - """Convert str to bool""" - if string.lower() in ('false', '0'): - return False - if string.lower() in ('true', '1'): - return True - raise ValueError - - -class EnableDebuggerAction(argparse.Action): - """Enable debugger action class definition.""" - - def __call__(self, parser, namespace, values, option_string=None): - """ - Inherited __call__ method from argparse.Action. - - Args: - parser (ArgumentParser): Passed-in argument parser. - namespace (Namespace): Namespace object to hold arguments. - values (object): Argument values with type depending on argument definition. - option_string (str): Optional string for specific argument name. Default: None. - """ - enable_debugger = values - setattr(namespace, self.dest, enable_debugger) - - -class PortAction(argparse.Action): - """Port action class definition.""" - - MIN_PORT = 1 - MAX_PORT = 65535 - - OPEN_PORT_LIMIT = 1024 - - def __call__(self, parser, namespace, values, option_string=None): - """ - Inherited __call__ method from argparse.Action. - - Args: - parser (ArgumentParser): Passed-in argument parser. - namespace (Namespace): Namespace object to hold arguments. - values (object): Argument values with type depending on argument definition. - option_string (str): Optional string for specific argument name. Default: None. - """ - port = values - if not self.MIN_PORT <= port <= self.MAX_PORT: - parser.error(f'{option_string} should be chosen from {self.MIN_PORT} to {self.MAX_PORT}') - - setattr(namespace, self.dest, port) - - -class SessionNumAction(argparse.Action): - """Session number action class definition.""" - - MIN_NUM = 1 - MAX_NUM = 2 - - def __call__(self, parser, namespace, values, option_string=None): - """ - Inherited __call__ method from argparse.Action. - - Args: - parser (ArgumentParser): Passed-in argument parser. - namespace (Namespace): Namespace object to hold arguments. - values (object): Argument values with type depending on argument definition. - option_string (str): Optional string for specific argument name. Default: None. - """ - sesson_num = values - if not self.MIN_NUM <= sesson_num <= self.MAX_NUM: - parser.error(f'{option_string} should be chosen from {self.MIN_NUM} to {self.MAX_NUM}') - - setattr(namespace, self.dest, sesson_num) - - -class MemLimitAction(argparse.Action): - """Memory limit action class definition.""" - - # The unit is MB - MIN_VALUE = 6 * 1024 - # The limit for int32. - MAX_VALUE = 2147483647 - - def __call__(self, parser, namespace, values, option_string=None): - """ - Inherited __call__ method from argparse.Action. - - Args: - parser (ArgumentParser): Passed-in argument parser. - namespace (Namespace): Namespace object to hold arguments. - values (object): Argument values with type depending on argument definition. - option_string (str): Optional string for specific argument name. Default: None. - """ - mem_limit = values - if not self.MIN_VALUE <= mem_limit <= self.MAX_VALUE: - parser.error(f'{option_string} should be chosen from {self.MIN_VALUE} to {self.MAX_VALUE}') - - setattr(namespace, self.dest, mem_limit) - - -class MaxGraphNodeSizeAction(argparse.Action): - """Graph Node limit action class definition.""" - MIN_VALUE = 1 - # The limit for 2000000. - MAX_VALUE = 2000000 - - def __call__(self, parser, namespace, values, option_string=None): - """ - Inherited __call__ method from argparse.Action. - - Args: - parser (ArgumentParser): Passed-in argument parser. - namespace (Namespace): Namespace object to hold arguments. - values (object): Argument values with type depending on argument definition. - option_string (str): Optional string for specific argument name. Default: None. - """ - max_graph_node_size = values - if not self.MIN_VALUE <= max_graph_node_size <= self.MAX_VALUE: - parser.error(f'{option_string} should be chosen from {self.MIN_VALUE} to {self.MAX_VALUE}, default is ' - f'{settings.MAX_GRAPH_NODE_SIZE}') - setattr(namespace, self.dest, max_graph_node_size) - - -class Hook(BaseHook): - """Hook class definition.""" - - def register_startup_arguments(self, parser): - """ - Hook function to register startup arguments. - - Args: - parser (ArgumentParser): Specify parser to which arguments are added. - """ - parser.add_argument( - '--enable-debugger', - type=enable_debugger_string, - action=EnableDebuggerAction, - default=False, - help=""" - Enable debugger or not. The value can be True/False/1/0 (case insensitive). - Default is False.""") - - parser.add_argument( - '--debugger-port', - type=int, - action=PortAction, - help=""" - Debugger port ranging from %s to %s. Default value is %s. - """ % (PortAction.MIN_PORT, PortAction.MAX_PORT, settings.DEBUGGER_PORT)) - - parser.add_argument( - '--offline-debugger-mem-limit', - type=int, - action=MemLimitAction, - help=""" - Offline debugger memory limit ranging from %s to %s MB. Default value is %s MB. - """ % (MemLimitAction.MIN_VALUE, MemLimitAction.MAX_VALUE, settings.OFFLINE_DEBUGGER_MEM_LIMIT)) - - parser.add_argument( - '--max-offline-debugger-session-num', - type=int, - action=SessionNumAction, - help=""" - Max offline debugger session number ranging from %s to %s. Default value is %s. - """ % (SessionNumAction.MIN_NUM, SessionNumAction.MAX_NUM, settings.MAX_OFFLINE_DEBUGGER_SESSION_NUM)) - - parser.add_argument( - '--max-graph-node-size', - type=int, - action=MaxGraphNodeSizeAction, - help=""" - Offline debugger graph node limit ranging from %s to %s MB. Default value is %s. - """ % (MaxGraphNodeSizeAction.MIN_VALUE, MaxGraphNodeSizeAction.MAX_VALUE, settings.MAX_GRAPH_NODE_SIZE)) diff --git a/mindinsight/debugger/__init__.py b/mindinsight/debugger/__init__.py index ec4c51a8..47c025f1 100644 --- a/mindinsight/debugger/__init__.py +++ b/mindinsight/debugger/__init__.py @@ -26,26 +26,3 @@ Debugger API is a python API interface provided for offline debugger. You need t For the method of saving dump data, `refer to Using Dump in the Graph Mode `_ . """ - -from mindinsight.debugger.api.conditions import \ - Watchpoint, WatchpointHit, TensorTooLargeCondition, TensorUnchangedCondition, TensorAllZeroCondition, \ - TensorOverflowCondition, OperatorOverflowCondition, TensorRangeCondition, TensorTooSmallCondition, \ - TensorChangeBelowThresholdCondition, TensorChangeAboveThresholdCondition, ConditionBase -from mindinsight.debugger.api.debugger_tensor import DebuggerTensor -from mindinsight.debugger.api.dump_analyzer import DumpAnalyzer -from mindinsight.debugger.api.node import Node - - -__all__ = ["DumpAnalyzer", "Node", "DebuggerTensor", "Watchpoint", - "WatchpointHit", - "TensorTooLargeCondition", - "TensorTooSmallCondition", - "TensorRangeCondition", - "TensorOverflowCondition", - "OperatorOverflowCondition", - "TensorAllZeroCondition", - "TensorUnchangedCondition", - "TensorChangeBelowThresholdCondition", - "TensorChangeAboveThresholdCondition", - "ConditionBase" - ] diff --git a/mindinsight/debugger/api/__init__.py b/mindinsight/debugger/api/__init__.py deleted file mode 100644 index 5538e18c..00000000 --- a/mindinsight/debugger/api/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""The definition of debugger python API.""" diff --git a/mindinsight/debugger/api/conditions.py b/mindinsight/debugger/api/conditions.py deleted file mode 100644 index 573ed096..00000000 --- a/mindinsight/debugger/api/conditions.py +++ /dev/null @@ -1,1179 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""Watchpoints.""" -from abc import ABC -from enum import Enum - -from mindinsight.debugger.api.debugger_tensor import DebuggerTensor -from mindinsight.debugger.common.exceptions.exceptions import DebuggerParamValueError, \ - DebuggerParamTypeError -from mindinsight.debugger.common.utils import validate_type -from mindinsight.debugger.conditionmgr.condition import ParamNameEnum - - -class ConditionBase(ABC): - """ - Base class for watch conditions. - - .. warning:: - All APIs in this class are experimental prototypes that are subject to - change or deletion. - - Note: - - If multiple checking parameters are specified for one condition instance, - a `WatchpointHit` happens for the parameters that the tensor triggered for the watchpoint. - - Supported Platforms: - ``Ascend`` ``GPU`` - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> from mindinsight.debugger import (TensorTooLargeCondition, - ... Watchpoint) - >>> - >>> def test_condition_base(): - ... my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - ... tensors = my_run.select_tensors(query_string="Conv2D-op13") - ... watchpoint = Watchpoint(tensors=tensors, - ... condition=TensorTooLargeCondition(abs_mean_gt=0.0, max_gt=0.0)) - ... hit = list(my_run.check_watchpoints(watchpoints=[watchpoint]))[0] - ... # print(hit.get_hit_detail()) - ... # the print result is as follows - ... # The setting for watchpoint is abs_mean_gt = 0.0, max_gt = 0.0. - ... # The actual value of the tensor is abs_mean_gt = 0.06592023578438996, max_gt = 0.449951171875. - ... watchpoint = Watchpoint(tensors=tensors, - ... condition=TensorTooLargeCondition(abs_mean_gt=0.0, max_gt=1.0)) - ... # the check_watchpoints function start a new process needs to be called through the main entry - ... hit = list(my_run.check_watchpoints(watchpoints=[watchpoint]))[0] - ... # print(hit.get_hit_detail()) - ... # the print result is as follows - ... # The setting for watchpoint is abs_mean_gt = 0.0. - ... # The actual value of the tensor is abs_mean_gt = 0.06592023578438996. - ... - >>> if __name__ == "__main__": - ... test_condition_base() - ... - """ - - @property - def name(self): - """ - Get the id for watch condition. - - Returns: - str, the name of the watch condition. - """ - raise NotImplementedError - - @property - def condition_id(self): - """ - Get the name for the watch condition Id. - - Returns: - int, the id of the watch condition. - """ - raise NotImplementedError - - @property - def param_dict(self): - """ - Get the parameters list. - - Returns: - dict, the parameter dict of the watch condition. - """ - return {} - - def __str__(self): - return str(self.param_dict) - - -class WatchpointHit(ABC): - """ - Watchpoint hit. - - .. warning:: - All APIs in this class are experimental prototypes that are subject to - change or deletion. - - Note: - - This class is not meant to be instantiated by user. - - The instances of this class is immutable. - - Supported Platforms: - ``Ascend`` ``GPU`` - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> from mindinsight.debugger import TensorTooLargeCondition, Watchpoint - >>> - >>> def test_watch_point_hit(): - ... my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - ... tensor_list = my_run.select_tensors( - ... query_string="Conv", - ... use_regex=True, - ... iterations=[0], - ... ranks=[0], - ... slots=[0] - ... ) - ... watchpoint = Watchpoint(tensors=tensor_list, - ... condition=TensorTooLargeCondition(abs_mean_gt=0.0)) - ... # the check_watchpoints function start a new process needs to be called through the main entry - ... hits = my_run.check_watchpoints(watchpoints=[watchpoint]) - ... hit = list(hits)[0] - ... # print(str(hit)) - ... # the print result is as follows - ... # Watchpoint TensorTooLarge triggered on tensor: - ... # rank: 0 - ... # graph_name: kernel_graph_0 - ... # node_name: Default/network-WithLossCell/_backbone-AlexNet/conv1-Conv2d/Cast-op7 - ... # slot: 0 - ... # iteration: 0 - ... # Threshold: {'abs_mean_gt': 0.0} - ... # Hit detail: The setting for watchpoint is abs_mean_gt = 0.0. - ... # The actual value of the tensor is abs_mean_gt = 0.007956420533235841. - ... # print(hit.error_code) - ... # the print result is as follows - ... # 0 - ... # print(hit.tensor) - ... # the print result is as follows - ... # rank: 0 - ... # graph_name: kernel_graph_0 - ... # node_name: Default/network-WithLossCell/_backbone-AlexNet/conv1-Conv2d/Cast-op7 - ... # slot: 0 - ... # iteration: 0 - ... # print(hit.get_hit_detail()) - ... # the print result is as follows - ... # The setting for watchpoint is abs_mean_gt = 0.0. - ... # The actual value of the tensor is abs_mean_gt = 0.007956420533235841. - ... - >>> if __name__ == "__main__": - ... test_watch_point_hit() - ... - """ - - @property - def error_code(self): - """ - Get the error code when checking the watchpoint if there is error. - - Returns: - int, the error number. - """ - raise NotImplementedError - - @property - def error_msg(self): - """ - Get the error msg when checking the watchpoint if there is error. - - Returns: - list[str], the error message list. - """ - raise NotImplementedError - - @property - def tensor(self) -> DebuggerTensor: - """ - Get the tensor for this watchpoint hit. - - Returns: - DebuggerTensor, the triggered tensor. - """ - raise NotImplementedError - - def get_threshold(self): - """ - Get the condition set by user. - - Returns: - ConditionBase, the condition with user threshold. - """ - raise NotImplementedError - - def get_hit_detail(self): - """ - Get the corresponding watch condition,including the actual values. - For example, if the corresponding watch condition is `TensorTooLargeCondition(max_gt=None)` , - watching whether the max value of the tensor greater than 0, the `get_hit_detail` return - a `TensorTooLargeCondition` object including the max value of the tensor. - If error_code is not zero, None will be returned. - - Returns: - Union[ConditionBase, None], the condition with hit detail, If error_code is not zero, - None will be returned. - """ - raise NotImplementedError - - -class WatchpointHitImpl(WatchpointHit): - """ - Watchpoint hit. - - Args: - tensor (DebuggerTensor): The tensor which hits the watchpoint. - condition (ConditionBase): The ConditionBase object initialized with - user setting value. - hit_detail (ConditionBase): The ConditionBase object - initialized with actual value of the Tensor. - error_code (int): The code describing error. - """ - - def __init__(self, - tensor: DebuggerTensor, - condition: ConditionBase, - hit_detail: ConditionBase, - error_code): - self._tensor = tensor - self._condition = condition - self._error_code = error_code - self._hit_detail = hit_detail - - @property - def error_code(self): - """ - Get the error code when checking the watchpoint if there is error. - - Returns: - int, the error number. - """ - return self._error_code - - @property - def error_msg(self): - """ - Get the error msg when checking the watchpoint if there is error. - - Returns: - list[str], the error message list. - """ - error_code = self._error_code - all_error_list = [ - "Tensor contains NaN.", - "A tensor contains +/-INF.", - "The previous step value cannot be found.", - "The tensor size exceeds the memory limit.", - "Graph history file is not available.", - "Tensor has no value." - ] - error_list = [] - for i, error_str in enumerate(all_error_list): - error = (error_code >> i) & 1 - if error == 1: - error_list.append(error_str) - - return error_list - - @property - def tensor(self) -> DebuggerTensor: - """Get the tensor for this watchpoint hit.""" - return self._tensor - - def get_threshold(self): - """Get the threshold set by user.""" - return self._condition - - def get_hit_detail(self): - """ - Get the actual values for the thresholds in the watchpoint. - If error_code is not zero or None, None will be returned. - """ - if self._error_code: - return None - return self._hit_detail - - def __str__(self): - if self._error_code: - msg = f"Watchpoint {self._condition.name} check failed on tensor:\n" \ - f"{str(self.tensor)}" \ - f"Threshold: {self.get_threshold()}\n" \ - f"Error detail: {self.error_msg}" - return msg - msg = f"Watchpoint {self._condition.name} triggered on tensor:\n" \ - f"{str(self.tensor)}" \ - f"Threshold: {self.get_threshold()}\n" \ - f"Hit detail: {str(self._hit_detail)}" - return msg - - -class HitDetail(ConditionBase): - """Hit Detail.""" - - def __init__(self, param_list, condition): - self._param_list = param_list - self._condition = condition - - @property - def name(self): - """Get the name for the condition.""" - return self._condition.name - - @property - def condition_id(self): - """Get the name for the condition Id.""" - return self._condition.condition_id - - @property - def param_dict(self): - """Get the parameters list.""" - return self._param_list - - def __str__(self): - show_actual_value = bool(self._condition.param_dict) - if self._condition.condition_id == WatchpointConditionId.UNCHANGED_TENSOR.value: - show_actual_value = False - # list of the parameters with disabled = False and hit = 1 - hit_param_list = [] - for param in self._param_list: - if not param.disabled and param.hit: - hit_param_list.append(param) - - result = "" - param_size = len(hit_param_list) - if show_actual_value and hit_param_list: - setting_detail = "The setting for watchpoint is " - value_detail = " The actual value of the tensor is " - for idx, param in enumerate(hit_param_list): - setting_detail += f"{param.name} = {param.value}" - value_detail += f"{param.name} = {param.actual_value}" - if idx == param_size - 1: - setting_detail += "." - value_detail += "." - else: - setting_detail += ", " - value_detail += ", " - result = setting_detail + value_detail - - if not result: - result = "None." - return result - - -class TensorTooLargeCondition(ConditionBase): - """ - Watch contion for tensor value too large. At least one parameter should be specified. - - If multiple checking parameters are specified, a `WatchpointHit` happens for the parameters - that the tensor triggered for the watchpoint. - - .. warning:: - All APIs in this class are experimental prototypes that are subject to - change or deletion. - - Args: - abs_mean_gt (float, optional): The threshold for mean of the absolute - value of the tensor. When the actual value was greater than this - threshold, this checking condition would be satisfied. Default: ``None``. - max_gt (float, optional): The threshold for maximum of the tensor. When - the actual value was greater than this threshold, this checking - condition would be satisfied. Default: ``None``. - min_gt (float, optional): The threshold for minimum of the tensor. When - the actual value was greater than this threshold, this checking - condition would be satisfied. Default: ``None``. - mean_gt (float, optional): The threshold for mean of the tensor. When - the actual value was greater than this threshold, this checking - condition would be satisfied. Default: ``None``. - - Examples: - >>> from mindinsight.debugger import TensorTooLargeCondition - >>> my_condition = TensorTooLargeCondition(abs_mean_gt=0.0) - >>> print(my_condition.name) - TensorTooLarge - """ - - def __init__(self, - abs_mean_gt=None, max_gt=None, min_gt=None, mean_gt=None): - self._abs_mean_gt = abs_mean_gt - self._max_gt = max_gt - self._min_gt = min_gt - self._mean_gt = mean_gt - self._param_dict = self._get_param_dict() - - @property - def name(self): - return "TensorTooLarge" - - @property - def condition_id(self): - return WatchpointConditionId.TENSOR_TOO_LARGE.value - - @property - def param_dict(self): - return self._param_dict - - def _get_param_dict(self): - """Get normalized param dict.""" - param_dict = {} - if self._abs_mean_gt is not None: - validate_type(self._abs_mean_gt, 'abs_mean_gt', [int, float], 'float') - param_dict[ParamNameEnum.ABS_MEAN_GT.value] = float(self._abs_mean_gt) - if self._max_gt is not None: - validate_type(self._max_gt, 'max_gt', [int, float], 'float') - param_dict[ParamNameEnum.MAX_GT.value] = float(self._max_gt) - if self._min_gt is not None: - validate_type(self._min_gt, 'min_gt', [int, float], 'float') - param_dict[ParamNameEnum.MIN_GT.value] = float(self._min_gt) - if self._mean_gt is not None: - validate_type(self._mean_gt, 'mean_gt', [int, float], 'float') - param_dict[ParamNameEnum.MEAN_GT.value] = float(self._mean_gt) - if not param_dict: - msg = "Please specify at least one of the parameters for TensorTooLargeCondition." - raise DebuggerParamValueError(msg) - return param_dict - - @property - def param_names(self): - """ - Return the list of parameter names. - - Returns: - list[str], the parameter names. - """ - names = [ - ParamNameEnum.ABS_MEAN_GT.value, - ParamNameEnum.MAX_GT.value, - ParamNameEnum.MIN_GT.value, - ParamNameEnum.MEAN_GT.value - ] - return names - - -class TensorTooSmallCondition(ConditionBase): - """ - Watch contion for tensor value too small. At least one parameter should be specified. - - If multiple checking parameters are specified, a `WatchpointHit` happens for the parameters - that the tensor triggered for the watchpoint. - - .. warning:: - All APIs in this class are experimental prototypes that are subject to - change or deletion. - - Args: - abs_mean_lt (float, optional): The threshold for mean of the absolute - value of the tensor. When the actual value was less than this - threshold, this checking condition would be satisfied. Default: ``None``. - max_lt (float, optional): The threshold for maximum of the tensor. When - the actual value was less than this threshold, this checking - condition would be satisfied. Default: ``None``. - min_lt (float, optional): The threshold for minimum of the tensor. When - the actual value was less than this threshold, this checking - condition would be satisfied. Default: ``None``. - mean_lt (float, optional): The threshold for mean of the tensor. When - the actual value was less than this threshold, this checking - condition would be satisfied. Default: ``None``. - - Examples: - >>> from mindinsight.debugger import TensorTooSmallCondition - >>> my_condition = TensorTooSmallCondition(abs_mean_lt=0.2) - >>> print(my_condition.name) - TensorTooSmall - """ - - def __init__(self, - abs_mean_lt=None, max_lt=None, min_lt=None, mean_lt=None): - self._abs_mean_lt = abs_mean_lt - self._max_lt = max_lt - self._min_lt = min_lt - self._mean_lt = mean_lt - self._param_dict = self._get_param_dict() - - @property - def name(self): - return "TensorTooSmall" - - @property - def condition_id(self): - return WatchpointConditionId.TENSOR_TOO_SMALL.value - - @property - def param_dict(self): - return self._param_dict - - def _get_param_dict(self): - """Get normalized param dict.""" - param_dict = {} - if self._abs_mean_lt is not None: - validate_type(self._abs_mean_lt, 'abs_mean_lt', [int, float], 'float') - param_dict[ParamNameEnum.ABS_MEAN_LT.value] = float(self._abs_mean_lt) - if self._max_lt is not None: - validate_type(self._max_lt, 'max_lt', [int, float], 'float') - param_dict[ParamNameEnum.MAX_LT.value] = float(self._max_lt) - if self._min_lt is not None: - validate_type(self._min_lt, 'min_lt', [int, float], 'float') - param_dict[ParamNameEnum.MIN_LT.value] = float(self._min_lt) - if self._mean_lt is not None: - validate_type(self._mean_lt, 'mean_lt', [int, float], 'float') - param_dict[ParamNameEnum.MEAN_LT.value] = float(self._mean_lt) - if not param_dict: - msg = "Please specify at least one of the parameters for TensorTooSmallCondition." - raise DebuggerParamValueError(msg) - return param_dict - - @property - def param_names(self): - """ - Return the list of parameter names. - - Returns: - list[str], the parameter names. - """ - names = [ - ParamNameEnum.ABS_MEAN_LT.value, - ParamNameEnum.MAX_LT.value, - ParamNameEnum.MIN_LT.value, - ParamNameEnum.MEAN_LT.value - ] - return names - - -class TensorRangeCondition(ConditionBase): - """ - Watch condition for tensor value range. - - Set a threshold to check the tensor value range. There are four options: - `range_percentage_lt` , `range_percentage_gt` , `max_min_lt` and `max_min_gt` . - At least one of the four options should be specified. - If the threshold is set to one of the first two options, - both `range_start_inclusive` and `range_end_inclusive` must be set. - If multiple checking parameters are specified, a `WatchpointHit` happens for the parameters - that the tensor triggered for the watchpoint. - - .. warning:: - All APIs in this class are experimental prototypes that are subject to - change or deletion. - - Args: - range_start_inclusive (float, optional): The start of the specified range. Default: ``None``. - range_end_inclusive (float, optional): The end of the specified range. Default: ``None``. - range_percentage_lt (float, optional): The threshold for the percentage of the tensor - in the range `[range_start_inclusive, range_end_inclusive]` . The checking condition - will be satisfied when the percentage of the tensor in the specified range is less than this value. - Default: ``None``. - range_percentage_gt (float, optional): The threshold for the percentage of the tensor - in the range `[range_start_inclusive, range_end_inclusive]` . The checking condition - will be satisfied when the percentage of the tensor in the specified range is greater than this value. - Default: ``None``. - max_min_lt (float, optional): Lowwer threshold for the difference - between the maximum and minimum values of a tensor. Default: ``None``. - max_min_gt (float, optional): Upper threshold for the difference - between the maximum and minimum values of a tensor. Default: ``None``. - - Examples: - >>> from mindinsight.debugger import TensorRangeCondition - >>> my_condition = TensorRangeCondition(max_min_gt=0.05) - >>> print(my_condition.name) - TensorRange - """ - - def __init__(self, - range_start_inclusive=None, range_end_inclusive=None, range_percentage_lt=None, - range_percentage_gt=None, max_min_lt=None, max_min_gt=None): - self._range_start_inclusive = range_start_inclusive - self._range_end_inclusive = range_end_inclusive - self._range_percentage_lt = range_percentage_lt - self._range_percentage_gt = range_percentage_gt - self._max_min_lt = max_min_lt - self._max_min_gt = max_min_gt - self._param_dict = self._get_param_dict() - - @property - def name(self): - return "TensorRange" - - @property - def condition_id(self): - return WatchpointConditionId.TENSOR_RANGE.value - - @property - def param_dict(self): - return self._param_dict - - def _get_param_dict(self): - """Get normalized param dict.""" - param_dict = {} - if self._range_start_inclusive is not None: - validate_type(self._range_start_inclusive, 'range_start_inclusive', [int, float], 'float') - param_dict[ParamNameEnum.RANGE_START_INCLUSIVE.value] = float(self._range_start_inclusive) - if self._range_end_inclusive is not None: - validate_type(self._range_end_inclusive, 'range_end_inclusive', [int, float], 'float') - param_dict[ParamNameEnum.RANGE_END_INCLUSIVE.value] = float(self._range_end_inclusive) - if self._range_percentage_lt is not None: - validate_type(self._range_percentage_lt, 'range_percentage_lt', [int, float], 'float') - param_dict[ParamNameEnum.RANGE_PERCENTAGE_LT.value] = float(self._range_percentage_lt) - if self._range_percentage_gt is not None: - validate_type(self._range_percentage_gt, 'range_range_percentage_gt', [int, float], 'float') - param_dict[ParamNameEnum.RANGE_PERCENTAGE_GT.value] = float(self._range_percentage_gt) - if self._max_min_lt is not None: - validate_type(self._max_min_lt, 'max_min_lt', [int, float], 'float') - param_dict[ParamNameEnum.MAX_MIN_LT.value] = float(self._max_min_lt) - if self._max_min_gt is not None: - validate_type(self._max_min_gt, 'max_min_gt', [int, float], 'float') - param_dict[ParamNameEnum.MAX_MIN_GT.value] = float(self._max_min_gt) - if not self._has_threshold_param(param_dict): - msg = "Please specify at least one of the parameters " \ - "[range_percentage_lt, range_percentage_gt, max_min_lt, max_min_gt] " \ - "for TensorRangeCondition." - raise DebuggerParamValueError(msg) - # check supported parameter - if (ParamNameEnum.RANGE_PERCENTAGE_LT.value in param_dict.keys() or - ParamNameEnum.RANGE_PERCENTAGE_GT.value in param_dict.keys()): - if (ParamNameEnum.RANGE_START_INCLUSIVE.value not in param_dict.keys() or - ParamNameEnum.RANGE_END_INCLUSIVE.value not in param_dict.keys()): - msg = ("Please specify both range_start_inclusive and " - "range_end_inclusive parameters for TensorRangeCondition.") - raise DebuggerParamValueError(msg) - return param_dict - - @staticmethod - def _has_threshold_param(param_dict): - """Check if threshold parameter is set.""" - threshold_param_name = [ - ParamNameEnum.RANGE_PERCENTAGE_LT.value, - ParamNameEnum.RANGE_PERCENTAGE_GT.value, - ParamNameEnum.MAX_MIN_LT.value, - ParamNameEnum.MAX_MIN_GT.value - ] - for param_name in threshold_param_name: - if param_name in param_dict: - return True - return False - - @property - def param_names(self): - """ - Return the list of parameter names. - - Returns: - list[str], the parameter names. - """ - names = [ - ParamNameEnum.RANGE_START_INCLUSIVE.value, - ParamNameEnum.RANGE_END_INCLUSIVE.value, - ParamNameEnum.RANGE_PERCENTAGE_LT.value, - ParamNameEnum.RANGE_PERCENTAGE_GT.value, - ParamNameEnum.MAX_MIN_LT.value, - ParamNameEnum.MAX_MIN_GT.value - ] - return names - - -class TensorOverflowCondition(ConditionBase): - """ - Watch condition for tensor overflow. - - Tensor overflow whatchpoint checks for `inf` and `nan` tensors. - - .. warning:: - All APIs in this class are experimental prototypes that are subject to - change or deletion. - - Examples: - >>> from mindinsight.debugger import TensorOverflowCondition - >>> my_condition = TensorOverflowCondition() - >>> print(my_condition.name) - TensorOverflow - """ - - def __init__(self): - pass - - @property - def name(self): - return "TensorOverflow" - - @property - def condition_id(self): - return WatchpointConditionId.TENSOR_OVERFLOW.value - - @property - def param_names(self): - """ - Return the list of parameter names. - - Returns: - list[str], the parameter names. - """ - return [] - - -class OperatorOverflowCondition(ConditionBase): - """ - Operator overflow watch condition. - - Operator overflow whatchpoint checks whether overflow occurs during operator computation. - Only Ascend AI processor is supported. - - .. warning:: - All APIs in this class are experimental prototypes that are subject to - change or deletion. - - Examples: - >>> from mindinsight.debugger import OperatorOverflowCondition - >>> my_condition = OperatorOverflowCondition() - >>> print(my_condition.name) - OperatorOverflow - """ - - def __init__(self): - pass - - @property - def name(self): - return "OperatorOverflow" - - @property - def condition_id(self): - return WatchpointConditionId.OPERATOR_OVERFLOW.value - - @property - def param_names(self): - """ - Return the list of parameter names. - - Returns: - list[str], the parameter names. - """ - return [] - - -class TensorAllZeroCondition(ConditionBase): - """ - Watch condition for tensor value is all zero . - - .. warning:: - All APIs in this class are experimental prototypes that are subject to - change or deletion. - - Args: - zero_percentage_ge (float): The threshold to check if the percentage of - zero tensor values are greater than this value. - - Examples: - >>> from mindinsight.debugger import TensorAllZeroCondition - >>> my_condition = TensorAllZeroCondition(zero_percentage_ge=0.0) - >>> print(my_condition.name) - TensorAllZero - """ - - def __init__(self, zero_percentage_ge): - validate_type(zero_percentage_ge, 'zero_percentage_ge', [int, float], 'float') - self._zero_percentage_ge = float(zero_percentage_ge) - - @property - def name(self): - return "TensorAllZero" - - @property - def condition_id(self): - return WatchpointConditionId.TENSOR_ALL_ZERO.value - - @property - def param_dict(self): - param_dict = {ParamNameEnum.ZERO_PERCENTAGE_GE.value: self._zero_percentage_ge} - return param_dict - - @property - def param_names(self): - """ - Return the list of parameter names. - - Returns: - list[str], the parameter names. - """ - return [ParamNameEnum.ZERO_PERCENTAGE_GE.value] - - -class TensorUnchangedCondition(ConditionBase): - r""" - Watch condition for tensor value unchanged. - - Check allclose function on previous and current tensor. Only when every element in tensor - satisfies the equation :math:`|element\_in\_current\_tensor - element\_in\_previous\_tensor| - \leq atol + rtol\times |previous\_tensor|` , this watchpoint will be hit. - - .. warning:: - All APIs in this class are experimental prototypes that are subject to - change or deletion. - - Args: - rtol (float, optional): The relative tolerance parameter. Default: ``1e-5``. - atol (float, optional): The absolute tolerance parameter. Default: ``1e-8``. - - Examples: - >>> from mindinsight.debugger import TensorUnchangedCondition - >>> my_condition = TensorUnchangedCondition(rtol=1000.0) - >>> print(my_condition.name) - TensorUnchanged - """ - - def __init__(self, rtol=1e-5, atol=1e-8): - validate_type(rtol, 'rtol', [float, int], 'float or int') - validate_type(atol, 'atol', [float, int], 'float or int') - self._rtol = float(rtol) - self._atol = float(atol) - - @property - def name(self): - return "TensorUnchanged" - - @property - def condition_id(self): - return WatchpointConditionId.UNCHANGED_TENSOR.value - - @property - def param_dict(self): - param_dict = { - ParamNameEnum.RTOL.value: self._rtol, - ParamNameEnum.ATOL.value: self._atol} - return param_dict - - @property - def param_names(self): - """ - Return the list of parameter names. - - Returns: - list[str], the parameter names. - """ - names = [ - ParamNameEnum.RTOL.value, - ParamNameEnum.ATOL.value, - ParamNameEnum.EQUAL_NAN.value - ] - return names - - -class TensorChangeBelowThresholdCondition(ConditionBase): - r""" - Watch condition for tensor changing below threshold. - - When the tensor changing satisfies equation :math:`\frac {abs\_mean(current\_tensor - - previous\_tensor)} {abs\_mean(previous\_tensor)} + epsilon < mean\_update\_ratio\_lt` , - the watchpoint would be hit. - - .. warning:: - All APIs in this class are experimental prototypes that are subject to - change or deletion. - - Args: - abs_mean_update_ratio_lt (float): The threshold value for mean update ration. - If the mean update ratio is less that this value the watchpoint will be triggered. - epsilon (float, optional): Epsilon value. Default: ``1e-9``. - - Examples: - >>> from mindinsight.debugger import TensorChangeBelowThresholdCondition - >>> my_condition = TensorChangeBelowThresholdCondition(abs_mean_update_ratio_lt=2.0) - >>> print(my_condition.name) - TensorChangeBelowThreshold - """ - - def __init__(self, abs_mean_update_ratio_lt, epsilon=1e-9): - validate_type(abs_mean_update_ratio_lt, 'abs_mean_update_ratio_lt', [float, int], 'float') - validate_type(epsilon, 'epsilon', [float, int], 'float') - self._abs_mean_update_ratio_lt = float(abs_mean_update_ratio_lt) - self._epsilon = float(epsilon) - - @property - def name(self): - return "TensorChangeBelowThreshold" - - @property - def condition_id(self): - return WatchpointConditionId.TENSOR_CHANGE_TOO_SMALL.value - - @property - def param_dict(self): - param_dict = { - ParamNameEnum.ABS_MEAN_UPDATE_RATIO_LT.value: self._abs_mean_update_ratio_lt, - ParamNameEnum.EPSILON.value: self._epsilon - } - return param_dict - - @property - def param_names(self): - """ - Return the list of parameter names. - - Returns: - list[str], the parameter names. - """ - names = [ - ParamNameEnum.ABS_MEAN_UPDATE_RATIO_LT.value, - ParamNameEnum.EPSILON.value - ] - return names - - -class TensorChangeAboveThresholdCondition(ConditionBase): - r""" - Watch condition for tensor changing above threshold. - - When the tensor changing satisfies equation :math:`\frac {abs\_mean(current\_tensor - - previous\_tensor)} {abs\_mean(previous\_tensor)} + epsilon > mean\_update\_ratio\_lt` , - the watchpoint would be hit. - - .. warning:: - All APIs in this class are experimental prototypes that are subject to - change or deletion. - - Args: - abs_mean_update_ratio_gt (float): The threshold value for mean update ratio, - if the mean update ratio is greater than this value the watchpoint will be triggered. - epsilon (float, optional): Epsilon value. Default: ``1e-9``. - - Examples: - >>> from mindinsight.debugger import TensorChangeAboveThresholdCondition - >>> my_condition = TensorChangeAboveThresholdCondition(abs_mean_update_ratio_gt=0.0) - >>> print(my_condition.name) - TensorChangeAboveThreshold - """ - - def __init__(self, abs_mean_update_ratio_gt, epsilon=1e-9): - validate_type(abs_mean_update_ratio_gt, 'abs_mean_update_ratio_gt', [float, int], 'float') - validate_type(epsilon, 'epsilon', [float, int], 'float') - self._abs_mean_update_ratio_gt = float(abs_mean_update_ratio_gt) - self._epsilon = float(epsilon) - - @property - def name(self): - return "TensorChangeAboveThreshold" - - @property - def condition_id(self): - return WatchpointConditionId.TENSOR_CHANGE_TOO_LARGE.value - - @property - def param_dict(self): - param_dict = { - ParamNameEnum.ABS_MEAN_UPDATE_RATIO_GT.value: self._abs_mean_update_ratio_gt, - ParamNameEnum.EPSILON.value: self._epsilon - } - return param_dict - - @property - def param_names(self): - """ - Return the list of parameter names. - - Returns: - list[str], the parameter names. - """ - names = [ - ParamNameEnum.ABS_MEAN_UPDATE_RATIO_GT.value, - ParamNameEnum.EPSILON.value - ] - return names - - -class Watchpoint: - """ - Watchpoint applies condition to specified tensors. - - .. warning:: - All APIs in this class are experimental prototypes that are subject to - change or delete. - - Args: - tensors (Iterable[DebuggerTensor]): The tensors to check. - condition (ConditionBase): The watch condition to apply to tensors. - - Supported Platforms: - ``Ascend`` ``GPU`` - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> from mindinsight.debugger import TensorTooLargeCondition, Watchpoint - >>> my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - >>> tensor_list = my_run.select_tensors( - ... query_string="Conv", - ... use_regex=True, - ... iterations=[0], - ... ranks=[0], - ... slots=[0] - ... ) - >>> watchpoint = Watchpoint(tensors=tensor_list, - ... condition=TensorTooLargeCondition(abs_mean_gt=0.0)) - >>> tensor = list(watchpoint.tensors)[0] - >>> print(tensor.node.name) - Default/network-WithLossCell/_backbone-AlexNet/conv1-Conv2d/Cast-op7 - >>> print(watchpoint.condition.name) - TensorTooLarge - """ - - def __init__(self, tensors, condition): - validate_tensor_list(tensors, 'tensors') - validate_type(condition, 'condition', ConditionBase, 'ConditionBase') - self._tensors = tensors - self._condition = condition - - @property - def tensors(self): - """ - Get tensors to check. - - Returns: - Iterable[DebuggerTensor], the tensors to check. - """ - return self._tensors - - @property - def condition(self): - """ - Get the watch condition to apply to tensors. - - Returns: - ConditionBase, the watch condition to apply to tensors. - """ - return self._condition - - -class WatchpointHandle: - """Watchpoint handle.""" - - def __init__(self, watchpoint_id, watchpoint): - validate_type(watchpoint, 'watchpoint', Watchpoint, 'Watchpoint') - self.watchpoint_id = watchpoint_id - self.condition = watchpoint.condition - self.sorted_tensors = self._organize_tensor(watchpoint.tensors) - self.tensors = watchpoint.tensors - - @staticmethod - def _get_value(default_map, key, default_value): - """Get key in default map.""" - value = default_map.get(key) - if value is None: - value = default_value - default_map[key] = value - return value - - def _organize_tensor(self, tensors): - """Sort out the tensor and remove the duplication.""" - sorted_tensor = {} - for tensor in tensors: - validate_type(tensor, 'tensors', DebuggerTensor, 'List[DebuggerTensor]') - node_map = self._get_value(sorted_tensor, tensor.iteration, {}) - slot_map = self._get_value(node_map, tensor.node.unique_id, { - 'node': tensor.node, - 'slot_map': {} - }).get('slot_map') - slot_map[tensor.slot] = tensor - return sorted_tensor - - def get_iterations(self): - """Get iterations to be check in this watchpoint.""" - return list(self.sorted_tensors.keys()) - - def need_check(self, tensor): - """Check if the tensor need to be checked.""" - slot_map = self.sorted_tensors.get(tensor.iteration, - {}).get(tensor.node.unique_id, {}).get('slot_map') - if slot_map.get(tensor.slot) is not None: - return True - return False - - def get_check_nodes(self, iteration): - """Get check nodes.""" - if iteration is None: - return {} - check_nodes = {} - for node_info in self.sorted_tensors.get(iteration, {}).values(): - node = node_info.get('node') - node_name = node.full_name_with_graph - check_node = self._get_value(check_nodes, node_name, { - "rank_id": [node.rank], - "is_output": True, - "root_graph_id": [node.root_graph_id] - }) - if node.rank not in check_node.get('rank_id'): - check_node["rank_id"].append(node.rank) - return check_nodes - - def add_watchpoint(self, iteration, debugger_engine): - """ - Add watchpoint for the selected iteration. - """ - check_nodes = self.get_check_nodes(iteration) - # check if watchpoint must be added for the current iteration - if check_nodes: - params = self._get_param_list(debugger_engine.dbg_services_module.Parameter) - debugger_engine.dbg_service.add_watchpoint( - watchpoint_id=self.watchpoint_id, - watch_condition=self.condition.condition_id, - check_node_list=check_nodes, - parameter_list=params - ) - - def _get_param_list(self, parameter_class): - """Get param list.""" - params = [] - set_params = self.condition.param_dict - for param_name in self.condition.param_names: - set_value = set_params.get(param_name) - if set_value is not None: - param = parameter_class(name=param_name, disabled=False, value=set_value) - else: - param = parameter_class(name=param_name, disabled=True, value=0.0) - params.append(param) - return params - - def watchpoint_hit_on_no_value(self, iteration): - """ - Returns list of WatchpointHit if tensors' npy files are missing, - when error_on_no_value =True - """ - no_value_hit_list = [] - node_map = self.sorted_tensors.get(iteration) - if not node_map: - return no_value_hit_list - for node_info in node_map.values(): - for tensor in node_info.get('slot_map', {}).values(): - if tensor.has_value() is False: - hit_params = [] - hit_detail = HitDetail(hit_params, self.condition) - # 32 means there is no value found - error_no_value_code = 32 - no_value_hit = WatchpointHitImpl(tensor=tensor, - condition=self.condition, - hit_detail=hit_detail, - error_code=error_no_value_code) - no_value_hit_list.append(no_value_hit) - return no_value_hit_list - - -class WatchpointConditionId(Enum): - """Watchpoint condition ID.""" - OPERATOR_OVERFLOW = 2 - TENSOR_OVERFLOW = 13 - INITIAL_WEIGHT = 14 - TENSOR_TOO_LARGE = 15 - TENSOR_TOO_SMALL = 16 - TENSOR_ALL_ZERO = 17 - TENSOR_CHANGE_TOO_LARGE = 18 - TENSOR_CHANGE_TOO_SMALL = 19 - UNCHANGED_TENSOR = 20 - TENSOR_RANGE = 21 - - -def validate_tensor_list(param, param_name): - """Validate list.""" - if not isinstance(param, list): - raise DebuggerParamTypeError(f"The type of {param_name} should be list of DebuggerTensor. " - f"But the actual type is {type(param)}") - for i, value in enumerate(param): - if not isinstance(value, DebuggerTensor): - raise DebuggerParamTypeError(f"The type of {param_name} should be list of DebuggerTensor. " - f"But the {i} value is {type(value)}.") diff --git a/mindinsight/debugger/api/debugger_engine.py b/mindinsight/debugger/api/debugger_engine.py deleted file mode 100644 index 51cdaa05..00000000 --- a/mindinsight/debugger/api/debugger_engine.py +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""DebuggerEngine.""" - -from mindinsight.debugger.debugger_services.debugger_offline_server import DebuggerOfflineManager - - -class DebuggerEngine: - """Debugger Engine object.""" - - def __init__(self, data_loader, mem_limit): - """Initialization.""" - self._data_loader = data_loader - DebuggerOfflineManager.check_toolkit(self._data_loader) - self._dbg_services_module = DebuggerOfflineManager.get_dbg_service_module() - self._dbg_service = DebuggerOfflineManager.get_dbg_service(self.dbg_services_module, - data_loader, - mem_limit) - - @property - def data_loader(self): - """DataLoader object.""" - return self._data_loader - - @property - def dbg_services_module(self): - """Get dbg_services module in MindSpore.""" - return self._dbg_services_module - - @property - def dbg_service(self): - """Get initialized DbgServices object.""" - return self._dbg_service diff --git a/mindinsight/debugger/api/debugger_tensor.py b/mindinsight/debugger/api/debugger_tensor.py deleted file mode 100644 index 94c0f8d6..00000000 --- a/mindinsight/debugger/api/debugger_tensor.py +++ /dev/null @@ -1,219 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""DebuggerTensor.""" -import re -from abc import ABC - -import numpy as np - -from mindinsight.debugger.common.log import LOGGER as log -from mindinsight.debugger.common.utils import NUMPY_TYPE_MAP -from mindinsight.debugger.stream_cache.data_loader import DumpTarget -from mindinsight.domain.graph.base import NodeType -from mindinsight.domain.graph.proto.ms_graph_pb2 import DataType - - -class DebuggerTensor(ABC): - """ - The tensor with specific rank, iteration and debugging info. - - .. warning:: - All APIs in this class are experimental prototypes that are subject to - change or deletion. - - Args: - node (Node): The node that outputs this tensor. - slot (int): The slot of the tensor on the node. - iteration (int): The iteration of the tensor. - - Note: - - Users should not instantiate this class manually. - - The instances of this class is immutable. - - A `DebuggerTensor` is always the output tensor of a node. - """ - - def __init__(self, node, slot, iteration): - self._node = node - self._slot = slot - self._iteration = iteration - - @property - def node(self): - """ - Get the node that outputs this tensor. - - Returns: - Node, the node that outputs this tensor. - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - >>> tensors = list(my_run.select_tensors("conv")) - >>> print(tensors[0].node) - rank: 0 - graph_name: kernel_graph_0 - node_name: conv1.weight - """ - return self._node - - @property - def slot(self): - """ - The output of the node may have several tensors. The slot refer to the index of the tensor - - Returns: - int, the slot of the tensor on the node. - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - >>> tensors = list(my_run.select_tensors("conv")) - >>> print(tensors[0].slot) - 0 - """ - return self._slot - - @property - def iteration(self): - """ - Get iteration of the tensor. - - Returns: - int, the iteration of the tensor. - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - >>> tensors = list(my_run.select_tensors("conv")) - >>> print(tensors[0].iteration) - 0 - """ - return self._iteration - - @property - def rank(self): - """ - The rank is the logical id of the device on which the tensor is generated. - - Returns: - int, the rank for this tensor. - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - >>> tensors = list(my_run.select_tensors("conv")) - >>> print(tensors[0].rank) - 0 - """ - return self._node.rank - - def value(self): - """ - Get the value of the tensor. - - Returns: - Union[numpy.array, None], The value could be None if failed to find data file - in relative iteration. - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> - >>> def test_debugger_tensor(): - ... my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - ... tensors = list(my_run.select_tensors("conv")) - ... # the tensors[0].value() maybe start the new process - ... value = tensors[0].value() - ... return value - ... - >>> if __name__ == "__main__": - ... test_debugger_tensor() - ... - """ - raise NotImplementedError - - def __str__(self): - feature = f"rank: {self.rank}\n" \ - f"graph_name: {self.node.graph_name}\n" \ - f"node_name: {self.node.name}\n" \ - f"slot: {self.slot}\n" \ - f"iteration: {self.iteration}" - return feature - - -class DebuggerTensorImpl(DebuggerTensor): - """DebuggerTensor implementation.""" - - @property - def root_graph_id(self): - """Get the root_graph_id for this tensor.""" - return self._node.root_graph_id - - def has_value(self): - """Check if the tensor has value.""" - iteration = self.iteration - if iteration is None: - return False - data_loader = self.node.debugger_engine.data_loader - has_dump_output = bool(data_loader.dump_target in [DumpTarget.FULL, DumpTarget.OUTPUT_ONLY]) - if not has_dump_output: - return False - if self.node.node_type == NodeType.CONSTANT: - iteration = 'Constant' - iter_dirs = data_loader.get_step_iter(rank_id=self.rank, step=iteration) - file_found = self._file_found(iter_dirs) - return file_found - - def _file_found(self, iter_dirs): - """Check if the tensor file found in specified directory.""" - node_name_without_scope = self.node.name.split('/')[-1] - bin_pattern = node_name_without_scope + r".*.(\d+)$" - npy_pattern = f"{node_name_without_scope}.*.output.{self.slot}.*.npy$" - for iter_dir in iter_dirs: - for tensor_path in iter_dir.iterdir(): - file_name = tensor_path.name - if re.search(bin_pattern, file_name) or re.search(npy_pattern, file_name): - return True - return False - - def value(self): - if self.iteration is None: - log.warning("The iteration of is not specified, no value returned.") - return None - base_node = self.node.base_node - if hasattr(base_node, 'output') and hasattr(base_node.output, 'info'): - info = base_node.output.info - if isinstance(info, dict) and info.get("np_value") is not None: - return info.get("np_value") - debugger_engine = self.node.debugger_engine - tensor_info = debugger_engine.dbg_services_module.TensorInfo( - node_name=base_node.full_name if self.node.node_type == NodeType.CONSTANT else self.node.name, - slot=self.slot, - iteration=self.iteration, - rank_id=self.rank, - root_graph_id=self.root_graph_id, - is_output=True) - tensors = debugger_engine.dbg_service.read_tensors([tensor_info]) - return self._to_numpy(tensors[0]) - - @staticmethod - def _to_numpy(tensor_data): - """Turn tensor data into Numpy.""" - if tensor_data.data_size == 0: - return None - dtype_str = DataType.Name(tensor_data.dtype) - np_type = NUMPY_TYPE_MAP.get(dtype_str) - data = np.frombuffer(tensor_data.data_ptr, dtype=np_type) - data = data.reshape(tensor_data.shape) - return data diff --git a/mindinsight/debugger/api/dump_analyzer.py b/mindinsight/debugger/api/dump_analyzer.py deleted file mode 100644 index a22bbff7..00000000 --- a/mindinsight/debugger/api/dump_analyzer.py +++ /dev/null @@ -1,867 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""Debugger python API.""" -import os.path -from typing import Iterable -import csv -import stat -from pathlib import Path -import numpy as np - -import mindinsight -from mindinsight.debugger.api.conditions import WatchpointHit, HitDetail, WatchpointHandle, WatchpointHitImpl -from mindinsight.debugger.api.debugger_engine import DebuggerEngine -from mindinsight.debugger.api.debugger_tensor import DebuggerTensor, DebuggerTensorImpl -from mindinsight.debugger.api.node import Node, NodeImpl, NodeUniqueId -from mindinsight.debugger.api.statistic import TensorStatistic, SummaryStatistic -from mindinsight.debugger.common.exceptions.exceptions import DebuggerParamValueError -from mindinsight.debugger.common.log import LOGGER as log -from mindinsight.debugger.common.log import setup_logger -from mindinsight.debugger.common.utils import ( - validate_type, validate_slots, parse_param_to_iterable_obj -) -from mindinsight.common.util import version_match -from mindinsight.debugger.dump.parser import DebuggerParser -from mindinsight.debugger.stream_cache.data_loader import DataLoader -from mindinsight.domain.graph.base import NodeType -from mindinsight.domain.graph.query import construct_filter_func -from mindinsight.utils.exceptions import VersionNotMatchError - - -class DumpAnalyzer: - """ - Analyzer to inspect the dump data. - - .. warning:: - All APIs in this class are experimental prototypes that are subject to - change or deletion. - - Args: - dump_dir (str): The path of the dump folder. - mem_limit (int, optional): The memory limit for checking watchpoints in MB. - Optional values: from 2048 MB to 2147483647 MB. ``None`` means no limit is set, - only limited by computor memory. Default: ``None``. - - Supported Platforms: - ``Ascend`` ``GPU`` - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - """ - - def __init__(self, dump_dir, mem_limit=None): - self._dump_dir = os.path.realpath(dump_dir) - self._mem_limit = 0 if mem_limit is None else mem_limit - self._data_loader = None - self._debuger_engine = None - self._parser = None - # the key is rank_id, the value is map - self._nodes = {} - self._initialize() - - def _initialize(self): - """Initialize.""" - self._validate_mem_limit(self._mem_limit) - self._data_loader = DataLoader(self._dump_dir) - self._debugger_engine = DebuggerEngine(self._data_loader, self._mem_limit) - self._check_version() - self._parse() - - @staticmethod - def _validate_mem_limit(mem_limit): - """Validate memory limit.""" - validate_type(mem_limit, 'mem_limit', int, 'int or None') - # The unit is MB, from 2G to max value of int32 MB - min_limit_value = 2 * 1024 - max_limit_value = 2147483647 - if mem_limit and mem_limit < min_limit_value or mem_limit > max_limit_value: - msg = f"If mem_limit is not None, it should be set in [{min_limit_value}, {max_limit_value}]." - raise DebuggerParamValueError(msg) - - def _check_version(self): - """Check version.""" - dbg_services_module = self._debugger_engine.dbg_services_module - console = setup_logger('debugger', 'console', console=True, logfile=False, formatter='%(message)s') - ms_version = dbg_services_module.get_version() - mi_version = mindinsight.__version__ - version_match_stat = version_match(ms_version, mi_version) - if version_match_stat > 1: - raise VersionNotMatchError(f"[WARNING] Current version of MindSpore({ms_version}) " - f"is not compatible with MindInsight({mi_version}). " - f"Otherwise some functions might not " - f"work or even raise error. Please make MindSpore " - f"version equal to MindInsight`s.") - if version_match_stat == 1: - console.warning("[WARNING] Current version of MindSpore(%s) " - "is not completely compatible with MindInsight(%s). " - "Otherwise some functions might not work.", ms_version, mi_version) - - config_json = self._data_loader.get_config_json_data() - ms_data_version = config_json.get("ms_version", None) - data_match_stat = version_match(ms_data_version, mi_version) - if data_match_stat > 0: - console.warning("[WARNING] The summary data under the `dump_dir` from MindSpore(%s) " - "which the version should be equal to MindInsight`s(%s) . " - "Otherwise some functions might not " - "work or even raise error.", ms_data_version, mi_version) - - def _parse(self): - """Parse graph into nodes and tensors.""" - - def _add_node_impl(base_nodes, node_type, nodes): - nonlocal id_to_name_map - for b_node in base_nodes: - new_node = NodeImpl(b_node, node_type) - new_node.debugger_engine = self._debugger_engine - nodes[new_node.rank][new_node.unique_id] = new_node - id_to_name_map[new_node.rank][(b_node.graph_name, b_node.name)] = new_node.name - - def _update_node_list(node_list, dst_id, cur_node, cur_node_map): - nonlocal id_to_name_map - dst_node_name = id_to_name_map[cur_node.rank].get(dst_id) - if not dst_node_name: - log.info("Failed to find %s in id_to_name_map", dst_id) - return - unique_id = NodeUniqueId(name=dst_node_name, - rank=cur_node.rank, graph_name=cur_node.graph_name) - target_node = cur_node_map.get(unique_id) - if not target_node: - log.error("Failed to find %s in node_map", unique_id) - return - node_list.append(target_node) - - self._parser = DebuggerParser(self._data_loader) - ranks = self.get_ranks() - # the key is rank_id, the value is map - self._nodes = {rank_id: {} for rank_id in ranks} - id_to_name_map = {rank_id: {} for rank_id in ranks} - _add_node_impl(self._parser.constants, NodeType.CONSTANT, self._nodes) - _add_node_impl(self._parser.parameters, NodeType.PARAMETER, self._nodes) - _add_node_impl(self._parser.operators, NodeType.OPERATOR, self._nodes) - # update input and output nodes - for node_map in self._nodes.values(): - for node in node_map.values(): - base_node = node.base_node - if hasattr(base_node, 'inputs'): - # parameter or const node has no inputs - for node_input in base_node.inputs: - _update_node_list(node.input_nodes, (base_node.graph_name, node_input.name), node, node_map) - - for node_map in self._nodes.values(): - for node in node_map.values(): - for node_input in node.input_nodes: - node_input.downstream.append(node) - - def export_graphs(self, output_dir=None): - """ - Export the computational graph(s) in xlsx file(s) to the `output_dir` . - - The file(s) will contain the stack info of graph nodes. - - Args: - output_dir (str, optional): Output directory to save the file. - ``None`` means to use the current working directory. Default: ``None``. - - Returns: - str, The path of the generated file. - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - >>> res = my_run.export_graphs() - """ - return self._parser.export_xlsx(output_dir) - - def select_nodes( - self, - query_string, - use_regex=False, - select_by="node_name", - ranks=None, - case_sensitive=True) -> Iterable[Node]: - """ - Select nodes. - - Select the matched nodes in the computational graph according to the - query_string. The nodes can be matched by "node_name" or "code_stack", - see the parameters for detail. - - Args: - query_string (str): Query string. For a node to be selected, the - match target field must contains or matches the query string. - use_regex (bool, optional): Indicates whether query is a regex. Default: - ``False``. - select_by (str, optional): The field to search when selecting - nodes. Available values are ``"node_name"``, ``"code_stack"``. - ``"node_name"`` means to search the name of the nodes in the - graph. ``"code_stack"`` means the stack info of - the node. Default: ``"node_name"``. - ranks (Union[int, list[int], None], optional): The rank(s) to select. ``None`` means all ranks will be - considered. The selected nodes must exist on the specified ranks. Default: ``None``. - case_sensitive (bool, optional): Whether case-sensitive when - selecting tensors. Default: ``True``. - - Returns: - Iterable[Node], the matched nodes. - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - >>> nodes = my_run.select_nodes("Conv2D-op13") - """ - validate_type(query_string, 'query_string', str, 'str') - validate_type(use_regex, 'use_regex', bool, 'bool') - validate_type(case_sensitive, 'case_sensitive', bool, 'bool') - node_filter_func = self._get_filter_func(select_by) - ranks = self._get_iterable_ranks(ranks) - - query_filter_func = construct_filter_func(query_string, case_sensitive, use_regex) - nodes = [] - for rank_id in ranks: - for node in self._nodes.get(rank_id, {}).values(): - if node_filter_func(node, query_filter_func): - nodes.append(node.copy()) - return nodes - - @staticmethod - def _match_name(node, filter_func): - """Check if name matched.""" - return filter_func(node.name) - - @staticmethod - def _match_stack(node, filter_func): - """Check if stack matched.""" - for res in map(filter_func, node.stack): - if res: - return True - return False - - @staticmethod - def _get_filter_func(select_by): - """Get filter function.""" - if select_by == 'node_name': - return DumpAnalyzer._match_name - if select_by == 'code_stack': - return DumpAnalyzer._match_stack - raise DebuggerParamValueError( - "The param `select_by` only support `node_name` or `code_stack`.") - - def select_tensors( - self, - query_string, - use_regex=False, - select_by="node_name", - iterations=None, - ranks=None, - slots=None, - case_sensitive=True) -> Iterable[DebuggerTensor]: - """ - Select tensors. - - Select the matched tensors in the directory according to the - sepicified filter condition, see the parameters for detail. - - Args: - query_string (str): Query string. For a tensor to be selected, the - match target field must contain or match the query string. - use_regex (bool, optional): Indicates whether query is a regex. Default: - ``False``. - select_by (str, optional): The field to search when selecting - tensors. Available values are ``"node_name"``, ``"code_stack"``. - ``"node_name"`` means to search the node name of the tensors in the - graph. ``"code_stack"`` means the stack info of - the node that outputs this tensor. Default: ``"node_name"``. - iterations (Union[int, list[int], None], optional): The iteration(s) to select. ``None`` means all dumped - iterations will be selected. Default: ``None``. - ranks (Union[int, list[int], None], optional): The rank(s) to select. ``None`` means all ranks - will be selected. Default: ``None``. - slots (list[int], optional): The slot of the selected tensor. ``None`` means all slots will be selected. - Default: ``None``. - case_sensitive (bool, optional): Whether case-sensitive when selecting tensors. Default: ``True``. - - Returns: - Iterable[DebuggerTensor], the matched tensors. - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - >>> tensors = my_run.select_tensors("Conv2D-op13") - """ - validate_type(query_string, 'query_string', str, 'str') - validate_type(use_regex, 'use_regex', bool, 'bool') - validate_type(case_sensitive, 'case_sensitive', bool, 'bool') - validate_slots(slots) - node_filter_func = self._get_filter_func(select_by) - ranks = self._get_iterable_ranks(ranks) - dumped_iterations = self.get_iterations(ranks) - iterations = parse_param_to_iterable_obj(iterations, 'iterations', dumped_iterations) - - tensors = [] - query_filter_func = construct_filter_func(query_string, case_sensitive, use_regex) - for rank_id in ranks: - for node in self._nodes.get(rank_id, {}).values(): - if node_filter_func(node, query_filter_func): - tensors.extend(node.get_output_tensors(slots=slots, iterations=iterations)) - return tensors - - def select_tensor_statistics( - self, - iterations=None, - ranks=None): - """ - Select tensor statistics. - - Select the matched tensor statistics in the directory according to the - sepicified filter condition, see the parameters for detail. - - Args: - iterations (Union[int, list[int], None], optional): The iteration(s) to select. ``None`` means all dumped - iterations will be selected. Default: ``None``. - ranks (Union[int, list[int], None], optional): The rank(s) to select. ``None`` means all ranks - will be selected. Default: ``None``. - - Returns: - Dict[TensorStatistic], the matched TensorStatistics. The format is as below. - - .. code-block:: - - { - "rank_id": - { - "iteration_id": - { - "tensor_name": - [TensorStatistic], - ... - } - } - ... - } - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - >>> statistics = my_run.select_tensor_statistics(ranks=[0]) - """ - ranks = self._get_iterable_ranks(ranks) - dumped_iterations = self.get_iterations(ranks) - iterations = parse_param_to_iterable_obj(iterations, 'iterations', dumped_iterations) - - tensor_statistics = {} - for rank_id in ranks: - static_in_rank = {} - for iteration_id in self.get_iterations(ranks=[rank_id]): - if iteration_id not in iterations: - continue - tensor_statistic = self._get_statistic(rank_id=rank_id, iteration_id=iteration_id) - static_in_rank[iteration_id] = tensor_statistic - tensor_statistics[rank_id] = static_in_rank - return tensor_statistics - - def _get_statistic(self, rank_id, iteration_id): - """ - Get the TensorStatic of the corresponding rank and iteration. - """ - tensor_statistics = {} - if not self._data_loader.has_data: - return tensor_statistics - net_name = self._data_loader.get_net_name() - net_dir = Path(os.path.join(self._dump_dir, 'rank_' + str(rank_id), net_name)).absolute() - for graph_dir in net_dir.iterdir(): - target_step_dir = graph_dir / str(iteration_id) - if not target_step_dir.is_dir(): - continue - statistic_file_path = os.path.join(target_step_dir, "statistic.csv") - with open(statistic_file_path, 'r') as f: - csv_reader = csv.DictReader(f) - # The first line of the csv file is the title, so skip the first line. - for statistic_line in csv_reader: - tensor_name = statistic_line.get('Op Name') + ':' + statistic_line.get( - 'IO') + ':' + statistic_line.get('Slot') - statistics_for_specified_name = tensor_statistics.get(tensor_name, []) - statistics_for_specified_name.append(statistic_line) - tensor_statistics.update({tensor_name: statistics_for_specified_name}) - return tensor_statistics - - def _compute_statistics(self, debugger_tensors): - """ - Compute the statistic of the given tensors. - - Args: - debugger_tensors(Iterable[DebuggerTensor]): The given DebuggerTensors. - - Returns: - Dict[TensorStatistic], the computed TensorStatistics. The format is as below. - - .. code-block:: - - {"rank_id":{ - "iteration_id": - { - "tensor_name": - [TensorStatistic], - ... - } - } - ... - } - """ - statistics = {} - for tensor in debugger_tensors: - rank_id = tensor.rank - is_new_rank = rank_id not in statistics - static_in_rank = statistics.get(rank_id, {}) - iteration = tensor.iteration - is_new_iteration = iteration not in static_in_rank - static_in_iter = static_in_rank.get(iteration, {}) - single_static = self._compute_statistic(tensor) - tensor_name = single_static.op_name + ':' + single_static.io + ':' + str(single_static.slot) - statistics_for_specified_name = static_in_iter.get(tensor_name, []) - statistics_for_specified_name.append(single_static) - static_in_iter.update({tensor_name: statistics_for_specified_name}) - if is_new_iteration: - static_in_rank[iteration] = static_in_iter - if is_new_rank: - statistics[rank_id] = static_in_rank - return statistics - - def _compute_statistic(self, debugger_tensor): - """Compute the tensor statistic for one tensor.""" - statistic = TensorStatistic() - op_name = debugger_tensor.node.name - tensor_value = debugger_tensor.value() - if tensor_value is None: - return statistic - short_name = op_name.split('/')[-1] - op_type = short_name.split('-')[0] - statistic.op_name = short_name - statistic.op_type = op_type - statistic.io = 'output' - statistic.slot = debugger_tensor.slot - statistic.data_size = tensor_value.nbytes - statistic.data_type = tensor_value.dtype - statistic.shape = tensor_value.shape - statistic.min_value = np.amin(tensor_value) - statistic.max_value = np.amax(tensor_value) - statistic.avg_value = tensor_value.mean() - statistic.count = tensor_value.size - statistic.negative_zero_count = np.sum(np.where(tensor_value == 0, 1, 0)) - statistic.positive_zero_count = np.sum(np.where(tensor_value == 0, 1, 0)) - statistic.negative_inf_count = len(np.nonzero(np.isneginf(tensor_value))[0]) - statistic.positive_inf_count = len(np.nonzero(np.isposinf(tensor_value))[0]) - statistic.nan_count = len(np.nonzero(np.isnan(tensor_value))[0]) - return statistic - - def summary_statistics(self, statistics, overflow_value=65500, out_path="./"): - """ - Summary the statistics in the different ranks and iterations. - - Args: - statistics(Dict[TensorStatistic]): The given TensorStatistic. They can be the return value of - `compute_statistic` or `select_tensor_statistics`. - overflow_value(int, optional): The given overflow threshold, default: ``65500``. - out_path(str, optional): The given output directory to save the statistics. Default: ``"./"``. - """ - summary_statistics = {} - for rank_id, statistics_in_rank in statistics.items(): - log.warning("process statistics in rank, rank_id is: %s", rank_id) - for iteration_id, statistics_in_iteration in statistics_in_rank.items(): - log.warning("process statistics in iteration, iteration_id is: %s", iteration_id) - for tensor_name, statistics_for_name in statistics_in_iteration.items(): - for statistic in statistics_for_name: - if isinstance(statistic, TensorStatistic): - self._put_tensor_statistic_to_summarystatistics(statistic, summary_statistics, - overflow_value) - else: - self._put_dict_statistic_to_summarystatistics(statistic, summary_statistics, overflow_value) - summary_statistic = summary_statistics.get(tensor_name, SummaryStatistic()) - summary_statistic.total_iterations += 1 - self._export_to_disk(summary_statistics, out_path) - - def _put_dict_statistic_to_summarystatistics(self, statistic, summary_statistics, overflow_value=65500): - """Put dict_statistic to summarized statistics, used for Statistic of dict type from statistic file.""" - op_name = statistic.get('Op Name', 'unkown') - op_type = statistic.get('Op Type', 'unkown') - io = statistic.get('IO', 'output') - slot = statistic.get('Slot', 0) - tensor_name = op_name + ":" + io + ":" + str(slot) - positive_inf_count = statistic.get('Positive Inf Count', 0) - negative_inf_count = statistic.get('Negative Inf Count', 0) - nan_count = statistic.get('NaN Count', 0) - min_value = statistic.get('Min Value', 0) - max_value = statistic.get('Max Value', 0) - has_out_of_range = False - summary_statistic = summary_statistics.get(tensor_name, SummaryStatistic()) - if not summary_statistic.op_type: - summary_statistic.op_type = op_type - if not summary_statistic.op_name: - summary_statistic.op_name = op_name - if not summary_statistic.tensor_name: - summary_statistic.tensor_name = tensor_name - summary_statistics[tensor_name] = summary_statistic - summary_statistic.total_number += 1 - if int(positive_inf_count) > 0 or int(negative_inf_count) > 0: - summary_statistic.inf_number += 1 - if int(nan_count) > 0: - summary_statistic.nan_number += 1 - if abs(float(min_value)) > overflow_value or abs(float(max_value)) > overflow_value: - summary_statistic.out_of_range_number += 1 - has_out_of_range = True - if int(positive_inf_count) == 0 and int(negative_inf_count) == 0 and int( - nan_count) == 0 and not has_out_of_range: - summary_statistic.none_overflow_number += 1 - - def _put_tensor_statistic_to_summarystatistics(self, statistic, summary_statistics, overflow_value=65500): - """Put tensor_statistic to summarized statistics, used for TensorStatistic from tensor file.""" - op_name = statistic.op_name - op_type = statistic.op_type - io = statistic.io - slot = statistic.slot - min_value = statistic.min_value - max_value = statistic.max_value - has_out_of_range = False - tensor_name = op_name + ":" + io + ":" + str(slot) - summary_statistic = summary_statistics.get(tensor_name, SummaryStatistic()) - if not summary_statistic.op_type: - summary_statistic.op_type = op_type - if not summary_statistic.op_name: - summary_statistic.op_name = op_name - if not summary_statistic.tensor_name: - summary_statistic.tensor_name = tensor_name - summary_statistics[tensor_name] = summary_statistic - summary_statistic.total_number += 1 - if statistic.positive_inf_count > 0 or statistic.negative_inf_count > 0: - summary_statistic.inf_number += 1 - if statistic.nan_count > 0: - summary_statistic.nan_number += 1 - if abs(min_value) > overflow_value or abs(max_value) > overflow_value: - summary_statistic.out_of_range_number += 1 - has_out_of_range = True - if statistic.positive_inf_count == 0 and statistic.negative_inf_count == 0 and statistic.nan_count == 0 and \ - not has_out_of_range: - summary_statistic.none_overflow_number += 1 - - def _export_to_disk(self, tensor_statistics, out_path="./"): - """ - Export the tensor staticstics to the out_path. - - Args: - tensor_statistics(Union[Dict[TensorStatistic], Dict[SummaryStatistic]]): The given Statistics. - They can be the return value of `compute_statistic` or `summary_statistics`. - out_path(str, optional): The given output directory to save the statistics. Default: ``"./"``. - - """ - ks = tensor_statistics.keys() - if not ks: - log.warning("The given tensor_statistics is empty.") - return - if not os.path.exists(out_path): - os.makedirs(out_path, exist_ok=True) - if isinstance(list(ks)[0], int): - for rank_id, statistics_in_rank in tensor_statistics.items(): - for iteration_id, statistics_in_iteration in statistics_in_rank.items(): - self._export_statistics_in_one_iteration(statistics_in_iteration, rank_id, iteration_id, out_path) - elif isinstance(list(ks)[0], str): - self._export_summary_statistics(tensor_statistics, out_path) - else: - log.warning("Invalid tensor_statistics data structure.") - - def _export_summary_statistics(self, tensor_statistics, out_path): - """Export the summarized statistics to out_path.""" - statistic_file_path = os.path.join(out_path, "statistics_summary.csv") - flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC - modes = stat.S_IWUSR | stat.S_IRUSR - with os.fdopen(os.open(statistic_file_path, flags, modes), 'w', newline='') as f: - csv_writer = csv.writer(f) - statistic_header = ["op_type", "op_name", "tensor_name", "inf_number", "nan_number", - "out_of_range_number", "total_number", "none_overflow_number", "total_iterations"] - csv_writer.writerow(statistic_header) - for _, statistic in tensor_statistics.items(): - statistic_line = [statistic.op_type, statistic.op_name, statistic.tensor_name, - statistic.inf_number, statistic.nan_number, statistic.out_of_range_number, - statistic.total_number, statistic.none_overflow_number, statistic.total_iterations] - csv_writer.writerow(statistic_line) - log.info("export summarised statistics to file: %s", statistic_file_path) - - def _export_statistics_in_one_iteration(self, tensor_statistics_in_one_iteration, rank_id, iteration_id, out_path): - """Export tensor_statistics in one iteration.""" - iteration_path = os.path.join(out_path, str(rank_id), str(iteration_id)) - if not os.path.exists(iteration_path): - os.makedirs(iteration_path, exist_ok=True) - statistic_file_path = os.path.join(iteration_path, "statistics.csv") - flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC - modes = stat.S_IWUSR | stat.S_IRUSR - with os.fdopen(os.open(statistic_file_path, flags, modes), 'w', newline='') as f: - csv_writer = csv.writer(f) - statistic_header = ["Op Type", "Op Name", "Task ID", "Stream ID", "Timestamp", "IO", "Slot", "Data Size", - "Data Type", "Shape", "Max Value", "Min Value", "Avg Value", "Count", - "Negative Zero Count", "Positive Zero Count", "NaN Count", "Negative Inf Count", - "Positive Inf Count", "Zero Count"] - csv_writer.writerow(statistic_header) - for statistic in tensor_statistics_in_one_iteration: - statistic_line = [statistic.op_type, statistic.op_name, statistic.task_id, - statistic.stream_id, statistic.time_stamp, statistic.io, statistic.slot, - statistic.data_size, statistic.data_type, statistic.shape, statistic.max_value, - statistic.min_value, statistic.avg_value, statistic.count, - statistic.negative_zero_count, statistic.positive_zero_count, statistic.nan_count, - statistic.negative_inf_count, statistic.positive_inf_count, statistic.zero_count] - csv_writer.writerow(statistic_line) - log.info("export summarised statistics to file: %s", statistic_file_path) - - def get_iterations(self, ranks=None) -> Iterable[int]: - """ - Get available iterations which have data dumped in this run. - - Args: - ranks (Union[int, list[int], None], optional): The rank(s) to select. - Get available iterations which are under the specified ranks. - The ranks refers to the number of devices to be used starting from 0 - when running distributed training. This number is called rank. - For example, for an 8-card computer, only 4-7 cards are used for - specified training, so 4-7 cards correspond to the ranks 0-3 respectively.. - If ``None``, return iterations of all ranks. Default: ``None``. - - Returns: - Iterable[int], available iterations which have dumped data, sorted in increasing order. - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - >>> iterations = my_run.get_iterations() - >>> print(list(iterations)) - [0] - """ - total_dumped_steps = self._data_loader.load_dumped_step() - ranks = self._get_iterable_ranks(ranks) - iterations = set() - for rank_id in ranks: - for iters_per_graph in total_dumped_steps.get(rank_id, {}).values(): - iterations.update(iters_per_graph) - res = list(iterations) - res.sort() - return res - - def get_ranks(self) -> Iterable[int]: - """ - Get the available ranks in this run. - - Returns: - Iterable[int], the list of rank id in current dump directory. - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - >>> ranks = my_run.get_ranks() - >>> print(list(ranks)) - [0] - """ - return [rank_dir.rank_id for rank_dir in self._data_loader.rank_dirs] - - def check_watchpoints( - self, - watchpoints, - error_on_no_value=False) -> Iterable[WatchpointHit]: - """ - Check the given watchpoints in a batch. - - Note: - 1. For speed, all watchpoints for the iteration should be given at - the same time to avoid reading tensors len(watchpoints) times. - - 2. The `check_watchpoints` function start a new process when it is called, needs to be - called in `if __name__ == '__main__'` . - - Args: - watchpoints (Iterable[Watchpoint]): The list of watchpoints. - error_on_no_value (bool, optional): Whether to report error code in watchpoint - hit when the specified tensor have no value stored in - dump_dir. Default: ``False``. - - Returns: - Iterable[WatchpointHit], the watchpoint hit list, sorted by tensor drop time. - - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> from mindinsight.debugger import (TensorTooLargeCondition, - ... Watchpoint) - >>> - >>> def test_watchpoints(): - ... my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - ... tensors = my_run.select_tensors( - ... query_string="Conv2D-op13", - ... use_regex=True, - ... iterations=[0], - ... ranks=[0], - ... slots=[0] - ... ) - ... watchpoint = Watchpoint(tensors=tensors, - ... condition=TensorTooLargeCondition(abs_mean_gt=0.0)) - ... # the check_watchpoints function start a new process needs to be called through the main entry - ... hit = list(my_run.check_watchpoints(watchpoints=[watchpoint]))[0] - ... # print(str(hit)) - ... # the print result is as follows - ... # Watchpoint TensorTooLarge triggered on tensor: - ... # rank: 0 - ... # graph_name: kernel_graph_0 - ... # node_name: Default/network-WithLossCell/_backbone-AlexNet/conv2-Conv2d/Conv2D-op13 - ... # slot: 0 - ... # iteration: 0 - ... # Threshold: {'abs_mean_gt': 0.0} - ... # Hit detail: the setting for watchpoint is abs_mean_gt = 0.0. - ... # The actual value of the tensor is abs_mean_gt = 0.06592023578438996. - ... - >>> if __name__ == "__main__": - ... test_watchpoints() - ... - """ - wp_hit_list = [] - # key is watchpoint_id, value is a dict with iteration as the key and check_nodes as values - iterations = set() - wp_handles = {wp_id: WatchpointHandle(wp_id, wp) for wp_id, wp in enumerate(watchpoints)} - for wp_handle in wp_handles.values(): - iterations.update(wp_handle.get_iterations()) - debugger_backend = self._debugger_engine.dbg_service - # check all the watchpoint for the iterations - for iteration in iterations: - log.info("Check watchpoints for iteration %s", iteration) - if not self._data_loader.has_data(iteration): - log.info("No data dumped with iteration id: %s. Ignore checking watchpoint.", iteration) - continue - # adding the watchpoint for current iteration - for wp_handle in wp_handles.values(): - wp_handle.add_watchpoint(iteration, self._debugger_engine) - # check the watchpoint for current iteration - # add the hit watchpoints to hit list - hit_list = debugger_backend.check_watchpoints( - iteration=iteration, error_on_no_value=error_on_no_value) - for hit in hit_list: - # the list of slots for the hit node to report - # (for the current watchpoint and iteration) - wp_handle = wp_handles.get(hit.watchpoint_id) - graph_name, node_name = hit.name.split('/', 1) - node = self._get_node(node_name, hit.rank_id, graph_name) - tensor = DebuggerTensorImpl(node=node, slot=hit.slot, iteration=iteration) - if wp_handle.need_check(tensor): - hit_params = hit.parameters - hit_detail = HitDetail(hit_params, wp_handle.condition) - wp_hit = WatchpointHitImpl(tensor=tensor, - condition=wp_handle.condition, - hit_detail=hit_detail, - error_code=hit.error_code) - wp_hit_list.append(wp_hit) - if error_on_no_value: - no_value_hit_list = [] - for wp_handle in wp_handles.values(): - no_value_hit_list += wp_handle.watchpoint_hit_on_no_value(iteration) - wp_hit_list += no_value_hit_list - # remove all the watchpoints for the previous iterations - for watchpoint_id in wp_handles: - debugger_backend.remove_watchpoint(watchpoint_id=watchpoint_id) - - return wp_hit_list - - def _get_node(self, node_name, rank_id, graph_name): - """Get NodeImpl object.""" - unique_id = NodeUniqueId(name=node_name, rank=rank_id, graph_name=graph_name) - node = self._nodes.get(rank_id, {}).get(unique_id) - return node - - def list_affected_nodes(self, tensor): - """ - List the nodes that use given tensor as input. - - Affected nodes is defined as the nodes use the given tensor as input. If - a node is affected by the given tensor, the node's output value is - likely to change when the given tensor changes. - - Args: - tensor (DebuggerTensor): The tensor of which affected nodes will be - returned. - - Returns: - Iterable[Node], the affected nodes of the specified tensor. - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - >>> tensor_list = list(my_run.select_tensors(query_string="Conv2D-op13")) - >>> affected_nodes = my_run.list_affected_nodes(tensor_list[0]) - """ - self._validate_node(tensor.node) - affected_nodes = [affected_node.copy() for affected_node in tensor.node.downstream] - return affected_nodes - - def get_input_nodes(self, node): - """ - Get the input nodes of the given node. - - Args: - node (Node): The node of which input nodes will be returned. - - Returns: - Iterable[Node], the input nodes of the specified node. - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - >>> node_list = list(my_run.select_nodes(query_string="Conv2D-op13")) - >>> input_nodes = my_run.get_input_nodes(node_list[0]) - """ - self._validate_node(node) - input_nodes = node.input_nodes.copy() - return input_nodes - - def get_output_nodes(self, node): - """ - Get the nodes that use the output tensors of the given node. - - Args: - node (Node): The specified node. - - Returns: - Iterable[Node], output nodes of the specified node. - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - >>> node_list = list(my_run.select_nodes(query_string="Conv2D-op13")) - >>> out_nodes = my_run.get_output_nodes(node_list[0]) - """ - self._validate_node(node) - output_nodes = node.downstream.copy() - return output_nodes - - def _validate_node(self, node): - """Check if node is in current directory.""" - validate_type(node, 'node', NodeImpl, 'Node') - node = self._get_node(node.name, node.rank, node.graph_name) - if node is None: - raise DebuggerParamValueError(f"Failed to find node {node.name} with rank {node.rank} " - "in dump directory.") - - def _get_iterable_ranks(self, ranks): - """ - Validate input ranks and return iterable rands. - - Args: - ranks (Union[int, list[int], None], optional): The range of ranks. - - Returns: - list[int], list of rank id. - """ - total_ranks = self.get_ranks() - return parse_param_to_iterable_obj(ranks, 'ranks', total_ranks) diff --git a/mindinsight/debugger/api/node.py b/mindinsight/debugger/api/node.py deleted file mode 100644 index 7cb8c398..00000000 --- a/mindinsight/debugger/api/node.py +++ /dev/null @@ -1,359 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""Node in the computational graph.""" -import collections -from abc import ABC - -from mindinsight.debugger.api.debugger_tensor import DebuggerTensorImpl -from mindinsight.debugger.common.exceptions.exceptions import DebuggerParamValueError -from mindinsight.debugger.common.utils import validate_slots, parse_param_to_iterable_obj -from mindinsight.domain.graph.base import NodeType - -NodeFeature = collections.namedtuple('NodeFeature', ['name', 'rank', 'stack', - 'graph_name', 'root_graph_id']) -NodeUniqueId = collections.namedtuple('NodeUniqueId', ['name', 'rank', 'graph_name']) - - -class Node(ABC): - """ - Node in the computational graph. - - .. warning:: - All APIs in this class are experimental prototypes that are subject to - change or deletion. - - Args: - node_feature (namedtuple): The node feature, including the following information: - - - name (str): The node name. - - rank (int): The rank id. - - stack (iterable[dict]): The stack information. The format of each item is like: - - .. code-block:: - - { - 'file_path': str, - 'line_no': int, - 'code_line': str - } - - - graph_name (str): The graph name. - - root_graph_id (int): The root graph id. - - Note: - - Users should not instantiate this class manually. - - The instances of this class is immutable. - """ - - def __init__(self, node_feature): - self._node_feature = node_feature - - @property - def name(self): - """ - Get the full name of this node. - - Returns: - str, the full name of the node. - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - >>> node = list(my_run.select_nodes("conv"))[0] - >>> print(node.name) - conv1.weight - """ - return self._node_feature.name - - @property - def stack(self): - """ - Get stack info of the node. - - Returns: - iterable[dict], each item format as follows, - - .. code-block:: - - { - 'file_path': str, - 'line_no': int, - 'code_line': str - } - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - >>> node = list(my_run.select_nodes("Conv2D-op13"))[0] - >>> # print(node.stack) - >>> # the print result is as follows - >>> # [{'file_path': '/path', 'line_no': 266, 'code_line': 'output = self.conv2d(x, self.weight)', - >>> # 'has_substack': False}, - >>> # {'file_path': '/path', 'line_no': 55, 'code_line': 'x = self.conv2(x), 'has_substack': False}] - """ - return self._node_feature.stack - - @property - def rank(self) -> int: - """ - Get rank info. - - Returns: - int, the rank id to which the node belong. - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - >>> node = list(my_run.select_nodes("conv"))[0] - >>> print(node.rank) - 0 - """ - return self._node_feature.rank - - @property - def root_graph_id(self) -> int: - """ - Get the root graph id to which the dumped tensor of current node will belong. - - Returns: - int, the root graph id. - """ - return self._node_feature.root_graph_id - - @property - def graph_name(self) -> str: - """ - Get graph name of current node. - - Returns: - str, the graph name. - """ - return self._node_feature.graph_name - - def get_input_tensors( - self, - iterations=None, - slots=None): - """ - Get the input tensors of the node. - - Args: - iterations (Iterable[int], optional): The iterations to which the returned - tensor should belong. ``None`` means all available iterations will be considered. - Default: ``None``. - slots (Iterable[int], optional): The slots in which the returned tensors - should be. ``None`` means all available slots will be considered. Default: ``None``. - - Returns: - Iterable[DebuggerTensor], the input tensors of the node. - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - >>> node = list(my_run.select_nodes("Conv2D-op13"))[0] - >>> input_tensors = node.get_input_tensors(iterations=[0], slots=[0]) - """ - - def get_output_tensors( - self, - iterations=None, - slots=None): - """ - Get the output tensors of this node. - - Args: - iterations (Iterable[int], optional): The iterations to which the returned - tensor should belong. ``None`` means all available iterations will be considered. - Default: ``None``. - slots (Iterable[int], optional): The slots in which the returned tensors - should be. ``None`` means all available slots will be considered. Default: ``None``. - - Returns: - Iterable[DebuggerTensor], the output tensors of the node. - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - >>> node = list(my_run.select_nodes("Conv2D-op13"))[0] - >>> output_tensors = node.get_output_tensors(iterations=[0], slots=[0]) - """ - - def __str__(self): - feature = f"rank: {self.rank}\n" \ - f"graph_name: {self.graph_name}\n" \ - f"node_name: {self.name}" - return feature - - -class NodeImpl(Node): - """Node implementation.""" - - def __init__(self, base_node, node_type): - self._base_node = base_node - self._node_type = node_type - node_feature = self._get_node_feature() - super(NodeImpl, self).__init__(node_feature) - self.debugger_engine = None - self.input_nodes = [] - self.downstream = [] - - @property - def name(self): - """ - Get the full name of this node. - - Returns: - str, the full name of the node. - - Examples: - >>> from mindinsight.debugger import DumpAnalyzer - >>> my_run = DumpAnalyzer(dump_dir="/path/to/your/dump_dir_with_dump_data") - >>> node = list(my_run.select_nodes("conv"))[0] - >>> print(node.name) - conv1.weight - """ - if hasattr(self._base_node, 'type') and (self._base_node.type == "Load" or "Summary" in self._base_node.type): - name = self._base_node.name.split('/')[-1] - node_id = name.split('op')[-1] - name = f'{self._base_node.type}-op{node_id}' - return f'{self._base_node.scope}/{name}' - return self._node_feature.name - - @property - def node_type(self): - """Get the node type.""" - return self._node_type - - @property - def base_node(self): - """Get the base node.""" - return self._base_node - - @property - def output_slot_size(self): - """Get the base node.""" - return self._base_node.output.slot_size - - @property - def full_name_with_graph(self): - """Return node name startswith graph name.""" - return f"{self.graph_name}/{self.name}" - - @property - def unique_id(self): - """Get the unique id of the node.""" - return NodeUniqueId(self.name, self.rank, self.graph_name) - - def _get_node_feature(self): - """Get node feature.""" - node = self._base_node - if self._node_type in (NodeType.CONSTANT, NodeType.PARAMETER): - feature = NodeFeature(name=node.name, - rank=node.rank_id, - stack=[], - graph_name=node.graph_name, - root_graph_id=node.root_graph_id) - elif self._node_type == NodeType.OPERATOR: - feature = NodeFeature(name=node.full_name, - rank=node.rank_id, - stack=node.stack, - graph_name=node.graph_name, - root_graph_id=node.root_graph_id) - else: - raise DebuggerParamValueError(f"Invalid node_type, got {self._node_type}") - return feature - - def get_input_tensors( - self, - iterations=None, - slots=None): - """ - Get the input tensors of the node. - - Args: - iterations (Iterable[int], optional): The iterations to which the returned - tensor should belong. ``None`` means all available iterations will be considered. - Default: ``None``. - slots (Iterable[int], optional): The slots in which the returned tensors - should be. ``None`` means all available slots will be considered. Default: ``None``. - - Returns: - Iterable[DebuggerTensor], the input tensors of the node. - """ - validate_slots(slots) - iterations = self._get_iterable_iterations(iterations) - current_index = 0 - res = [] - for node in self.input_nodes: - if slots is not None: - query_slots = [slot for slot in range(node.output_slot_size) if slot + current_index in slots] - else: - query_slots = None - res.extend(node.get_output_tensors(iterations, query_slots)) - current_index += node.output_slot_size - return res - - def get_output_tensors( - self, - iterations=None, - slots=None): - """ - Get the output tensors of this node. - - Args: - iterations (Iterable[int]): The iterations to which the returned - tensor should belong. Default: ``None``. - slots (Iterable[int]): The slots in which the returned tensors - should be. Default: ``None``. - - Returns: - Iterable[DebuggerTensor], the output tensors of the node. - """ - validate_slots(slots) - iterations = self._get_iterable_iterations(iterations) - output_slots = list(range(self.output_slot_size)) - if slots is None: - query_slots = output_slots - else: - query_slots = [slot for slot in output_slots if slot in slots] - res = [] - for slot in query_slots: - for iteration in iterations: - res.append(DebuggerTensorImpl(self.copy(), slot, iteration)) - return res - - def _get_iterable_iterations(self, iterations): - """ - Validate input and return iterable iterations. - - Args: - iterations (Union[int, list[int], None], optional): The specified iterations. - - Returns: - list[int], list of iteration. - """ - data_loader = self.debugger_engine.data_loader - total_dumped_steps = data_loader.load_dumped_step(self.rank) - dumped_iterations = total_dumped_steps.get(self.rank, {}).get(self.root_graph_id, []) - iterations = parse_param_to_iterable_obj(iterations, 'iterations', dumped_iterations, False) - return iterations - - def copy(self): - """Copy Node.""" - node = NodeImpl(self._base_node, self._node_type) - node.debugger_engine = self.debugger_engine - node.input_nodes = self.input_nodes.copy() - node.downstream = self.downstream.copy() - return node diff --git a/mindinsight/debugger/api/statistic.py b/mindinsight/debugger/api/statistic.py deleted file mode 100644 index b799af9d..00000000 --- a/mindinsight/debugger/api/statistic.py +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright 2023 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== -"""TensorStatistic for DebuggerTensor.""" - - -class TensorStatistic: - """The tensor statistic class.""" - - def __init__(self, op_type='', op_name='', task_id=0, stream_id=0, time_stamp=0, - io='', slot=0, data_size=0, data_type='', shape=(), - max_value=float('-inf'), min_value=float('inf'), avg_value=0, count=0, - negative_zero_count=0, - positive_zero_count=0, nan_count=0, negative_inf_count=0, - positive_inf_count=0, zero_count=0): - self.op_type = op_type - self.op_name = op_name - self.task_id = task_id - self.stream_id = stream_id - self.time_stamp = time_stamp - self.io = io - self.slot = slot - self.data_size = data_size - self.data_type = data_type - self.shape = shape - self.max_value = max_value - self.min_value = min_value - self.avg_value = avg_value - self.count = count - self.negative_zero_count = negative_zero_count - self.positive_zero_count = positive_zero_count - self.nan_count = nan_count - self.negative_inf_count = negative_inf_count - self.positive_inf_count = positive_inf_count - self.zero_count = zero_count - - -class SummaryStatistic: - """The tensor statistic class.""" - - def __init__(self, op_type='', op_name='', tensor_name='', inf_number=0, nan_number=0, - out_of_range_number=0, total_number=0, none_overflow_number=0, total_iterations=0): - self.op_type = op_type - self.op_name = op_name - self.tensor_name = tensor_name - self.inf_number = inf_number - self.nan_number = nan_number - self.out_of_range_number = out_of_range_number - self.total_number = total_number - self.none_overflow_number = none_overflow_number - self.total_iterations = total_iterations diff --git a/mindinsight/debugger/debugger_folder_analyzer.py b/mindinsight/debugger/debugger_folder_analyzer.py index c588dec1..c78c9bec 100644 --- a/mindinsight/debugger/debugger_folder_analyzer.py +++ b/mindinsight/debugger/debugger_folder_analyzer.py @@ -13,11 +13,6 @@ # limitations under the License. # ============================================================================ """Debugger train job register.""" - -import os - -from mindinsight.datavisual.common.log import logger -from mindinsight.debugger.common.utils import is_valid_rank_dir_name from mindinsight.utils.folder_analyzer import FolderAnalyzer @@ -26,19 +21,5 @@ class DebuggerFolderAnalyzer(FolderAnalyzer): def analyze(self, entry, summary_base_dir, relative_path): """Check dir by debugger register.""" update_info = {} - if entry.is_dir(): - sub_relative_path = os.path.join(relative_path, entry.name) - entry_path = entry.path - try: - subdir_entries = os.scandir(entry_path) - except PermissionError: - logger.warning('Path of %s under summary base directory is not accessible.', entry.name) - return update_info - subdir_entries = [subdir_entry for subdir_entry in subdir_entries if not subdir_entry.is_symlink()] - subdir_entries = sorted(subdir_entries, key=lambda x: x.stat().st_mtime) - for subdir_entry in subdir_entries: - if subdir_entry.is_dir() and is_valid_rank_dir_name(subdir_entry.name) and \ - os.path.exists(os.path.join(subdir_entry.path, ".dump_metadata")): - update_info = {'dump_dir': sub_relative_path} - return update_info + # Delete debugger since mindspore2.4. return update_info diff --git a/mindinsight/ui/src/views/train-manage/summary-manage.vue b/mindinsight/ui/src/views/train-manage/summary-manage.vue index 7cc0eeb2..e0bcf119 100644 --- a/mindinsight/ui/src/views/train-manage/summary-manage.vue +++ b/mindinsight/ui/src/views/train-manage/summary-manage.vue @@ -100,16 +100,6 @@ limitations under the License. :title="$t('summaryManage.disableProfilerTip')"> {{$t('summaryManage.viewProfiler')}} - - {{$t('summaryManage.viewOfflineDebugger')}} - - {{$t('summaryManage.viewOfflineDebugger')}} - @@ -171,45 +161,6 @@ limitations under the License.
  • {{$t('summaryManage.openNewTab')}}
  • - - - {{ debuggerDialog.title }} - - - - -
    {{ $t('summaryManage.sessionLists') }}
    - - - - - - - - - - -
    @@ -369,7 +320,6 @@ export default { i.update_time = i.update_time ? i.update_time : '--'; i.viewProfiler = i.profiler_dir && i.profiler_dir.length; i.viewDashboard = i.summary_files || i.graph_files || i.lineage_files; - i.viewOfflineDebugger = i.dump_dir; i.paramDetails = i.lineage_files; }); this.currentFolder = res.data.name ? res.data.name : '--'; @@ -455,29 +405,7 @@ export default { }, }); }, - /** - * go to Offline Debugger - * @param {Object} row select row - */ - goToOfflineDebugger(row) { - this.contextMenu.show = false; - const debuggerDir = row.dump_dir; - const params = { - session_type: 'OFFLINE', - dump_dir: debuggerDir, - }; - this.getSessionId(params).then((value) => { - if (value !== undefined) { - this.$router.push({ - path: '/offline-debugger', - query: { - dir: debuggerDir, - sessionId: value, - }, - }); - } - }); - }, + getSessionId(params) { const loadingInstance = this.$loading(this.loadingOption); return RequestService.getSession(params).then( diff --git a/tests/st/func/debugger/__init__.py b/tests/st/func/debugger/__init__.py deleted file mode 100644 index 9d622a91..00000000 --- a/tests/st/func/debugger/__init__.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -Function: - Test debugger system test. -Usage: - pytest tests/st/func/debugger -""" diff --git a/tests/st/func/debugger/api/__init__.py b/tests/st/func/debugger/api/__init__.py deleted file mode 100644 index bd3821a0..00000000 --- a/tests/st/func/debugger/api/__init__.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -Function: - Test debugger api. -Usage: - pytest tests/st/func/debugger -""" diff --git a/tests/st/func/debugger/api/test_dump_analyzer.py b/tests/st/func/debugger/api/test_dump_analyzer.py deleted file mode 100644 index 68b21593..00000000 --- a/tests/st/func/debugger/api/test_dump_analyzer.py +++ /dev/null @@ -1,140 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -Function: - Test query dump analyzer. -Usage: - pytest tests/st/func/debugger -""" - -import os -import shutil -import tempfile -from unittest import mock - -import pytest - -from mindinsight.debugger import DumpAnalyzer, Watchpoint, TensorTooLargeCondition, TensorTooSmallCondition, \ - TensorUnchangedCondition, TensorRangeCondition, TensorOverflowCondition, OperatorOverflowCondition, \ - TensorAllZeroCondition, TensorChangeBelowThresholdCondition, TensorChangeAboveThresholdCondition -from mindinsight.debugger.debugger_services.debugger_offline_server import DebuggerOfflineManager -from tests.st.func.debugger.utils import build_multi_net_dump_structure -from tests.st.func.debugger.debugger_services import mock_dbg_services - - -class TestDumpAnalyzer: - """Test debugger on Ascend backend.""" - - @classmethod - def setup_class(cls): - """Setup class.""" - cls.debugger_tmp_dir = build_multi_net_dump_structure(create_statistic=True) - with mock.patch.object(DebuggerOfflineManager, 'get_dbg_service_module', return_value=mock_dbg_services): - cls.dump_analyzer = DumpAnalyzer(cls.debugger_tmp_dir) - - @classmethod - def teardown_class(cls): - """Run after test this class.""" - if os.path.exists(cls.debugger_tmp_dir): - shutil.rmtree(cls.debugger_tmp_dir) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_select_nodes(self): - """Get debugger online server""" - nodes = self.dump_analyzer.select_nodes('conv') - assert len(nodes) == 128 - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_select_tensors(self): - """Get debugger online server""" - tensors = self.dump_analyzer.select_tensors('o', iterations=1) - assert len(tensors) == 286 - assert tensors[0].value() is not None - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_select_tensor_statistics(self): - """Test select tensor_statistics with specified rank and iterations.""" - tensor_statistics = self.dump_analyzer.select_tensor_statistics(ranks=0, iterations=1) - assert len(tensor_statistics) == 1 - assert len(tensor_statistics[0]) == 1 - assert len(tensor_statistics[0][1]) == 3 - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_summary_statistics(self): - """Test summary_statistic, for statistics from statistic.csv.""" - tensor_statistics = self.dump_analyzer.select_tensor_statistics(ranks=0, iterations=1) - with tempfile.TemporaryDirectory(dir='/tmp') as tmp_dir: - self.dump_analyzer.summary_statistics(tensor_statistics, 65500, tmp_dir) - statistic_file = os.path.join(tmp_dir, 'statistics_summary.csv') - os.path.isfile(statistic_file) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_get_iterations(self): - """Test get iterations.""" - assert self.dump_analyzer.get_iterations(ranks=0) == [0, 1, 4, 6] - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_get_affected_nodes(self): - """Test get iterations.""" - tensors = self.dump_analyzer.select_tensors('Conv', iterations=0, case_sensitive=True) - assert len(tensors) == 72 - - @pytest.mark.parametrize("watchpoint", [ - TensorTooLargeCondition(abs_mean_gt=0.0), - TensorTooSmallCondition(max_lt=-1, min_lt=1), - TensorUnchangedCondition(0, 1), - TensorRangeCondition(range_percentage_gt=0, range_start_inclusive=0, range_end_inclusive=4), - TensorOverflowCondition(), - OperatorOverflowCondition(), - TensorAllZeroCondition(0), - TensorChangeBelowThresholdCondition(0.0), - TensorChangeAboveThresholdCondition(0.0) - ]) - def test_watchpoint(self, watchpoint): - """Test watchpoint.""" - tensors = self.dump_analyzer.select_tensors('Conv2DBackpropFilter', iterations=0, case_sensitive=True, ranks=0) - watchpoint = Watchpoint(tensors, watchpoint) - hits = self.dump_analyzer.check_watchpoints([watchpoint]) - assert len(hits) == 6 diff --git a/tests/st/func/debugger/api/test_node.py b/tests/st/func/debugger/api/test_node.py deleted file mode 100644 index 3813bddb..00000000 --- a/tests/st/func/debugger/api/test_node.py +++ /dev/null @@ -1,109 +0,0 @@ -# Copyright 2022 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -Function: - Test query the offline debugger api of node. -Usage: - pytest tests/st/func/debugger/api/test_node.py -""" - -import os -import shutil -from unittest import mock - -import pytest - -from mindinsight.debugger import DumpAnalyzer -from mindinsight.debugger.debugger_services.debugger_offline_server import DebuggerOfflineManager -from tests.st.func.debugger.utils import build_multi_net_dump_structure -from tests.st.func.debugger.debugger_services import mock_dbg_services - - -class TestNode: - """Test debugger on Ascend and GPU backend.""" - - @classmethod - def setup_class(cls): - """Setup class.""" - cls.debugger_tmp_dir = build_multi_net_dump_structure(create_tensor=True) - with mock.patch.object(DebuggerOfflineManager, 'get_dbg_service_module', return_value=mock_dbg_services): - dump_analyzer = DumpAnalyzer(cls.debugger_tmp_dir) - cls.node = dump_analyzer.select_nodes('Conv2D-op1')[0] - - @classmethod - def teardown_class(cls): - """Run after test this class.""" - if os.path.exists(cls.debugger_tmp_dir): - shutil.rmtree(cls.debugger_tmp_dir) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_get_input_tensors(self): - """Test the method get_input_tensors.""" - input_tensors = self.node.get_input_tensors() - assert input_tensors - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_get_output_tensors(self): - """Test the method get_output_tensors.""" - output_tensors = self.node.get_output_tensors() - assert output_tensors - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_graph_name(self): - """Test the graph_name property.""" - graph_name = self.node.graph_name - assert graph_name - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_name(self): - """Test the name property.""" - name = self.node.name - assert name - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_rank(self): - """Test the property rank.""" - rank_id = self.node.rank - assert isinstance(rank_id, int) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_root_graph_id(self): - """Test the root_graph_id property.""" - root_graph_id = self.node.root_graph_id - assert isinstance(root_graph_id, int) diff --git a/tests/st/func/debugger/conftest.py b/tests/st/func/debugger/conftest.py deleted file mode 100644 index 8dec5369..00000000 --- a/tests/st/func/debugger/conftest.py +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright 2020-2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -Description: This file is used for some common util. -""" -import os -from unittest.mock import Mock - -import pytest -from flask import Response - -from mindinsight.conf import settings -from mindinsight.datavisual.utils import tools -from mindinsight.debugger.session_manager import SessionManager -from mindinsight.debugger.stream_handler.graph_handler import GraphHandler -from mindinsight.domain.graph.proto import ms_graph_pb2 - -GRAPH_PROTO_FILE = os.path.join( - os.path.dirname(__file__), '../../../utils/resource/graph_pb/lenet.pb' -) - -DEBUGGER_BASE_URL = '/v1/mindinsight/debugger/sessions/0/' -DEBUGGER_TEST_BASE_DIR = os.path.dirname(__file__) -DEBUGGER_EXPECTED_RESULTS = os.path.join(DEBUGGER_TEST_BASE_DIR, 'expect_results') - - -def init_graph_handler(): - """Init graph proto.""" - with open(GRAPH_PROTO_FILE, 'rb') as file_handler: - content = file_handler.read() - - graph = ms_graph_pb2.GraphProto() - graph.ParseFromString(content) - - graph_handler = GraphHandler() - graph_handler.put(graph) - - return graph_handler - - -@pytest.fixture(scope='session') -def app_client(): - """This fixture is flask server.""" - packages = ["mindinsight.backend.debugger"] - settings.ENABLE_DEBUGGER = True - - mock_obj = Mock(return_value=packages) - tools.find_app_package = mock_obj - - from mindinsight.backend.application import APP - APP.response_class = Response - client = APP.test_client() - original_val = settings.ENABLE_RECOMMENDED_WATCHPOINTS - settings.ENABLE_RECOMMENDED_WATCHPOINTS = False - try: - yield client - finally: - settings.ENABLE_RECOMMENDED_WATCHPOINTS = original_val - SessionManager.get_instance().exit() diff --git a/tests/st/func/debugger/debugger_services/__init__.py b/tests/st/func/debugger/debugger_services/__init__.py deleted file mode 100644 index 3dc1bea3..00000000 --- a/tests/st/func/debugger/debugger_services/__init__.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -Function: - Test debugger services. -Usage: - pytest tests/st/func/debugger -""" diff --git a/tests/st/func/debugger/debugger_services/mock_dbg_services.py b/tests/st/func/debugger/debugger_services/mock_dbg_services.py deleted file mode 100644 index fb527379..00000000 --- a/tests/st/func/debugger/debugger_services/mock_dbg_services.py +++ /dev/null @@ -1,199 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -The module DbgServices provides offline debugger APIs. -""" -from unittest.mock import MagicMock - -import numpy as np - -import mindinsight -from mindinsight.debugger.common.log import LOGGER as log - - -def get_version(): - """Get version.""" - return mindinsight.__version__ - - -class DbgServices: - """ - DbgServices. - - Args: - dump_file_path (str): dir where the dump files are saved. - """ - def __init__(self, dump_file_path, verbose=True): - self._verbose = verbose - self.dump_file_path = dump_file_path - self.dbg_instance = MagicMock() - self._watchpoints = {} - self.print_mes("in Python __init__, file path is {}".format(dump_file_path)) - self.version = get_version() - self.initialized = False - self.is_sync = True - self.max_mem_usage = None - - def print_mes(self, mes): - """Print message.""" - if self._verbose: - log.info(mes) - - def initialize(self, net_name, is_sync_mode, max_mem_usage): - """Initialize.""" - self.print_mes(" Python Initialize dump_file_path: {}, is_sync: {}".format(net_name, is_sync_mode)) - self.initialized = True - self.max_mem_usage = max_mem_usage - - def add_watchpoint(self, watchpoint_id, watch_condition, check_node_list, parameter_list): - """Add watchpoint.""" - self.print_mes("Add watchpoint with watchpoint id: {}".format(watchpoint_id)) - self._watchpoints[watchpoint_id] = {'watch_condition': watch_condition, - 'check_nodes': check_node_list, - 'parameter_list': parameter_list} - return 0 - - def remove_watchpoint(self, watchpoint_id): - """Remove watchpoints.""" - self.print_mes("Remove watchpoint with watchpoint id: {}".format(watchpoint_id)) - return self._watchpoints.pop(watchpoint_id) - - def check_watchpoints(self, iteration, error_on_no_value=False): - """Check watchpoints.""" - self.print_mes("Check watchpoint at iteration: {}".format(iteration)) - watch_hits = [] - if error_on_no_value: - return [] - for watchpoint_id, watchpoint in self._watchpoints.items(): - # add param hit info - real_param_list = [] - for param in watchpoint.get('parameter_list'): - mock_param = MagicMock( - actual_value=param.actual_value, - disabled=param.disabled, - hit=True, - name=param.name, - value=0.0 - ) - real_param_list.append(mock_param) - watchpoint['parameter_list'] = real_param_list - for watch_node_name, node_info in watchpoint.get('check_nodes').items(): - for rank_id in node_info.get('rank_id'): - hit = WatchpointHit(watch_node_name, - 0, - watchpoint.get('watch_condition'), - watchpoint_id, - watchpoint.get('parameter_list'), - 0, - rank_id, - watchpoint.get('root_graph_id')) - watch_hits.append(hit) - - return watch_hits - - def read_tensor_base(self, info): - """Read tensor base info.""" - info_list_inst = [] - for _ in info: - tensor_data = TensorBaseData(4, [2, 2, 3], 48) - info_list_inst.append(tensor_data) - return info_list_inst - - def read_tensor_stats(self, info): - """Read tensor stats info.""" - info_list_inst = [] - for _ in info: - tensor_data = TensorStatsData(4, [2, 2, 3], 48) - info_list_inst.append(tensor_data) - return info_list_inst - - def read_tensors(self, info): - """Read tensor values.""" - value = np.asarray(list(range(12)), dtype=np.int32).tobytes() - info_list_inst = [] - for _ in info: - tensor_data = TensorData(value, len(value), 4, [2, 2, 3]) - info_list_inst.append(tensor_data) - return info_list_inst - - -class TensorInfo: - """Tensor Information.""" - def __init__(self, node_name, slot, iteration, rank_id, is_output, root_graph_id): - self.node_name = node_name - self.slot = slot - self.iteration = iteration - self.rank_id = rank_id - self.is_output = is_output - self.root_graph_id = root_graph_id - - -class TensorData: - """Tensor data structure.""" - def __init__(self, data_ptr, data_size, dtype, shape): - self.data_ptr = data_ptr - self.data_size = data_size - self.dtype = dtype - self.shape = shape - - -class TensorStatsData: - """Tensor data structure.""" - def __init__(self, dtype, shape, data_size): - self.dtype = dtype - self.shape = shape - self.data_size = data_size - self.is_bool = False - self.max_value = 11.0 - self.min_value = 0.0 - self.avg_value = 5.5 - self.count = 12 - self.neg_zero_count = 0.0 - self.pos_zero_count = 11.0 - self.zero_count = 1.0 - self.nan_count = 0 - self.neg_inf_count = 0 - self.pos_inf_count = 0 - - -class TensorBaseData: - """Tensor data structure.""" - def __init__(self, dtype, shape, data_size): - self.dtype = dtype - self.shape = shape - self.data_size = data_size - - -class Parameter: - """Parameter structure.""" - def __init__(self, name, disabled, value, hit=False, actual_value=0.0): - self.name = name - self.disabled = disabled - self.value = value - self.hit = hit - self.actual_value = actual_value - - -class WatchpointHit: - """Watchpoint hit structure.""" - def __init__(self, name, slot, condition, watchpoint_id, parameters, error_code, rank_id, root_graph_id): - self.name = name - self.slot = slot - self.condition = condition - self.watchpoint_id = watchpoint_id - self.root_graph_id = root_graph_id - self.parameters = parameters - self.error_code = error_code - self.rank_id = rank_id diff --git a/tests/st/func/debugger/debugger_services/test_debugger_services.py b/tests/st/func/debugger/debugger_services/test_debugger_services.py deleted file mode 100644 index 0cc0ea13..00000000 --- a/tests/st/func/debugger/debugger_services/test_debugger_services.py +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -Function: - Test query debugger services. -Usage: - pytest tests/st/func/debugger -""" - -import os -import shutil -from unittest import mock - -import pytest - -from mindinsight.debugger.debugger_cache import DebuggerCache -from mindinsight.debugger.debugger_services.debugger_server_factory import \ - DebuggerServerFactory, DebuggerServerContext -from mindinsight.debugger.debugger_services.debugger_offline_server import DebuggerOfflineManager -from tests.st.func.debugger.utils import build_dump_file_structure -from tests.st.func.debugger.debugger_services import mock_dbg_services - - -class TestDebuggerServerFactory: - """Test debugger on Ascend backend.""" - - @classmethod - def setup_class(cls): - """Setup class.""" - cls.debugger_tmp_dir = build_dump_file_structure() - cls._dbg_dir = os.path.join(cls.debugger_tmp_dir, 'Ascend/sync') - cls._dbg_server_factory = DebuggerServerFactory() - - @classmethod - def teardown_class(cls): - """Run after test this class.""" - if os.path.exists(cls.debugger_tmp_dir): - shutil.rmtree(cls.debugger_tmp_dir) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_get_dbg_online_server(self): - """Get debugger online server""" - context = DebuggerServerContext(dbg_mode='online') - server_obj = self._dbg_server_factory.get_debugger_server(DebuggerCache(), context) - server_obj.start() - server_obj.stop() - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - @mock.patch.object(DebuggerOfflineManager, 'get_dbg_service_module') - def test_get_dbg_offline_server(self, mock_method): - """Get debugger offline server""" - mock_method.return_value = mock_dbg_services - context = DebuggerServerContext(dbg_mode='offline', dbg_dir=self._dbg_dir) - server_obj = self._dbg_server_factory.get_debugger_server(DebuggerCache(), context) - server_obj.start() - server_obj.stop() diff --git a/tests/st/func/debugger/dump_files/Ascend/async/rank_0/.dump_metadata/data_dump.json b/tests/st/func/debugger/dump_files/Ascend/async/rank_0/.dump_metadata/data_dump.json deleted file mode 100644 index e949c044..00000000 --- a/tests/st/func/debugger/dump_files/Ascend/async/rank_0/.dump_metadata/data_dump.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "common_dump_settings": { - "dump_mode": 0, - "path": "/absolute_path", - "net_name": "Lenet", - "iteration": "all", - "input_output": 0, - "kernels": ["Default/Conv-op12"], - "support_device": [0,1,2,3,4,5,6,7], - "op_debug_mode": 0 - } -} diff --git a/tests/st/func/debugger/dump_files/Ascend/async/rank_0/.dump_metadata/hccl.json b/tests/st/func/debugger/dump_files/Ascend/async/rank_0/.dump_metadata/hccl.json deleted file mode 100644 index e620387f..00000000 --- a/tests/st/func/debugger/dump_files/Ascend/async/rank_0/.dump_metadata/hccl.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "version": "1.0", - "server_count": "1", - "server_list": [ - { - "server_id": "0.0.0.0", - "device": [ - { - "device_id": "0", - "device_ip": "0.0.0.1", - "rank_id": "0" - }, - { - "device_id": "1", - "device_ip": "0.0.0.2", - "rank_id": "1" - } - ], - "host_nic_ip": "reserve" - } - ], - "status": "completed" -} diff --git a/tests/st/func/debugger/dump_files/Ascend/sync/rank_0/.dump_metadata/data_dump.json b/tests/st/func/debugger/dump_files/Ascend/sync/rank_0/.dump_metadata/data_dump.json deleted file mode 100644 index 9c8c4098..00000000 --- a/tests/st/func/debugger/dump_files/Ascend/sync/rank_0/.dump_metadata/data_dump.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "common_dump_settings": { - "dump_mode": 0, - "path": "/absolute_path", - "net_name": "Lenet", - "iteration": "all", - "input_output": 0, - "kernels": ["Default/Conv-op12"], - "support_device": [0,1,2,3,4,5,6,7] - }, - "e2e_dump_settings": { - "enable": true, - "trans_flag": false - } -} diff --git a/tests/st/func/debugger/dump_files/Ascend/sync/rank_0/.dump_metadata/hccl.json b/tests/st/func/debugger/dump_files/Ascend/sync/rank_0/.dump_metadata/hccl.json deleted file mode 100644 index e620387f..00000000 --- a/tests/st/func/debugger/dump_files/Ascend/sync/rank_0/.dump_metadata/hccl.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "version": "1.0", - "server_count": "1", - "server_list": [ - { - "server_id": "0.0.0.0", - "device": [ - { - "device_id": "0", - "device_ip": "0.0.0.1", - "rank_id": "0" - }, - { - "device_id": "1", - "device_ip": "0.0.0.2", - "rank_id": "1" - } - ], - "host_nic_ip": "reserve" - } - ], - "status": "completed" -} diff --git a/tests/st/func/debugger/dump_files/GPU/sync/rank_0/.dump_metadata/data_dump.json b/tests/st/func/debugger/dump_files/GPU/sync/rank_0/.dump_metadata/data_dump.json deleted file mode 100644 index 9c8c4098..00000000 --- a/tests/st/func/debugger/dump_files/GPU/sync/rank_0/.dump_metadata/data_dump.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "common_dump_settings": { - "dump_mode": 0, - "path": "/absolute_path", - "net_name": "Lenet", - "iteration": "all", - "input_output": 0, - "kernels": ["Default/Conv-op12"], - "support_device": [0,1,2,3,4,5,6,7] - }, - "e2e_dump_settings": { - "enable": true, - "trans_flag": false - } -} diff --git a/tests/st/func/debugger/expect_results/graph_handler_get_1_no_filter_condintion.json b/tests/st/func/debugger/expect_results/graph_handler_get_1_no_filter_condintion.json deleted file mode 100644 index 5d457b6e..00000000 --- a/tests/st/func/debugger/expect_results/graph_handler_get_1_no_filter_condintion.json +++ /dev/null @@ -1 +0,0 @@ -{"graph": {"nodes": [{"name": "Default", "type": "name_scope", "attr": {}, "input": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": {"shape": [[32, 6, 4, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": {"shape": [[32, 16, 4, 3]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[32, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20": {"shape": [[32, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92": {"shape": [[32, 1, 10, 10, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94": {"shape": [[32, 1, 28, 28, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 7, "independent_layout": false}, {"name": "Gradients", "type": "name_scope", "attr": {}, "input": {"Default/tuple_getitem[10]_0/tuple_getitem-op210": {"shape": [[32, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op15": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op12": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op205": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op206": {"shape": [[32, 16, 4, 3]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op202": {"shape": [[32, 1, 10, 10, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op197": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Cast-op188": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op195": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op196": {"shape": [[32, 6, 4, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op192": {"shape": [[32, 1, 28, 28, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/flatten-Flatten/Reshape-op9": {"shape": [[32, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op30": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op49": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op33": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op41": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 1, "independent_layout": false}]}} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/graph_handler_get_2_list_nodes.json b/tests/st/func/debugger/expect_results/graph_handler_get_2_list_nodes.json deleted file mode 100644 index 4fb0c364..00000000 --- a/tests/st/func/debugger/expect_results/graph_handler_get_2_list_nodes.json +++ /dev/null @@ -1 +0,0 @@ -{"graph": {"nodes": [{"name": "Default/TransData-op99", "type": "TransData", "attr": {"dst_format": "dtype: DT_STRING\nstr_val: \"NC1HWC0\"\n", "IsFeatureMapInputList": "dtype: DT_TUPLE\nvalues {\n dtype: DT_UINT64\n uint_val: 0\n}\n", "pri_format": "dtype: DT_STRING\nstr_val: \"NC1HWC0\"\n", "_datadump_original_names": "dtype: DT_TUPLE\n", "IsFeatureMapOutput": "dtype: DT_BOOL\nbool_val: true\n", "src_format": "dtype: DT_STRING\nstr_val: \"NCHW\"\n"}, "input": {"Default/args0": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/Depend-op61", "type": "Depend", "attr": {}, "input": {"Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/ReduceMean-op60": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/make_tuple-op58": {"shape": [[], [], [], [], [], [], [], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL']"}}, "output": {"Default/make_tuple[9]_3/make_tuple-op284": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/args0", "type": "Parameter", "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[32, 1, 32, 32]]"}, "input": {}, "output": {"Default/TransData-op99": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/tuple_getitem[10]_0", "type": "aggregation_scope", "attr": {}, "input": {"Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op87": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op3": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op89": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op7": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/SoftmaxCrossEntropyWithLogits-op18": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}}, "output": {"Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op195": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Conv2D-op5": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op205": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op208": {"shape": [[32, 16, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20": {"shape": [[32, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92": {"shape": [[32, 1, 10, 10, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": {"shape": [[32, 16, 4, 3]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94": {"shape": [[32, 1, 28, 28, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": {"shape": [[32, 6, 4, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/ReduceMean-op60": {"shape": [[32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 20, "independent_layout": false}, {"name": "Default/make_tuple[9]_3", "type": "aggregation_scope", "attr": {}, "input": {"Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op250": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op251": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op253": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op254": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op256": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op257": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op259": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op260": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op262": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op263": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op265": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op266": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op268": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op269": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op271": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op272": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/Depend-op61": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Default/optimizer-Momentum/Depend[8]_4/Depend-op23": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op26": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op31": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op34": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op39": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op42": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op50": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op57": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 9, "independent_layout": false}, {"name": "Default/network-WithLossCell", "type": "name_scope", "attr": {}, "input": {"Default/TransData-op99": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op193": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op197": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op203": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op207": {"shape": [[32, 16, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op211": {"shape": [[32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op193": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op192": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op197": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op196": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op203": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op202": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op207": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op206": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[32, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op210": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op211": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/Depend-op61": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 2, "independent_layout": false}, {"name": "Default/optimizer-Momentum", "type": "name_scope", "attr": {}, "input": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op65": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op68": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op71": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op74": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op77": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op80": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op83": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op86": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}}, "output": {"Default/Depend-op61": {"shape": [[], [], [], [], [], [], [], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL']"}, "Default/make_tuple[9]_3/make_tuple-op65": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op68": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op71": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op74": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op77": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op80": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op83": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op86": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 5, "independent_layout": false}]}} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/offline_debugger/get_graph_runs.json b/tests/st/func/debugger/expect_results/offline_debugger/get_graph_runs.json deleted file mode 100644 index ec9049cc..00000000 --- a/tests/st/func/debugger/expect_results/offline_debugger/get_graph_runs.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "graph_runs": [ - { - "count": 1, - "graph_name": "kernel_graph_0", - "has_data": true, - "sub_graph_names": [ - "kernel_graph_1", - "kernel_graph_2" - ] - }, - { - "count": 2, - "graph_name": "kernel_graph_3", - "has_data": true, - "sub_graph_names": [] - }, - { - "count": 3, - "graph_name": "kernel_graph_0", - "has_data": false, - "sub_graph_names": [ - "kernel_graph_1", - "kernel_graph_2" - ] - }, - { - "count": 4, - "graph_name": "kernel_graph_3", - "has_data": false, - "sub_graph_names": [] - }, - { - "count": 5, - "graph_name": "kernel_graph_0", - "has_data": true, - "sub_graph_names": [ - "kernel_graph_1", - "kernel_graph_2" - ] - }, - { - "count": 6, - "graph_name": "kernel_graph_3", - "has_data": false, - "sub_graph_names": [] - }, - { - "count": 7, - "graph_name": "kernel_graph_3", - "has_data": true, - "sub_graph_names": [] - } - ] -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/offline_debugger/get_graph_runs_exception.json b/tests/st/func/debugger/expect_results/offline_debugger/get_graph_runs_exception.json deleted file mode 100644 index 56065829..00000000 --- a/tests/st/func/debugger/expect_results/offline_debugger/get_graph_runs_exception.json +++ /dev/null @@ -1 +0,0 @@ -{"graph_runs": [{"count": 1, "graph_name": "kernel_graph_0", "has_data": true, "sub_graph_names": ["kernel_graph_1", "kernel_graph_2"]}, {"count": 2, "graph_name": "kernel_graph_3", "has_data": false, "sub_graph_names": []}, {"count": 3, "graph_name": "kernel_graph_0", "has_data": true, "sub_graph_names": ["kernel_graph_1", "kernel_graph_2"]}, {"count": 4, "graph_name": "kernel_graph_3", "has_data": false, "sub_graph_names": []}, {"count": 5, "graph_name": "kernel_graph_0", "has_data": false, "sub_graph_names": ["kernel_graph_1", "kernel_graph_2"]}, {"count": 6, "graph_name": "kernel_graph_3", "has_data": false, "sub_graph_names": []}, {"count": 7, "graph_name": "kernel_graph_3", "has_data": false, "sub_graph_names": []}]} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/offline_debugger/load_device_info_ascend.json b/tests/st/func/debugger/expect_results/offline_debugger/load_device_info_ascend.json deleted file mode 100644 index 48a0dcbe..00000000 --- a/tests/st/func/debugger/expect_results/offline_debugger/load_device_info_ascend.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "device_target": "Ascend", - "server_list": [ - { - "server_id": "0.0.0.0", - "device": [ - { - "device_id": "0", - "device_ip": "0.0.0.1", - "rank_id": "0" - }, - { - "device_id": "1", - "device_ip": "0.0.0.2", - "rank_id": "1" - } - ], - "host_nic_ip": "reserve" - } - ] -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/offline_debugger/retrieve_aggregation_scope_node.json b/tests/st/func/debugger/expect_results/offline_debugger/retrieve_aggregation_scope_node.json deleted file mode 100644 index 26d6ada1..00000000 --- a/tests/st/func/debugger/expect_results/offline_debugger/retrieve_aggregation_scope_node.json +++ /dev/null @@ -1,708 +0,0 @@ -{ - "graph": { - "nodes": [ - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/fc3.bias", - "type": "Parameter", - "is_dynamic_shape_node": false, - "attr": { - "type": "DT_TENSOR[DT_FLOAT32]", - "shape": "[[10]]" - }, - "input": {}, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1": { - "edge_type": "data" - } - }, - "subnode_count": 0, - "independent_layout": true, - "stack_info": [] - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/moments.fc3.bias", - "type": "Parameter", - "is_dynamic_shape_node": false, - "attr": { - "type": "DT_TENSOR[DT_FLOAT32]", - "shape": "[[10]]" - }, - "input": {}, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1": { - "edge_type": "data" - } - }, - "subnode_count": 0, - "independent_layout": true, - "stack_info": [] - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/learning_rate", - "type": "Parameter", - "is_dynamic_shape_node": false, - "attr": { - "type": "DT_TENSOR[DT_FLOAT32]", - "shape": "[[]]" - }, - "input": {}, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op30": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op33": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op41": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op49": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1": { - "edge_type": "data" - } - }, - "subnode_count": 0, - "independent_layout": true, - "stack_info": [] - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/momentum", - "type": "Parameter", - "is_dynamic_shape_node": false, - "attr": { - "type": "DT_TENSOR[DT_FLOAT32]", - "shape": "[[]]" - }, - "input": {}, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op30": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op33": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op41": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op49": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1": { - "edge_type": "data" - } - }, - "subnode_count": 0, - "independent_layout": true, - "stack_info": [] - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/fc3.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "attr": { - "type": "DT_TENSOR[DT_FLOAT32]", - "shape": "[[10, 84]]" - }, - "input": {}, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1": { - "edge_type": "data" - } - }, - "subnode_count": 0, - "independent_layout": true, - "stack_info": [] - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/moments.fc3.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "attr": { - "type": "DT_TENSOR[DT_FLOAT32]", - "shape": "[[10, 84]]" - }, - "input": {}, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1": { - "edge_type": "data" - } - }, - "subnode_count": 0, - "independent_layout": true, - "stack_info": [] - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/fc2.bias", - "type": "Parameter", - "is_dynamic_shape_node": false, - "attr": { - "type": "DT_TENSOR[DT_FLOAT32]", - "shape": "[[84]]" - }, - "input": {}, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op30": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1": { - "edge_type": "data" - } - }, - "subnode_count": 0, - "independent_layout": true, - "stack_info": [] - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/moments.fc2.bias", - "type": "Parameter", - "is_dynamic_shape_node": false, - "attr": { - "type": "DT_TENSOR[DT_FLOAT32]", - "shape": "[[84]]" - }, - "input": {}, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op30": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1": { - "edge_type": "data" - } - }, - "subnode_count": 0, - "independent_layout": true, - "stack_info": [] - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/fc2.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "attr": { - "type": "DT_TENSOR[DT_FLOAT32]", - "shape": "[[84, 120]]" - }, - "input": {}, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op33": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1": { - "edge_type": "data" - } - }, - "subnode_count": 0, - "independent_layout": true, - "stack_info": [] - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/moments.fc2.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "attr": { - "type": "DT_TENSOR[DT_FLOAT32]", - "shape": "[[84, 120]]" - }, - "input": {}, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op33": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1": { - "edge_type": "data" - } - }, - "subnode_count": 0, - "independent_layout": true, - "stack_info": [] - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/fc1.bias", - "type": "Parameter", - "is_dynamic_shape_node": false, - "attr": { - "type": "DT_TENSOR[DT_FLOAT32]", - "shape": "[[120]]" - }, - "input": {}, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1": { - "edge_type": "data" - } - }, - "subnode_count": 0, - "independent_layout": true, - "stack_info": [] - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/moments.fc1.bias", - "type": "Parameter", - "is_dynamic_shape_node": false, - "attr": { - "type": "DT_TENSOR[DT_FLOAT32]", - "shape": "[[120]]" - }, - "input": {}, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1": { - "edge_type": "data" - } - }, - "subnode_count": 0, - "independent_layout": true, - "stack_info": [] - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/fc1.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "attr": { - "type": "DT_TENSOR[DT_FLOAT32]", - "shape": "[[120, 400]]" - }, - "input": {}, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op41": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1": { - "edge_type": "data" - } - }, - "subnode_count": 0, - "independent_layout": true, - "stack_info": [] - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/moments.fc1.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "attr": { - "type": "DT_TENSOR[DT_FLOAT32]", - "shape": "[[120, 400]]" - }, - "input": {}, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op41": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1": { - "edge_type": "data" - } - }, - "subnode_count": 0, - "independent_layout": true, - "stack_info": [] - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/conv2.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "attr": { - "type": "DT_TENSOR[DT_FLOAT32]", - "shape": "[[16, 6, 5, 5]]" - }, - "input": {}, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op49": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1": { - "edge_type": "data" - } - }, - "subnode_count": 0, - "independent_layout": true, - "stack_info": [] - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/moments.conv2.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "attr": { - "type": "DT_TENSOR[DT_FLOAT32]", - "shape": "[[16, 6, 5, 5]]" - }, - "input": {}, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op49": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1": { - "edge_type": "data" - } - }, - "subnode_count": 0, - "independent_layout": true, - "stack_info": [] - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/conv1.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "attr": { - "type": "DT_TENSOR[DT_FLOAT32]", - "shape": "[[6, 1, 5, 5]]" - }, - "input": {}, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1": { - "edge_type": "data" - } - }, - "subnode_count": 0, - "independent_layout": true, - "stack_info": [] - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/moments.conv1.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "attr": { - "type": "DT_TENSOR[DT_FLOAT32]", - "shape": "[[6, 1, 5, 5]]" - }, - "input": {}, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1": { - "edge_type": "data" - } - }, - "subnode_count": 0, - "independent_layout": true, - "stack_info": [] - } - ] - } -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/offline_debugger/retrieve_all.json b/tests/st/func/debugger/expect_results/offline_debugger/retrieve_all.json deleted file mode 100644 index fa7c8a14..00000000 --- a/tests/st/func/debugger/expect_results/offline_debugger/retrieve_all.json +++ /dev/null @@ -1,575 +0,0 @@ -{ - "metadata": { - "state": "waiting", - "step": 0, - "device_name": "", - "node_name": "", - "backend": "Ascend", - "enable_recheck": false, - "graph_name": "", - "recommendation_confirmed": false, - "debugger_version": {}, - "data_version": {}, - "total_step_num": 3 - }, - "graph": { - "graph_names": [ - "kernel_graph_0" - ], - "nodes": [ - { - "name": "Default", - "type": "name_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output": { - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": { - "shape": [ - [ - 32, - 6, - 4, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": { - "shape": [ - [ - 32, - 16, - 4, - 3 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": { - "shape": [ - [ - 32, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": { - "shape": [ - [ - 32, - 6, - 14, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20": { - "shape": [ - [ - 32, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92": { - "shape": [ - [ - 32, - 1, - 10, - 10, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94": { - "shape": [ - [ - 32, - 1, - 28, - 28, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 7, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "Gradients", - "type": "name_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Default/tuple_getitem[10]_0/tuple_getitem-op210": { - "shape": [ - [ - 32, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op15": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op12": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op205": { - "shape": [ - [ - 32, - 16, - 10, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op206": { - "shape": [ - [ - 32, - 16, - 4, - 3 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op202": { - "shape": [ - [ - 32, - 1, - 10, - 10, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op197": { - "shape": [ - [ - 32, - 6, - 14, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Cast-op188": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op195": { - "shape": [ - [ - 32, - 6, - 28, - 28 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op196": { - "shape": [ - [ - 32, - 6, - 4, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op192": { - "shape": [ - [ - 32, - 1, - 28, - 28, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/flatten-Flatten/Reshape-op9": { - "shape": [ - [ - 32, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op30": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op49": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op33": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op41": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 1, - "independent_layout": false, - "stack_info": [] - } - ] - }, - "devices": [ - { - "rank_id": 0, - "device_id": 0, - "device_ip": "0.0.0.1", - "graph_names": [ - "kernel_graph_0" - ], - "total_step_num": 3 - }, - { - "rank_id": 1, - "device_id": 1, - "device_ip": "0.0.0.2", - "graph_names": [ - "kernel_graph_0" - ], - "total_step_num": 3 - } - ], - "watch_points": [] -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/offline_debugger/retrieve_empty_tensor_history.json b/tests/st/func/debugger/expect_results/offline_debugger/retrieve_empty_tensor_history.json deleted file mode 100644 index 52ab01c8..00000000 --- a/tests/st/func/debugger/expect_results/offline_debugger/retrieve_empty_tensor_history.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "tensor_history": [ - { - "name": "Default/TransData-op99:0", - "full_name": "Default/TransData-op99:0", - "node_type": "TransData", - "type": "output", - "graph_name": "kernel_graph_0" - }, - { - "name": "Default/args0:0", - "full_name": "Default/args0:0", - "node_type": "Parameter", - "type": "input", - "graph_name": "kernel_graph_0" - } - ], - "metadata": { - "step": 1 - } -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/offline_debugger/retrieve_full_tensor_history.json b/tests/st/func/debugger/expect_results/offline_debugger/retrieve_full_tensor_history.json deleted file mode 100644 index 1cc3657e..00000000 --- a/tests/st/func/debugger/expect_results/offline_debugger/retrieve_full_tensor_history.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "tensor_history": [ - { - "name": "Default/TransData-op99:0", - "full_name": "Default/TransData-op99:0", - "node_type": "TransData", - "type": "output", - "graph_name": "kernel_graph_0", - "step": 1, - "dtype": "DT_INT32", - "shape": [ - 2, - 2, - 3 - ], - "bytes": 176, - "tensor_status": "uncached", - "has_prev_step": false, - "value": "click to view" - }, - { - "name": "Default/args0:0", - "full_name": "Default/args0:0", - "node_type": "Parameter", - "type": "input", - "graph_name": "kernel_graph_0", - "step": 1, - "dtype": "DT_INT32", - "shape": [ - 2, - 2, - 3 - ], - "bytes": 176, - "tensor_status": "uncached", - "has_prev_step": true, - "value": "click to view" - } - ], - "metadata": { - "step": 1 - } -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/offline_debugger/retrieve_scope_node.json b/tests/st/func/debugger/expect_results/offline_debugger/retrieve_scope_node.json deleted file mode 100644 index 8736e0cb..00000000 --- a/tests/st/func/debugger/expect_results/offline_debugger/retrieve_scope_node.json +++ /dev/null @@ -1,1185 +0,0 @@ -{ - "graph": { - "nodes": [ - { - "name": "Default/TransData-op99", - "type": "TransData", - "is_dynamic_shape_node": false, - "attr": { - "dst_format": "dtype: DT_STRING\nstr_val: \"NC1HWC0\"\n", - "IsFeatureMapInputList": "dtype: DT_TUPLE\nvalues {\n dtype: DT_UINT64\n uint_val: 0\n}\n", - "pri_format": "dtype: DT_STRING\nstr_val: \"NC1HWC0\"\n", - "_datadump_original_names": "dtype: DT_TUPLE\n", - "IsFeatureMapOutput": "dtype: DT_BOOL\nbool_val: true\n", - "src_format": "dtype: DT_STRING\nstr_val: \"NCHW\"\n" - }, - "input": { - "Default/args0": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output": { - "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 0, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "Default/Depend-op61", - "type": "Depend", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/ReduceMean-op60": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/make_tuple-op58": { - "shape": [ - [], - [], - [], - [], - [], - [], - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL']" - } - }, - "output": { - "Default/make_tuple[9]_3/make_tuple-op284": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 0, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "Default/args0", - "type": "Parameter", - "is_dynamic_shape_node": false, - "attr": { - "type": "DT_TENSOR[DT_FLOAT32]", - "shape": "[[32, 1, 32, 32]]" - }, - "input": {}, - "output": { - "Default/TransData-op99": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 0, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "Default/tuple_getitem[10]_0", - "type": "aggregation_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op87": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op3": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']" - }, - "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op89": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op7": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']" - }, - "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/SoftmaxCrossEntropyWithLogits-op18": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - } - }, - "output": { - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op195": { - "shape": [ - [ - 32, - 6, - 28, - 28 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Conv2D-op5": { - "shape": [ - [ - 32, - 6, - 14, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": { - "shape": [ - [ - 32, - 6, - 14, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op205": { - "shape": [ - [ - 32, - 16, - 10, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op208": { - "shape": [ - [ - 32, - 16, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20": { - "shape": [ - [ - 32, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92": { - "shape": [ - [ - 32, - 1, - 10, - 10, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": { - "shape": [ - [ - 32, - 16, - 4, - 3 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94": { - "shape": [ - [ - 32, - 1, - 28, - 28, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": { - "shape": [ - [ - 32, - 6, - 4, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/ReduceMean-op60": { - "shape": [ - [ - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 20, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "Default/make_tuple[9]_3", - "type": "aggregation_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op250": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op251": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op253": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op254": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op256": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op257": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op259": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op260": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op262": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op263": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op265": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op266": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op268": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op269": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op271": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op272": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/Depend-op61": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output": { - "Default/optimizer-Momentum/Depend[8]_4/Depend-op23": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op26": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op31": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op34": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op39": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op42": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op50": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op57": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 9, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "Default/network-WithLossCell", - "type": "name_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Default/TransData-op99": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op193": { - "shape": [ - [ - 32, - 6, - 28, - 28 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op197": { - "shape": [ - [ - 32, - 6, - 14, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op203": { - "shape": [ - [ - 32, - 16, - 10, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op207": { - "shape": [ - [ - 32, - 16, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op211": { - "shape": [ - [ - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output": { - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op193": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op192": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": { - "shape": [ - [ - 32, - 6, - 28, - 28 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op197": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op196": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op203": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op202": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": { - "shape": [ - [ - 32, - 16, - 10, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op207": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op206": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": { - "shape": [ - [ - 32, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op210": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op211": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/Depend-op61": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 2, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "Default/optimizer-Momentum", - "type": "name_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op65": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op68": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op71": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op74": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op77": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op80": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op83": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op86": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - } - }, - "output": { - "Default/Depend-op61": { - "shape": [ - [], - [], - [], - [], - [], - [], - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL']" - }, - "Default/make_tuple[9]_3/make_tuple-op65": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op68": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op71": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op74": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op77": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op80": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op83": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op86": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 5, - "independent_layout": false, - "stack_info": [] - } - ] - } -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/offline_debugger/retrieve_single_node.json b/tests/st/func/debugger/expect_results/offline_debugger/retrieve_single_node.json deleted file mode 100644 index 701395a6..00000000 --- a/tests/st/func/debugger/expect_results/offline_debugger/retrieve_single_node.json +++ /dev/null @@ -1,1724 +0,0 @@ -{ - "graph": { - "nodes": [ - { - "name": "Default", - "type": "name_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output": { - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": { - "shape": [ - [ - 32, - 6, - 4, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": { - "shape": [ - [ - 32, - 16, - 4, - 3 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": { - "shape": [ - [ - 32, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": { - "shape": [ - [ - 32, - 6, - 14, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20": { - "shape": [ - [ - 32, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92": { - "shape": [ - [ - 32, - 1, - 10, - 10, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94": { - "shape": [ - [ - 32, - 1, - 28, - 28, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 7, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "Gradients", - "type": "name_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Default/tuple_getitem[10]_0/tuple_getitem-op210": { - "shape": [ - [ - 32, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op15": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op12": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op205": { - "shape": [ - [ - 32, - 16, - 10, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op206": { - "shape": [ - [ - 32, - 16, - 4, - 3 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op202": { - "shape": [ - [ - 32, - 1, - 10, - 10, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op197": { - "shape": [ - [ - 32, - 6, - 14, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Cast-op188": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op195": { - "shape": [ - [ - 32, - 6, - 28, - 28 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op196": { - "shape": [ - [ - 32, - 6, - 4, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op192": { - "shape": [ - [ - 32, - 1, - 28, - 28, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/flatten-Flatten/Reshape-op9": { - "shape": [ - [ - 32, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op30": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op49": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op33": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op41": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 1, - "independent_layout": false, - "stack_info": [] - } - ], - "scope_name": "", - "children": { - "nodes": [ - { - "name": "Default/TransData-op99", - "type": "TransData", - "is_dynamic_shape_node": false, - "attr": { - "dst_format": "dtype: DT_STRING\nstr_val: \"NC1HWC0\"\n", - "IsFeatureMapInputList": "dtype: DT_TUPLE\nvalues {\n dtype: DT_UINT64\n uint_val: 0\n}\n", - "pri_format": "dtype: DT_STRING\nstr_val: \"NC1HWC0\"\n", - "_datadump_original_names": "dtype: DT_TUPLE\n", - "IsFeatureMapOutput": "dtype: DT_BOOL\nbool_val: true\n", - "src_format": "dtype: DT_STRING\nstr_val: \"NCHW\"\n" - }, - "input": { - "Default/args0": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output": { - "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 0, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "Default/Depend-op61", - "type": "Depend", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/ReduceMean-op60": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/make_tuple-op58": { - "shape": [ - [], - [], - [], - [], - [], - [], - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL']" - } - }, - "output": { - "Default/make_tuple[9]_3/make_tuple-op284": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 0, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "Default/args0", - "type": "Parameter", - "is_dynamic_shape_node": false, - "attr": { - "type": "DT_TENSOR[DT_FLOAT32]", - "shape": "[[32, 1, 32, 32]]" - }, - "input": {}, - "output": { - "Default/TransData-op99": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 0, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "Default/tuple_getitem[10]_0", - "type": "aggregation_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op87": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op3": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']" - }, - "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op89": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op7": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']" - }, - "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/SoftmaxCrossEntropyWithLogits-op18": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - } - }, - "output": { - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op195": { - "shape": [ - [ - 32, - 6, - 28, - 28 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Conv2D-op5": { - "shape": [ - [ - 32, - 6, - 14, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": { - "shape": [ - [ - 32, - 6, - 14, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op205": { - "shape": [ - [ - 32, - 16, - 10, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op208": { - "shape": [ - [ - 32, - 16, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20": { - "shape": [ - [ - 32, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92": { - "shape": [ - [ - 32, - 1, - 10, - 10, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": { - "shape": [ - [ - 32, - 16, - 4, - 3 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94": { - "shape": [ - [ - 32, - 1, - 28, - 28, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": { - "shape": [ - [ - 32, - 6, - 4, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/ReduceMean-op60": { - "shape": [ - [ - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 20, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "Default/make_tuple[9]_3", - "type": "aggregation_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op250": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op251": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op253": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op254": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op256": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op257": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op259": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op260": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op262": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op263": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op265": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op266": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op268": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op269": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op271": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op272": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/Depend-op61": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output": { - "Default/optimizer-Momentum/Depend[8]_4/Depend-op23": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op26": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op31": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op34": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op39": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op42": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op50": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op57": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 9, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "Default/network-WithLossCell", - "type": "name_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Default/TransData-op99": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op193": { - "shape": [ - [ - 32, - 6, - 28, - 28 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op197": { - "shape": [ - [ - 32, - 6, - 14, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op203": { - "shape": [ - [ - 32, - 16, - 10, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op207": { - "shape": [ - [ - 32, - 16, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op211": { - "shape": [ - [ - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output": { - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op193": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op192": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": { - "shape": [ - [ - 32, - 6, - 28, - 28 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op197": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op196": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op203": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op202": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": { - "shape": [ - [ - 32, - 16, - 10, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op207": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op206": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": { - "shape": [ - [ - 32, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op210": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op211": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/Depend-op61": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 2, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "Default/optimizer-Momentum", - "type": "name_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op65": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op68": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op71": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op74": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op77": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op80": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op83": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op86": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - } - }, - "output": { - "Default/Depend-op61": { - "shape": [ - [], - [], - [], - [], - [], - [], - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL']" - }, - "Default/make_tuple[9]_3/make_tuple-op65": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op68": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op71": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op74": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op77": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op80": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op83": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op86": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 5, - "independent_layout": false, - "stack_info": [] - } - ], - "scope_name": "Default", - "children": {} - } - } -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/offline_debugger/retrieve_tensor_graph-0.json b/tests/st/func/debugger/expect_results/offline_debugger/retrieve_tensor_graph-0.json deleted file mode 100644 index eadc8956..00000000 --- a/tests/st/func/debugger/expect_results/offline_debugger/retrieve_tensor_graph-0.json +++ /dev/null @@ -1,521 +0,0 @@ -{ - "graph": { - "nodes": [ - { - "name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24", - "full_name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul-op24", - "type": "MatMul", - "input": {}, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]", - "slot_mapping": [ - [ - "0", - "" - ] - ] - } - }, - "slots": [ - { - "slot": "0", - "statistics": { - "overall_max": 11.0, - "overall_min": 0.0, - "overall_avg": 5.5, - "overall_count": 12, - "overall_nan_count": 0, - "overall_neg_inf_count": 0, - "overall_pos_inf_count": 0, - "overall_zero_count": 1.0, - "overall_neg_zero_count": 0.0, - "overall_pos_zero_count": 11.0 - }, - "shape": [ - 2, - 2, - 3 - ] - } - ], - "stack_info": [], - "graph_name": "kernel_graph_0" - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/learning_rate", - "full_name": "Default/optimizer-Momentum/Parameter[18]_7/learning_rate", - "type": "Parameter", - "input": {}, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": true, - "data_type": "DT_TENSOR[DT_FLOAT32]", - "slot_mapping": [ - [ - "0", - "" - ] - ] - } - }, - "slots": [ - { - "slot": "0", - "statistics": { - "overall_max": 11.0, - "overall_min": 0.0, - "overall_avg": 5.5, - "overall_count": 12, - "overall_nan_count": 0, - "overall_neg_inf_count": 0, - "overall_pos_inf_count": 0, - "overall_zero_count": 1.0, - "overall_neg_zero_count": 0.0, - "overall_pos_zero_count": 11.0 - }, - "shape": [ - 2, - 2, - 3 - ], - "has_prev_step": true - } - ], - "stack_info": [], - "graph_name": "kernel_graph_0" - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/momentum", - "full_name": "Default/optimizer-Momentum/Parameter[18]_7/momentum", - "type": "Parameter", - "input": {}, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": true, - "data_type": "DT_TENSOR[DT_FLOAT32]", - "slot_mapping": [ - [ - "0", - "" - ] - ] - } - }, - "slots": [ - { - "slot": "0", - "statistics": { - "overall_max": 11.0, - "overall_min": 0.0, - "overall_avg": 5.5, - "overall_count": 12, - "overall_nan_count": 0, - "overall_neg_inf_count": 0, - "overall_pos_inf_count": 0, - "overall_zero_count": 1.0, - "overall_neg_zero_count": 0.0, - "overall_pos_zero_count": 11.0 - }, - "shape": [ - 2, - 2, - 3 - ], - "has_prev_step": true - } - ], - "stack_info": [], - "graph_name": "kernel_graph_0" - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/fc3.weight", - "full_name": "Default/optimizer-Momentum/Parameter[18]_7/fc3.weight", - "type": "Parameter", - "input": {}, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": true, - "data_type": "DT_TENSOR[DT_FLOAT32]", - "slot_mapping": [ - [ - "0", - "" - ] - ] - } - }, - "slots": [ - { - "slot": "0", - "statistics": { - "overall_max": 11.0, - "overall_min": 0.0, - "overall_avg": 5.5, - "overall_count": 12, - "overall_nan_count": 0, - "overall_neg_inf_count": 0, - "overall_pos_inf_count": 0, - "overall_zero_count": 1.0, - "overall_neg_zero_count": 0.0, - "overall_pos_zero_count": 11.0 - }, - "shape": [ - 2, - 2, - 3 - ], - "has_prev_step": true - } - ], - "stack_info": [], - "graph_name": "kernel_graph_0" - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/moments.fc3.weight", - "full_name": "Default/optimizer-Momentum/Parameter[18]_7/moments.fc3.weight", - "type": "Parameter", - "input": {}, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": true, - "data_type": "DT_TENSOR[DT_FLOAT32]", - "slot_mapping": [ - [ - "0", - "" - ] - ] - } - }, - "slots": [ - { - "slot": "0", - "statistics": { - "overall_max": 11.0, - "overall_min": 0.0, - "overall_avg": 5.5, - "overall_count": 12, - "overall_nan_count": 0, - "overall_neg_inf_count": 0, - "overall_pos_inf_count": 0, - "overall_zero_count": 1.0, - "overall_neg_zero_count": 0.0, - "overall_pos_zero_count": 11.0 - }, - "shape": [ - 2, - 2, - 3 - ], - "has_prev_step": true - } - ], - "stack_info": [], - "graph_name": "kernel_graph_0" - }, - { - "name": "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op253", - "full_name": "Default/optimizer-Momentum/tuple_getitem-op253", - "type": "tuple_getitem", - "input": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']", - "slot_mapping": [ - [ - "0", - "" - ], - [ - "1", - "" - ] - ] - } - }, - "output": {}, - "slots": [ - { - "slot": "0", - "statistics": { - "overall_max": 11.0, - "overall_min": 0.0, - "overall_avg": 5.5, - "overall_count": 12, - "overall_nan_count": 0, - "overall_neg_inf_count": 0, - "overall_pos_inf_count": 0, - "overall_zero_count": 1.0, - "overall_neg_zero_count": 0.0, - "overall_pos_zero_count": 11.0 - }, - "shape": [ - 2, - 2, - 3 - ] - } - ], - "stack_info": [], - "graph_name": "kernel_graph_0" - }, - { - "name": "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op254", - "full_name": "Default/optimizer-Momentum/tuple_getitem-op254", - "type": "tuple_getitem", - "input": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']", - "slot_mapping": [ - [ - "0", - "" - ], - [ - "1", - "" - ] - ] - } - }, - "output": {}, - "slots": [ - { - "slot": "0", - "statistics": { - "overall_max": 11.0, - "overall_min": 0.0, - "overall_avg": 5.5, - "overall_count": 12, - "overall_nan_count": 0, - "overall_neg_inf_count": 0, - "overall_pos_inf_count": 0, - "overall_zero_count": 1.0, - "overall_neg_zero_count": 0.0, - "overall_pos_zero_count": 11.0 - }, - "shape": [ - 2, - 2, - 3 - ] - } - ], - "stack_info": [], - "graph_name": "kernel_graph_0" - }, - { - "name": "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25", - "full_name": "Default/optimizer-Momentum/ApplyMomentum-op25", - "type": "ApplyMomentum", - "input": { - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]", - "slot_mapping": [ - [ - "0", - "" - ] - ] - }, - "Default/optimizer-Momentum/Parameter[18]_7/learning_rate": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": true, - "data_type": "DT_TENSOR[DT_FLOAT32]", - "slot_mapping": [ - [ - "0", - "" - ] - ] - }, - "Default/optimizer-Momentum/Parameter[18]_7/momentum": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": true, - "data_type": "DT_TENSOR[DT_FLOAT32]", - "slot_mapping": [ - [ - "0", - "" - ] - ] - }, - "Default/optimizer-Momentum/Parameter[18]_7/fc3.weight": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": true, - "data_type": "DT_TENSOR[DT_FLOAT32]", - "slot_mapping": [ - [ - "0", - "" - ] - ] - }, - "Default/optimizer-Momentum/Parameter[18]_7/moments.fc3.weight": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": true, - "data_type": "DT_TENSOR[DT_FLOAT32]", - "slot_mapping": [ - [ - "0", - "" - ] - ] - } - }, - "output": { - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op253": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']", - "slot_mapping": [ - [ - "0", - "" - ], - [ - "1", - "" - ] - ] - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op254": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']", - "slot_mapping": [ - [ - "0", - "" - ], - [ - "1", - "" - ] - ] - } - }, - "slots": [ - { - "slot": "0", - "statistics": { - "overall_max": 11.0, - "overall_min": 0.0, - "overall_avg": 5.5, - "overall_count": 12, - "overall_nan_count": 0, - "overall_neg_inf_count": 0, - "overall_pos_inf_count": 0, - "overall_zero_count": 1.0, - "overall_neg_zero_count": 0.0, - "overall_pos_zero_count": 11.0 - }, - "shape": [ - 2, - 2, - 3 - ] - }, - { - "slot": "1", - "statistics": { - "overall_max": 11.0, - "overall_min": 0.0, - "overall_avg": 5.5, - "overall_count": 12, - "overall_nan_count": 0, - "overall_neg_inf_count": 0, - "overall_pos_inf_count": 0, - "overall_zero_count": 1.0, - "overall_neg_zero_count": 0.0, - "overall_pos_zero_count": 11.0 - }, - "shape": [ - 2, - 2, - 3 - ] - } - ], - "stack_info": [], - "graph_name": "kernel_graph_0" - } - ] - } -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/offline_debugger/retrieve_tensor_value.json b/tests/st/func/debugger/expect_results/offline_debugger/retrieve_tensor_value.json deleted file mode 100644 index bbc86c9b..00000000 --- a/tests/st/func/debugger/expect_results/offline_debugger/retrieve_tensor_value.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "tensor_value": { - "full_name": "Default/TransData-op99:0", - "step": 1, - "dtype": "DT_INT32", - "shape": [ - 2, - 2, - 3 - ], - "bytes": 176, - "tensor_status": "cached", - "has_prev_step": false, - "value": [ - [ - [ - 0, - 1, - 2 - ], - [ - 3, - 4, - 5 - ] - ], - [ - [ - 6, - 7, - 8 - ], - [ - 9, - 10, - 11 - ] - ] - ], - "statistics": { - "overall_max": 11.0, - "overall_min": 0.0, - "overall_avg": 5.5, - "overall_count": 12, - "overall_nan_count": 0, - "overall_neg_inf_count": 0, - "overall_pos_inf_count": 0, - "overall_zero_count": 1.0, - "overall_neg_zero_count": 0.0, - "overall_pos_zero_count": 11.0 - }, - "name": "Default/TransData-op99:0" - } -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/offline_debugger/search_unwatched_leaf_node.json b/tests/st/func/debugger/expect_results/offline_debugger/search_unwatched_leaf_node.json deleted file mode 100644 index a0b0364a..00000000 --- a/tests/st/func/debugger/expect_results/offline_debugger/search_unwatched_leaf_node.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "nodes": [ - { - "name": "Default", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/optimizer-Momentum", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/optimizer-Momentum/ApplyMomentum[8]_1", - "type": "aggregation_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56", - "type": "ApplyMomentum", - "is_dynamic_shape_node": false, - "nodes": [], - "watched": 2, - "disable": false - } - ], - "watched": 2, - "disable": false - } - ], - "watched": 2, - "disable": false - } - ], - "watched": 2, - "disable": false - } - ] -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/before_train_begin.json b/tests/st/func/debugger/expect_results/restful_results/before_train_begin.json deleted file mode 100644 index 18c52d9c..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/before_train_begin.json +++ /dev/null @@ -1 +0,0 @@ -{"metadata": {"state": "pending", "step": 0, "device_name": "", "ip": "", "node_name": "", "backend": "", "enable_recheck": false, "graph_name": "", "recommendation_confirmed": false, "debugger_version": {}, "data_version": {}}} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/compare_tensors.json b/tests/st/func/debugger/expect_results/restful_results/compare_tensors.json deleted file mode 100644 index e0e222c5..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/compare_tensors.json +++ /dev/null @@ -1 +0,0 @@ -{"tensor_status": "cached", "tensor_value": {"full_name": "Default/args0:0", "step": 3, "dtype": "DT_FLOAT32", "shape": [2, 3], "bytes": 152, "tensor_status": "cached", "diff": [[[1.0, 1.0, 0.0], [2.0, 2.0, 0.0], [3.0, 3.0, 0.0]], [[4.0, 4.0, 0.0], [5.0, 5.0, 0.0], [6.0, 6.0, 0.0]]], "curr_step_statistics": {"overall_max": 6.0, "overall_min": 1.0, "overall_avg": 3.5, "overall_count": 6, "overall_nan_count": 0, "overall_neg_inf_count": 0, "overall_pos_inf_count": 0, "overall_zero_count": 0.0, "overall_neg_zero_count": 0.0, "overall_pos_zero_count": 6.0}, "prev_step_statistics": {"overall_max": 6.0, "overall_min": 1.0, "overall_avg": 3.5, "overall_count": 6, "overall_nan_count": 0, "overall_neg_inf_count": 0, "overall_pos_inf_count": 0, "overall_zero_count": 0.0, "overall_neg_zero_count": 0.0, "overall_pos_zero_count": 6.0}, "statistics": {"overall_max": 0.0, "overall_min": 0.0, "overall_avg": 0.0, "overall_count": 6, "overall_nan_count": 0, "overall_neg_inf_count": 0, "overall_pos_inf_count": 0, "overall_zero_count": 6.0, "overall_neg_zero_count": 0.0, "overall_pos_zero_count": 0.0}}} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/create_and_delete_watchpoint.json b/tests/st/func/debugger/expect_results/restful_results/create_and_delete_watchpoint.json deleted file mode 100644 index 04b242ae..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/create_and_delete_watchpoint.json +++ /dev/null @@ -1 +0,0 @@ -{"watch_points": [{"id": 1, "watch_condition": {"id": "tensor_too_large", "params": [{"name": "max_gt", "value": 1.0}], "abbr": "TL"}}, {"id": 2, "watch_condition": {"id": "tensor_too_small", "params": [{"name": "max_lt", "value": -1.0}], "abbr": "TS"}}, {"id": 3, "watch_condition": {"id": "tensor_too_large", "params": [{"name": "min_gt", "value": 1e+32}], "abbr": "TL"}}, {"id": 5, "watch_condition": {"id": "tensor_too_large", "params": [{"name": "mean_gt", "value": 0}], "abbr": "TL"}}, {"id": 6, "watch_condition": {"id": "tensor_too_small", "params": [{"name": "mean_lt", "value": 0}], "abbr": "TS"}}]} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/get_conditions_for_ascend.json b/tests/st/func/debugger/expect_results/restful_results/get_conditions_for_ascend.json deleted file mode 100644 index af60b0b0..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/get_conditions_for_ascend.json +++ /dev/null @@ -1 +0,0 @@ -[{"id": "tensor_condition_collection", "conditions": [{"id": "operator_overflow", "parameters": [], "supported_target_type": "TENSOR", "abbr": "OO"}, {"id": "tensor_all_zero", "parameters": [{"name": "zero_percentage_ge", "type": "FLOAT64", "support_disable": true, "default_value": 100, "param_type": "CHECK_PARAM", "required_params": null}], "supported_target_type": "TENSOR", "abbr": "TZ"}, {"id": "tensor_overflow", "parameters": [], "supported_target_type": "TENSOR", "abbr": "TO"}, {"id": "tensor_range", "parameters": [{"name": "range_start_inclusive", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "SUPPORT_PARAM", "required_params": null}, {"name": "range_end_inclusive", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "SUPPORT_PARAM", "required_params": null}, {"name": "range_percentage_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": ["range_start_inclusive", "range_end_inclusive"]}, {"name": "range_percentage_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": ["range_start_inclusive", "range_end_inclusive"]}, {"name": "max_min_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "max_min_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}], "supported_target_type": "TENSOR", "abbr": "TR"}, {"id": "tensor_too_large", "parameters": [{"name": "abs_mean_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "max_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "min_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "mean_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}], "supported_target_type": "TENSOR", "abbr": "TL"}, {"id": "tensor_too_small", "parameters": [{"name": "abs_mean_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "max_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "min_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "mean_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}], "supported_target_type": "TENSOR", "abbr": "TS"}]}, {"id": "weight_condition_collection", "conditions": [{"id": "weight_change_too_large", "parameters": [{"name": "abs_mean_update_ratio_gt", "type": "FLOAT64", "support_disable": true, "default_value": 0.1, "param_type": "CHECK_PARAM", "required_params": null}], "supported_target_type": "WEIGHT", "abbr": "WCL"}, {"id": "weight_change_too_small", "parameters": [{"name": "abs_mean_update_ratio_lt", "type": "FLOAT64", "support_disable": true, "default_value": 0.0001, "param_type": "CHECK_PARAM", "required_params": null}], "supported_target_type": "WEIGHT", "abbr": "WCS"}, {"id": "weight_not_changed", "parameters": [{"name": "rtol", "type": "FLOAT64", "support_disable": true, "default_value": 1e-05, "param_type": "CHECK_PARAM", "required_params": null}], "supported_target_type": "WEIGHT", "abbr": "WNC"}, {"id": "weight_overflow", "parameters": [], "supported_target_type": "WEIGHT", "abbr": "WO"}, {"id": "weight_too_large", "parameters": [{"name": "abs_mean_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "max_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "min_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "mean_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}], "supported_target_type": "WEIGHT", "abbr": "WL"}, {"id": "weight_too_small", "parameters": [{"name": "abs_mean_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "max_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "min_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "mean_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}], "supported_target_type": "WEIGHT", "abbr": "WS"}]}, {"id": "activation_condition_collection", "conditions": [{"id": "activation_range", "parameters": [{"name": "range_start_inclusive", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "SUPPORT_PARAM", "required_params": null}, {"name": "range_end_inclusive", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "SUPPORT_PARAM", "required_params": null}, {"name": "range_percentage_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": ["range_start_inclusive", "range_end_inclusive"]}, {"name": "range_percentage_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": ["range_start_inclusive", "range_end_inclusive"]}, {"name": "max_min_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "max_min_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}], "supported_target_type": "ACTIVATION", "abbr": "AR"}]}, {"id": "gradient_condition_collection", "conditions": [{"id": "gradient_exploding", "parameters": [], "supported_target_type": "GRADIENT", "abbr": "GE"}, {"id": "gradient_too_large", "parameters": [{"name": "abs_mean_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "max_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "min_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "mean_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}], "supported_target_type": "GRADIENT", "abbr": "GL"}, {"id": "gradient_vanishing", "parameters": [{"name": "abs_mean_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "max_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "min_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "mean_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}], "supported_target_type": "GRADIENT", "abbr": "GV"}]}] \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/get_conditions_for_gpu.json b/tests/st/func/debugger/expect_results/restful_results/get_conditions_for_gpu.json deleted file mode 100644 index 5254d4cf..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/get_conditions_for_gpu.json +++ /dev/null @@ -1 +0,0 @@ -[{"id": "tensor_condition_collection", "conditions": [{"id": "tensor_all_zero", "parameters": [{"name": "zero_percentage_ge", "type": "FLOAT64", "support_disable": true, "default_value": 100, "param_type": "CHECK_PARAM", "required_params": null}], "supported_target_type": "TENSOR", "abbr": "TZ"}, {"id": "tensor_overflow", "parameters": [], "supported_target_type": "TENSOR", "abbr": "TO"}, {"id": "tensor_range", "parameters": [{"name": "range_start_inclusive", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "SUPPORT_PARAM", "required_params": null}, {"name": "range_end_inclusive", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "SUPPORT_PARAM", "required_params": null}, {"name": "range_percentage_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": ["range_start_inclusive", "range_end_inclusive"]}, {"name": "range_percentage_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": ["range_start_inclusive", "range_end_inclusive"]}, {"name": "max_min_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "max_min_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}], "supported_target_type": "TENSOR", "abbr": "TR"}, {"id": "tensor_too_large", "parameters": [{"name": "abs_mean_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "max_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "min_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "mean_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}], "supported_target_type": "TENSOR", "abbr": "TL"}, {"id": "tensor_too_small", "parameters": [{"name": "abs_mean_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "max_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "min_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "mean_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}], "supported_target_type": "TENSOR", "abbr": "TS"}]}, {"id": "weight_condition_collection", "conditions": [{"id": "weight_change_too_large", "parameters": [{"name": "abs_mean_update_ratio_gt", "type": "FLOAT64", "support_disable": true, "default_value": 0.1, "param_type": "CHECK_PARAM", "required_params": null}], "supported_target_type": "WEIGHT", "abbr": "WCL"}, {"id": "weight_change_too_small", "parameters": [{"name": "abs_mean_update_ratio_lt", "type": "FLOAT64", "support_disable": true, "default_value": 0.0001, "param_type": "CHECK_PARAM", "required_params": null}], "supported_target_type": "WEIGHT", "abbr": "WCS"}, {"id": "weight_not_changed", "parameters": [{"name": "rtol", "type": "FLOAT64", "support_disable": true, "default_value": 1e-05, "param_type": "CHECK_PARAM", "required_params": null}], "supported_target_type": "WEIGHT", "abbr": "WNC"}, {"id": "weight_overflow", "parameters": [], "supported_target_type": "WEIGHT", "abbr": "WO"}, {"id": "weight_too_large", "parameters": [{"name": "abs_mean_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "max_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "min_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "mean_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}], "supported_target_type": "WEIGHT", "abbr": "WL"}, {"id": "weight_too_small", "parameters": [{"name": "abs_mean_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "max_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "min_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "mean_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}], "supported_target_type": "WEIGHT", "abbr": "WS"}]}, {"id": "activation_condition_collection", "conditions": [{"id": "activation_range", "parameters": [{"name": "range_start_inclusive", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "SUPPORT_PARAM", "required_params": null}, {"name": "range_end_inclusive", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "SUPPORT_PARAM", "required_params": null}, {"name": "range_percentage_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": ["range_start_inclusive", "range_end_inclusive"]}, {"name": "range_percentage_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": ["range_start_inclusive", "range_end_inclusive"]}, {"name": "max_min_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "max_min_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}], "supported_target_type": "ACTIVATION", "abbr": "AR"}]}, {"id": "gradient_condition_collection", "conditions": [{"id": "gradient_exploding", "parameters": [], "supported_target_type": "GRADIENT", "abbr": "GE"}, {"id": "gradient_too_large", "parameters": [{"name": "abs_mean_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "max_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "min_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "mean_gt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}], "supported_target_type": "GRADIENT", "abbr": "GL"}, {"id": "gradient_vanishing", "parameters": [{"name": "abs_mean_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "max_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "min_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}, {"name": "mean_lt", "type": "FLOAT64", "support_disable": true, "default_value": null, "param_type": "CHECK_PARAM", "required_params": null}], "supported_target_type": "GRADIENT", "abbr": "GV"}]}] \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/multi_next_node.json b/tests/st/func/debugger/expect_results/restful_results/multi_next_node.json deleted file mode 100644 index f6273052..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/multi_next_node.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "metadata": { - "state": "waiting", - "step": 1, - "device_name": "0", - "node_name": "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/OneHot-op0", - "backend": "GPU", - "enable_recheck": false, - "graph_name": "graph_1", - "recommendation_confirmed": false, - "debugger_version": {}, - "data_version": {} - }, - "graph": { - "graph_names": [ - "graph_0", - "graph_1" - ], - "nodes": [ - { - "name": "graph_0", - "type": "name_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": {}, - "output": {}, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 2, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "graph_1", - "type": "name_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": {}, - "output": {}, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 2, - "independent_layout": false, - "stack_info": [] - } - ] - }, - "devices": [ - { - "rank_id": 0, - "device_id": "0", - "graph_names": [ - "graph_0", - "graph_1" - ] - } - ], - "watch_points": [] -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/multi_retrieve_aggregation_scope_node.json b/tests/st/func/debugger/expect_results/restful_results/multi_retrieve_aggregation_scope_node.json deleted file mode 100644 index 6d27d590..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/multi_retrieve_aggregation_scope_node.json +++ /dev/null @@ -1 +0,0 @@ -{"graph": {"nodes": [{"name": "graph_0/Default/optimizer-Momentum/Parameter[18]_7/fc3.bias", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[10]]"}, "input": {}, "output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "graph_0/Default/optimizer-Momentum/Parameter[18]_7/moments.fc3.bias", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[10]]"}, "input": {}, "output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "graph_0/Default/optimizer-Momentum/Parameter[18]_7/learning_rate", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[]]"}, "input": {}, "output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op30": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op33": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op41": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op49": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "graph_0/Default/optimizer-Momentum/Parameter[18]_7/momentum", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[]]"}, "input": {}, "output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op30": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op33": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op41": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op49": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "graph_0/Default/optimizer-Momentum/Parameter[18]_7/fc3.weight", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[10, 84]]"}, "input": {}, "output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "graph_0/Default/optimizer-Momentum/Parameter[18]_7/moments.fc3.weight", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[10, 84]]"}, "input": {}, "output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "graph_0/Default/optimizer-Momentum/Parameter[18]_7/fc2.bias", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[84]]"}, "input": {}, "output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op30": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "graph_0/Default/optimizer-Momentum/Parameter[18]_7/moments.fc2.bias", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[84]]"}, "input": {}, "output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op30": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "graph_0/Default/optimizer-Momentum/Parameter[18]_7/fc2.weight", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[84, 120]]"}, "input": {}, "output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op33": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "graph_0/Default/optimizer-Momentum/Parameter[18]_7/moments.fc2.weight", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[84, 120]]"}, "input": {}, "output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op33": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "graph_0/Default/optimizer-Momentum/Parameter[18]_7/fc1.bias", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[120]]"}, "input": {}, "output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "graph_0/Default/optimizer-Momentum/Parameter[18]_7/moments.fc1.bias", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[120]]"}, "input": {}, "output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "graph_0/Default/optimizer-Momentum/Parameter[18]_7/fc1.weight", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[120, 400]]"}, "input": {}, "output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op41": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "graph_0/Default/optimizer-Momentum/Parameter[18]_7/moments.fc1.weight", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[120, 400]]"}, "input": {}, "output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op41": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "graph_0/Default/optimizer-Momentum/Parameter[18]_7/conv2.weight", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[16, 6, 5, 5]]"}, "input": {}, "output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op49": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "graph_0/Default/optimizer-Momentum/Parameter[18]_7/moments.conv2.weight", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[16, 6, 5, 5]]"}, "input": {}, "output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op49": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "graph_0/Default/optimizer-Momentum/Parameter[18]_7/conv1.weight", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[6, 1, 5, 5]]"}, "input": {}, "output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "graph_0/Default/optimizer-Momentum/Parameter[18]_7/moments.conv1.weight", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[6, 1, 5, 5]]"}, "input": {}, "output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}]}} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/multi_retrieve_all.json b/tests/st/func/debugger/expect_results/restful_results/multi_retrieve_all.json deleted file mode 100644 index 7af03e94..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/multi_retrieve_all.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "metadata": { - "state": "waiting", - "step": 1, - "device_name": "0", - "node_name": "", - "backend": "Ascend", - "enable_recheck": false, - "graph_name": "", - "recommendation_confirmed": false, - "debugger_version": {}, - "data_version": {} - }, - "graph": { - "graph_names": [ - "graph_0", - "graph_1" - ], - "nodes": [ - { - "name": "graph_0", - "type": "name_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": {}, - "output": {}, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 2, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "graph_1", - "type": "name_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": {}, - "output": {}, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 2, - "independent_layout": false, - "stack_info": [] - } - ] - }, - "devices": [ - { - "rank_id": 0, - "device_id": "0", - "graph_names": [ - "graph_0", - "graph_1" - ] - } - ], - "watch_points": [] -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/multi_retrieve_scope_node.json b/tests/st/func/debugger/expect_results/restful_results/multi_retrieve_scope_node.json deleted file mode 100644 index 1a71d0aa..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/multi_retrieve_scope_node.json +++ /dev/null @@ -1 +0,0 @@ -{"graph": {"nodes": [{"name": "graph_0/Default", "type": "name_scope", "is_dynamic_shape_node": false, "attr": {}, "input": {"graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": {"shape": [[32, 6, 4, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": {"shape": [[32, 16, 4, 3]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[32, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20": {"shape": [[32, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92": {"shape": [[32, 1, 10, 10, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94": {"shape": [[32, 1, 28, 28, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 7, "independent_layout": false, "stack_info": []}, {"name": "graph_0/Gradients", "type": "name_scope", "is_dynamic_shape_node": false, "attr": {}, "input": {"graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op210": {"shape": [[32, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op15": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op12": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op205": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op206": {"shape": [[32, 16, 4, 3]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op202": {"shape": [[32, 1, 10, 10, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op197": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Cast-op188": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op195": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op196": {"shape": [[32, 6, 4, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op192": {"shape": [[32, 1, 28, 28, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "graph_0/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/network-WithLossCell/_backbone-LeNet5/flatten-Flatten/Reshape-op9": {"shape": [[32, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op30": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op49": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op33": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op41": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 1, "independent_layout": false, "stack_info": []}]}} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/multi_retrieve_single_node.json b/tests/st/func/debugger/expect_results/restful_results/multi_retrieve_single_node.json deleted file mode 100644 index e66d41ae..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/multi_retrieve_single_node.json +++ /dev/null @@ -1 +0,0 @@ -{"graph": {"nodes": [{"name": "graph_0", "type": "name_scope", "is_dynamic_shape_node": false, "attr": {}, "input": {}, "output": {}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 2, "independent_layout": false, "stack_info": []}, {"name": "graph_1", "type": "name_scope", "is_dynamic_shape_node": false, "attr": {}, "input": {}, "output": {}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 2, "independent_layout": false, "stack_info": []}], "scope_name": "", "children": {"nodes": [{"name": "graph_0/Default", "type": "name_scope", "is_dynamic_shape_node": false, "attr": {}, "input": {"graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": {"shape": [[32, 6, 4, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": {"shape": [[32, 16, 4, 3]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[32, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20": {"shape": [[32, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92": {"shape": [[32, 1, 10, 10, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94": {"shape": [[32, 1, 28, 28, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 7, "independent_layout": false, "stack_info": []}, {"name": "graph_0/Gradients", "type": "name_scope", "is_dynamic_shape_node": false, "attr": {}, "input": {"graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op210": {"shape": [[32, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op15": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op12": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op205": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op206": {"shape": [[32, 16, 4, 3]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op202": {"shape": [[32, 1, 10, 10, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op197": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Cast-op188": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op195": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op196": {"shape": [[32, 6, 4, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op192": {"shape": [[32, 1, 28, 28, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "graph_0/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/network-WithLossCell/_backbone-LeNet5/flatten-Flatten/Reshape-op9": {"shape": [[32, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op30": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op49": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op33": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op41": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 1, "independent_layout": false, "stack_info": []}], "scope_name": "graph_0", "children": {"nodes": [{"name": "graph_0/Default/TransData-op99", "type": "TransData", "is_dynamic_shape_node": false, "attr": {"dst_format": "dtype: DT_STRING\nstr_val: \"NC1HWC0\"\n", "IsFeatureMapInputList": "dtype: DT_TUPLE\nvalues {\n dtype: DT_UINT64\n uint_val: 0\n}\n", "pri_format": "dtype: DT_STRING\nstr_val: \"NC1HWC0\"\n", "_datadump_original_names": "dtype: DT_TUPLE\n", "IsFeatureMapOutput": "dtype: DT_BOOL\nbool_val: true\n", "src_format": "dtype: DT_STRING\nstr_val: \"NCHW\"\n"}, "input": {"graph_0/Default/args0": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"graph_0/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false, "stack_info": []}, {"name": "graph_0/Default/Depend-op61", "type": "Depend", "is_dynamic_shape_node": false, "attr": {}, "input": {"graph_0/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/ReduceMean-op60": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/make_tuple-op58": {"shape": [[], [], [], [], [], [], [], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL']"}}, "output": {"graph_0/Default/make_tuple[9]_3/make_tuple-op284": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false, "stack_info": []}, {"name": "graph_0/Default/args0", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[32, 1, 32, 32]]"}, "input": {}, "output": {"graph_0/Default/TransData-op99": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false, "stack_info": []}, {"name": "graph_0/Default/tuple_getitem[10]_0", "type": "aggregation_scope", "is_dynamic_shape_node": false, "attr": {}, "input": {"graph_0/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op87": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "graph_0/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op3": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "graph_0/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op89": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "graph_0/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op7": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "graph_0/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/SoftmaxCrossEntropyWithLogits-op18": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}}, "output": {"graph_0/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op195": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Conv2D-op5": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op205": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op208": {"shape": [[32, 16, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20": {"shape": [[32, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92": {"shape": [[32, 1, 10, 10, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": {"shape": [[32, 16, 4, 3]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94": {"shape": [[32, 1, 28, 28, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": {"shape": [[32, 6, 4, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "graph_0/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/ReduceMean-op60": {"shape": [[32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 20, "independent_layout": false, "stack_info": []}, {"name": "graph_0/Default/make_tuple[9]_3", "type": "aggregation_scope", "is_dynamic_shape_node": false, "attr": {}, "input": {"graph_0/Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op250": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op251": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op253": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op254": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op256": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op257": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op259": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op260": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op262": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op263": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op265": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op266": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op268": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op269": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op271": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op272": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/Depend-op61": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"graph_0/Default/optimizer-Momentum/Depend[8]_4/Depend-op23": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "graph_0/Default/optimizer-Momentum/Depend[8]_4/Depend-op26": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "graph_0/Default/optimizer-Momentum/Depend[8]_4/Depend-op31": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "graph_0/Default/optimizer-Momentum/Depend[8]_4/Depend-op34": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "graph_0/Default/optimizer-Momentum/Depend[8]_4/Depend-op39": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "graph_0/Default/optimizer-Momentum/Depend[8]_4/Depend-op42": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "graph_0/Default/optimizer-Momentum/Depend[8]_4/Depend-op50": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "graph_0/Default/optimizer-Momentum/Depend[8]_4/Depend-op57": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 9, "independent_layout": false, "stack_info": []}, {"name": "graph_0/Default/network-WithLossCell", "type": "name_scope", "is_dynamic_shape_node": false, "attr": {}, "input": {"graph_0/Default/TransData-op99": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op193": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op197": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op203": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op207": {"shape": [[32, 16, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op211": {"shape": [[32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op193": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op192": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op197": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op196": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op203": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op202": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op207": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op206": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[32, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op210": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "graph_0/Default/tuple_getitem[10]_0/tuple_getitem-op211": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "graph_0/Default/Depend-op61": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 2, "independent_layout": false, "stack_info": []}, {"name": "graph_0/Default/optimizer-Momentum", "type": "name_scope", "is_dynamic_shape_node": false, "attr": {}, "input": {"graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/make_tuple[9]_3/make_tuple-op65": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "graph_0/Default/make_tuple[9]_3/make_tuple-op68": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "graph_0/Default/make_tuple[9]_3/make_tuple-op71": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "graph_0/Default/make_tuple[9]_3/make_tuple-op74": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "graph_0/Default/make_tuple[9]_3/make_tuple-op77": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "graph_0/Default/make_tuple[9]_3/make_tuple-op80": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "graph_0/Default/make_tuple[9]_3/make_tuple-op83": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "graph_0/Default/make_tuple[9]_3/make_tuple-op86": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}}, "output": {"graph_0/Default/Depend-op61": {"shape": [[], [], [], [], [], [], [], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL']"}, "graph_0/Default/make_tuple[9]_3/make_tuple-op65": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/make_tuple[9]_3/make_tuple-op68": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/make_tuple[9]_3/make_tuple-op71": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/make_tuple[9]_3/make_tuple-op74": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/make_tuple[9]_3/make_tuple-op77": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/make_tuple[9]_3/make_tuple-op80": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/make_tuple[9]_3/make_tuple-op83": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "graph_0/Default/make_tuple[9]_3/make_tuple-op86": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 5, "independent_layout": false, "stack_info": []}], "scope_name": "graph_0/Default", "children": {}}}}} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/multi_retrieve_watchpoint.json b/tests/st/func/debugger/expect_results/restful_results/multi_retrieve_watchpoint.json deleted file mode 100644 index 4aacd042..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/multi_retrieve_watchpoint.json +++ /dev/null @@ -1 +0,0 @@ -{"watch_points": [{"id": 1, "watch_condition": {"id": "overflow", "params": [], "abbr": "OVERFLOW"}}]} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/multi_run_steps.json b/tests/st/func/debugger/expect_results/restful_results/multi_run_steps.json deleted file mode 100644 index 53978469..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/multi_run_steps.json +++ /dev/null @@ -1 +0,0 @@ -{"metadata": {"state": "waiting", "step": 2, "device_name": "0", "node_name": "", "backend": "GPU", "enable_recheck": false, "graph_name": ""}, "graph": {"graph_names": ["graph_0", "graph_1"], "nodes": [{"name": "graph_0", "type": "name_scope", "is_dynamic_shape_node": false, "attr": {}, "input": {}, "output": {}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 2, "independent_layout": false}, {"name": "graph_1", "type": "name_scope", "is_dynamic_shape_node": false, "attr": {}, "input": {}, "output": {}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 2, "independent_layout": false}]}, "watch_points": [{"id": 1, "watch_condition": {"id": "weight_initialization", "params": [{"name": "zero_percentage_ge", "disable": false, "value": 100}], "abbr": "WI"}}, {"id": 2, "watch_condition": {"id": "weight_change_too_large", "params": [{"name": "abs_mean_update_ratio_gt", "disable": false, "value": 0.1}], "abbr": "WCL"}}, {"id": 3, "watch_condition": {"id": "gradient_vanishing", "params": [{"name": "abs_mean_lt", "disable": false, "value": 1e-09}], "abbr": "GV"}}, {"id": 4, "watch_condition": {"id": "tensor_overflow", "params": [], "abbr": "TO"}}, {"id": 5, "watch_condition": {"id": "tensor_all_zero", "params": [{"name": "zero_percentage_ge", "disable": false, "value": 100}], "abbr": "TZ"}}]} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/recommended_watchpoints_at_startup.json b/tests/st/func/debugger/expect_results/restful_results/recommended_watchpoints_at_startup.json deleted file mode 100644 index 955fdc6c..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/recommended_watchpoints_at_startup.json +++ /dev/null @@ -1 +0,0 @@ -{"watch_points": []} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/retrieve_aggregation_scope_node.json b/tests/st/func/debugger/expect_results/restful_results/retrieve_aggregation_scope_node.json deleted file mode 100644 index 6a80f663..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/retrieve_aggregation_scope_node.json +++ /dev/null @@ -1 +0,0 @@ -{"graph": {"nodes": [{"name": "Default/optimizer-Momentum/Parameter[18]_7/fc3.bias", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[10]]"}, "input": {}, "output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "Default/optimizer-Momentum/Parameter[18]_7/moments.fc3.bias", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[10]]"}, "input": {}, "output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "Default/optimizer-Momentum/Parameter[18]_7/learning_rate", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[]]"}, "input": {}, "output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op30": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op33": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op41": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op49": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "Default/optimizer-Momentum/Parameter[18]_7/momentum", "is_dynamic_shape_node": false, "type": "Parameter", "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[]]"}, "input": {}, "output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op30": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op33": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op41": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op49": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "Default/optimizer-Momentum/Parameter[18]_7/fc3.weight", "is_dynamic_shape_node": false, "type": "Parameter", "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[10, 84]]"}, "input": {}, "output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "Default/optimizer-Momentum/Parameter[18]_7/moments.fc3.weight", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[10, 84]]"}, "input": {}, "output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "Default/optimizer-Momentum/Parameter[18]_7/fc2.bias", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[84]]"}, "input": {}, "output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op30": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "Default/optimizer-Momentum/Parameter[18]_7/moments.fc2.bias", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[84]]"}, "input": {}, "output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op30": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "Default/optimizer-Momentum/Parameter[18]_7/fc2.weight", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[84, 120]]"}, "input": {}, "output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op33": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "Default/optimizer-Momentum/Parameter[18]_7/moments.fc2.weight", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[84, 120]]"}, "input": {}, "output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op33": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "Default/optimizer-Momentum/Parameter[18]_7/fc1.bias", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[120]]"}, "input": {}, "output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "Default/optimizer-Momentum/Parameter[18]_7/moments.fc1.bias", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[120]]"}, "input": {}, "output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "Default/optimizer-Momentum/Parameter[18]_7/fc1.weight", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[120, 400]]"}, "input": {}, "output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op41": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "Default/optimizer-Momentum/Parameter[18]_7/moments.fc1.weight", "is_dynamic_shape_node": false, "type": "Parameter", "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[120, 400]]"}, "input": {}, "output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op41": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "Default/optimizer-Momentum/Parameter[18]_7/conv2.weight", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[16, 6, 5, 5]]"}, "input": {}, "output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op49": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "Default/optimizer-Momentum/Parameter[18]_7/moments.conv2.weight", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[16, 6, 5, 5]]"}, "input": {}, "output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op49": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "Default/optimizer-Momentum/Parameter[18]_7/conv1.weight", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[6, 1, 5, 5]]"}, "input": {}, "output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}, {"name": "Default/optimizer-Momentum/Parameter[18]_7/moments.conv1.weight", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[6, 1, 5, 5]]"}, "input": {}, "output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1": {"edge_type": "data"}}, "subnode_count": 0, "independent_layout": true, "stack_info": []}]}} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/retrieve_all.json b/tests/st/func/debugger/expect_results/restful_results/retrieve_all.json deleted file mode 100644 index 6e6679e6..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/retrieve_all.json +++ /dev/null @@ -1,563 +0,0 @@ -{ - "metadata": { - "state": "waiting", - "step": 1, - "device_name": "0", - "node_name": "", - "backend": "Ascend", - "enable_recheck": false, - "graph_name": "graph_0", - "recommendation_confirmed": false, - "debugger_version": {}, - "data_version": {} - }, - "graph": { - "graph_names": [ - "graph_0" - ], - "nodes": [ - { - "name": "Default", - "type": "name_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output": { - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": { - "shape": [ - [ - 32, - 6, - 4, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": { - "shape": [ - [ - 32, - 16, - 4, - 3 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": { - "shape": [ - [ - 32, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": { - "shape": [ - [ - 32, - 6, - 14, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20": { - "shape": [ - [ - 32, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92": { - "shape": [ - [ - 32, - 1, - 10, - 10, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94": { - "shape": [ - [ - 32, - 1, - 28, - 28, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 7, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "Gradients", - "type": "name_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Default/tuple_getitem[10]_0/tuple_getitem-op210": { - "shape": [ - [ - 32, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op15": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op12": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op205": { - "shape": [ - [ - 32, - 16, - 10, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op206": { - "shape": [ - [ - 32, - 16, - 4, - 3 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op202": { - "shape": [ - [ - 32, - 1, - 10, - 10, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op197": { - "shape": [ - [ - 32, - 6, - 14, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Cast-op188": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op195": { - "shape": [ - [ - 32, - 6, - 28, - 28 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op196": { - "shape": [ - [ - 32, - 6, - 4, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op192": { - "shape": [ - [ - 32, - 1, - 28, - 28, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/flatten-Flatten/Reshape-op9": { - "shape": [ - [ - 32, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op30": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op49": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op33": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op41": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 1, - "independent_layout": false, - "stack_info": [] - } - ] - }, - "devices": [ - { - "rank_id": 0, - "device_id": "0", - "graph_names": [ - "graph_0" - ] - } - ], - "watch_points": [] -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/retrieve_empty_tensor_history.json b/tests/st/func/debugger/expect_results/restful_results/retrieve_empty_tensor_history.json deleted file mode 100644 index 68cb8c92..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/retrieve_empty_tensor_history.json +++ /dev/null @@ -1 +0,0 @@ -{"tensor_history": [{"name": "Default/TransData-op99:0", "full_name": "Default/TransData-op99:0", "node_type": "TransData", "type": "output", "graph_name": "graph_0"}, {"name": "Default/args0:0", "full_name": "Default/args0:0", "node_type": "Parameter", "type": "input", "graph_name": "graph_0"}], "metadata": {"step": 1}} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/retrieve_empty_watchpoint_hit_list b/tests/st/func/debugger/expect_results/restful_results/retrieve_empty_watchpoint_hit_list deleted file mode 100644 index 32e1ef11..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/retrieve_empty_watchpoint_hit_list +++ /dev/null @@ -1 +0,0 @@ -{"watch_point_hits": [], "outdated": false} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/retrieve_full_tensor_history.json b/tests/st/func/debugger/expect_results/restful_results/retrieve_full_tensor_history.json deleted file mode 100644 index 29ceb865..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/retrieve_full_tensor_history.json +++ /dev/null @@ -1 +0,0 @@ -{"tensor_history": [{"name": "Default/TransData-op99:0", "full_name": "Default/TransData-op99:0", "node_type": "TransData", "type": "output", "graph_name": "graph_0", "step": 1, "dtype": "DT_FLOAT32", "shape": [2, 3], "bytes": 152, "tensor_status": "uncached", "has_prev_step": false, "value": "click to view"}, {"name": "Default/args0:0", "full_name": "Default/args0:0", "node_type": "Parameter", "type": "input", "graph_name": "graph_0", "step": 1, "dtype": "DT_FLOAT32", "shape": [2, 3], "bytes": 152, "tensor_status": "uncached", "has_prev_step": true, "value": "click to view"}], "metadata": {"step": 1}} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/retrieve_next_node_on_gpu.json b/tests/st/func/debugger/expect_results/restful_results/retrieve_next_node_on_gpu.json deleted file mode 100644 index 1b543c50..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/retrieve_next_node_on_gpu.json +++ /dev/null @@ -1,563 +0,0 @@ -{ - "metadata": { - "state": "waiting", - "step": 1, - "device_name": "0", - "node_name": "Default/TransData-op99", - "backend": "GPU", - "enable_recheck": false, - "graph_name": "graph_0", - "recommendation_confirmed": false, - "debugger_version": {}, - "data_version": {} - }, - "graph": { - "graph_names": [ - "graph_0" - ], - "nodes": [ - { - "name": "Default", - "type": "name_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output": { - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": { - "shape": [ - [ - 32, - 6, - 4, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": { - "shape": [ - [ - 32, - 16, - 4, - 3 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": { - "shape": [ - [ - 32, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": { - "shape": [ - [ - 32, - 6, - 14, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20": { - "shape": [ - [ - 32, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92": { - "shape": [ - [ - 32, - 1, - 10, - 10, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94": { - "shape": [ - [ - 32, - 1, - 28, - 28, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 7, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "Gradients", - "type": "name_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Default/tuple_getitem[10]_0/tuple_getitem-op210": { - "shape": [ - [ - 32, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op15": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op12": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op205": { - "shape": [ - [ - 32, - 16, - 10, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op206": { - "shape": [ - [ - 32, - 16, - 4, - 3 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op202": { - "shape": [ - [ - 32, - 1, - 10, - 10, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op197": { - "shape": [ - [ - 32, - 6, - 14, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Cast-op188": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op195": { - "shape": [ - [ - 32, - 6, - 28, - 28 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op196": { - "shape": [ - [ - 32, - 6, - 4, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op192": { - "shape": [ - [ - 32, - 1, - 28, - 28, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/flatten-Flatten/Reshape-op9": { - "shape": [ - [ - 32, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op30": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op49": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op33": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op41": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 1, - "independent_layout": false, - "stack_info": [] - } - ] - }, - "devices": [ - { - "rank_id": 0, - "device_id": "0", - "graph_names": [ - "graph_0" - ] - } - ], - "watch_points": [] -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/retrieve_node_by_bfs.json b/tests/st/func/debugger/expect_results/restful_results/retrieve_node_by_bfs.json deleted file mode 100644 index c0cb69ba..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/retrieve_node_by_bfs.json +++ /dev/null @@ -1 +0,0 @@ -{"name": "Default/tuple_getitem[10]_0/tuple_getitem-op192", "graph": {"nodes": [{"name": "Default", "type": "name_scope", "is_dynamic_shape_node": false, "attr": {}, "input": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": {"shape": [[32, 6, 4, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": {"shape": [[32, 16, 4, 3]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[32, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20": {"shape": [[32, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92": {"shape": [[32, 1, 10, 10, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94": {"shape": [[32, 1, 28, 28, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 7, "independent_layout": false}, {"name": "Gradients", "type": "name_scope", "is_dynamic_shape_node": false, "attr": {}, "input": {"Default/tuple_getitem[10]_0/tuple_getitem-op210": {"shape": [[32, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op15": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op12": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op205": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op206": {"shape": [[32, 16, 4, 3]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op202": {"shape": [[32, 1, 10, 10, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op197": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Cast-op188": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op195": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op196": {"shape": [[32, 6, 4, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op192": {"shape": [[32, 1, 28, 28, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/flatten-Flatten/Reshape-op9": {"shape": [[32, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op30": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op49": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op33": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op41": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 1, "independent_layout": false}], "scope_name": "", "children": {"nodes": [{"name": "Default/TransData-op99", "type": "TransData", "is_dynamic_shape_node": false, "attr": {"dst_format": "dtype: DT_STRING\nstr_val: \"NC1HWC0\"\n", "IsFeatureMapInputList": "dtype: DT_TUPLE\nvalues {\n dtype: DT_UINT64\n uint_val: 0\n}\n", "pri_format": "dtype: DT_STRING\nstr_val: \"NC1HWC0\"\n", "_datadump_original_names": "dtype: DT_TUPLE\n", "IsFeatureMapOutput": "dtype: DT_BOOL\nbool_val: true\n", "src_format": "dtype: DT_STRING\nstr_val: \"NCHW\"\n"}, "input": {"Default/args0": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/Depend-op61", "type": "Depend", "is_dynamic_shape_node": false, "attr": {}, "input": {"Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/ReduceMean-op60": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/make_tuple-op58": {"shape": [[], [], [], [], [], [], [], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL']"}}, "output": {"Default/make_tuple[9]_3/make_tuple-op284": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/args0", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[32, 1, 32, 32]]"}, "input": {}, "output": {"Default/TransData-op99": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/tuple_getitem[10]_0", "type": "aggregation_scope", "is_dynamic_shape_node": false, "attr": {}, "input": {"Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op87": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op3": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op89": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op7": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/SoftmaxCrossEntropyWithLogits-op18": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}}, "output": {"Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op195": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Conv2D-op5": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op205": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op208": {"shape": [[32, 16, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20": {"shape": [[32, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92": {"shape": [[32, 1, 10, 10, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": {"shape": [[32, 16, 4, 3]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94": {"shape": [[32, 1, 28, 28, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": {"shape": [[32, 6, 4, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/ReduceMean-op60": {"shape": [[32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 20, "independent_layout": false}, {"name": "Default/make_tuple[9]_3", "type": "aggregation_scope", "is_dynamic_shape_node": false, "attr": {}, "input": {"Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op250": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op251": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op253": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op254": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op256": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op257": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op259": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op260": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op262": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op263": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op265": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op266": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op268": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op269": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op271": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op272": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/Depend-op61": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Default/optimizer-Momentum/Depend[8]_4/Depend-op23": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op26": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op31": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op34": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op39": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op42": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op50": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op57": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 9, "independent_layout": false}, {"name": "Default/network-WithLossCell", "type": "name_scope", "is_dynamic_shape_node": false, "attr": {}, "input": {"Default/TransData-op99": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op193": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op197": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op203": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op207": {"shape": [[32, 16, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op211": {"shape": [[32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op193": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op192": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op197": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op196": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op203": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op202": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op207": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op206": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[32, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op210": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op211": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/Depend-op61": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 2, "independent_layout": false}, {"name": "Default/optimizer-Momentum", "type": "name_scope", "is_dynamic_shape_node": false, "attr": {}, "input": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op65": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op68": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op71": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op74": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op77": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op80": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op83": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op86": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}}, "output": {"Default/Depend-op61": {"shape": [[], [], [], [], [], [], [], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL']"}, "Default/make_tuple[9]_3/make_tuple-op65": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op68": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op71": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op74": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op77": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op80": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op83": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op86": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 5, "independent_layout": false}], "scope_name": "Default", "children": {"nodes": [{"name": "Default/tuple_getitem[10]_0/tuple_getitem-op193", "type": "tuple_getitem", "is_dynamic_shape_node": false, "attr": {}, "input": {"Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op87": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/tuple_getitem[10]_0/cst3": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": ""}}, "output": {"Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op195": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/tuple_getitem[10]_0/tuple_getitem-op197", "type": "tuple_getitem", "is_dynamic_shape_node": false, "attr": {}, "input": {"Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op3": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/tuple_getitem[10]_0/cst4": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": ""}}, "output": {"Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Conv2D-op5": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/tuple_getitem[10]_0/tuple_getitem-op203", "type": "tuple_getitem", "is_dynamic_shape_node": false, "attr": {}, "input": {"Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op89": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/tuple_getitem[10]_0/cst5": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": ""}}, "output": {"Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op205": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/tuple_getitem[10]_0/tuple_getitem-op207", "type": "tuple_getitem", "is_dynamic_shape_node": false, "attr": {}, "input": {"Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op7": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/tuple_getitem[10]_0/cst6": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": ""}}, "output": {"Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op208": {"shape": [[32, 16, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/tuple_getitem[10]_0/tuple_getitem-op210", "type": "tuple_getitem", "is_dynamic_shape_node": false, "attr": {}, "input": {"Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/SoftmaxCrossEntropyWithLogits-op18": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/tuple_getitem[10]_0/cst7": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": ""}}, "output": {"Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20": {"shape": [[32, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/tuple_getitem[10]_0/tuple_getitem-op202", "type": "tuple_getitem", "is_dynamic_shape_node": false, "attr": {}, "input": {"Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op89": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/tuple_getitem[10]_0/cst27": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": ""}}, "output": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92": {"shape": [[32, 1, 10, 10, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/tuple_getitem[10]_0/tuple_getitem-op206", "type": "tuple_getitem", "is_dynamic_shape_node": false, "attr": {}, "input": {"Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op7": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/tuple_getitem[10]_0/cst28": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": ""}}, "output": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": {"shape": [[32, 16, 4, 3]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/tuple_getitem[10]_0/tuple_getitem-op192", "type": "tuple_getitem", "is_dynamic_shape_node": false, "attr": {}, "input": {"Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op87": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/tuple_getitem[10]_0/cst32": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": ""}}, "output": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94": {"shape": [[32, 1, 28, 28, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/tuple_getitem[10]_0/tuple_getitem-op196", "type": "tuple_getitem", "is_dynamic_shape_node": false, "attr": {}, "input": {"Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op3": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/tuple_getitem[10]_0/cst33": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": ""}}, "output": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": {"shape": [[32, 6, 4, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/tuple_getitem[10]_0/tuple_getitem-op211", "type": "tuple_getitem", "is_dynamic_shape_node": false, "attr": {}, "input": {"Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/SoftmaxCrossEntropyWithLogits-op18": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/tuple_getitem[10]_0/cst37": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": ""}}, "output": {"Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/ReduceMean-op60": {"shape": [[32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/tuple_getitem[10]_0/cst3", "type": "Const", "is_dynamic_shape_node": false, "attr": {"cst3": "dtype: DT_INT32\nint_val: 0\n"}, "input": {}, "output": {"Default/tuple_getitem[10]_0/tuple_getitem-op193": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": ""}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/tuple_getitem[10]_0/cst4", "type": "Const", "is_dynamic_shape_node": false, "attr": {"cst4": "dtype: DT_INT32\nint_val: 0\n"}, "input": {}, "output": {"Default/tuple_getitem[10]_0/tuple_getitem-op197": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": ""}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/tuple_getitem[10]_0/cst5", "type": "Const", "is_dynamic_shape_node": false, "attr": {"cst5": "dtype: DT_INT32\nint_val: 0\n"}, "input": {}, "output": {"Default/tuple_getitem[10]_0/tuple_getitem-op203": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": ""}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/tuple_getitem[10]_0/cst6", "type": "Const", "is_dynamic_shape_node": false, "attr": {"cst6": "dtype: DT_INT32\nint_val: 0\n"}, "input": {}, "output": {"Default/tuple_getitem[10]_0/tuple_getitem-op207": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": ""}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/tuple_getitem[10]_0/cst7", "type": "Const", "is_dynamic_shape_node": false, "attr": {"cst7": "dtype: DT_INT32\nint_val: 1\n"}, "input": {}, "output": {"Default/tuple_getitem[10]_0/tuple_getitem-op210": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": ""}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/tuple_getitem[10]_0/cst27", "type": "Const", "is_dynamic_shape_node": false, "attr": {"cst27": "dtype: DT_INT32\nint_val: 1\n"}, "input": {}, "output": {"Default/tuple_getitem[10]_0/tuple_getitem-op202": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": ""}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/tuple_getitem[10]_0/cst28", "type": "Const", "is_dynamic_shape_node": false, "attr": {"cst28": "dtype: DT_INT32\nint_val: 1\n"}, "input": {}, "output": {"Default/tuple_getitem[10]_0/tuple_getitem-op206": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": ""}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/tuple_getitem[10]_0/cst32", "type": "Const", "is_dynamic_shape_node": false, "attr": {"cst32": "dtype: DT_INT32\nint_val: 1\n"}, "input": {}, "output": {"Default/tuple_getitem[10]_0/tuple_getitem-op192": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": ""}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/tuple_getitem[10]_0/cst33", "type": "Const", "is_dynamic_shape_node": false, "attr": {"cst33": "dtype: DT_INT32\nint_val: 1\n"}, "input": {}, "output": {"Default/tuple_getitem[10]_0/tuple_getitem-op196": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": ""}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}, {"name": "Default/tuple_getitem[10]_0/cst37", "type": "Const", "is_dynamic_shape_node": false, "attr": {"cst37": "dtype: DT_INT32\nint_val: 0\n"}, "input": {}, "output": {"Default/tuple_getitem[10]_0/tuple_getitem-op211": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": ""}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false}], "scope_name": "Default/tuple_getitem[10]_0", "children": {}}}}} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/retrieve_node_by_bfs_ascend.json b/tests/st/func/debugger/expect_results/restful_results/retrieve_node_by_bfs_ascend.json deleted file mode 100644 index 9e26dfee..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/retrieve_node_by_bfs_ascend.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/retrieve_scope_node.json b/tests/st/func/debugger/expect_results/restful_results/retrieve_scope_node.json deleted file mode 100644 index 2f329e4d..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/retrieve_scope_node.json +++ /dev/null @@ -1 +0,0 @@ -{"graph": {"nodes": [{"name": "Default/TransData-op99", "type": "TransData", "is_dynamic_shape_node": false, "attr": {"dst_format": "dtype: DT_STRING\nstr_val: \"NC1HWC0\"\n", "IsFeatureMapInputList": "dtype: DT_TUPLE\nvalues {\n dtype: DT_UINT64\n uint_val: 0\n}\n", "pri_format": "dtype: DT_STRING\nstr_val: \"NC1HWC0\"\n", "_datadump_original_names": "dtype: DT_TUPLE\n", "IsFeatureMapOutput": "dtype: DT_BOOL\nbool_val: true\n", "src_format": "dtype: DT_STRING\nstr_val: \"NCHW\"\n"}, "input": {"Default/args0": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false, "stack_info": []}, {"name": "Default/Depend-op61", "type": "Depend", "is_dynamic_shape_node": false, "attr": {}, "input": {"Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/ReduceMean-op60": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/make_tuple-op58": {"shape": [[], [], [], [], [], [], [], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL']"}}, "output": {"Default/make_tuple[9]_3/make_tuple-op284": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false, "stack_info": []}, {"name": "Default/args0", "type": "Parameter", "is_dynamic_shape_node": false, "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[32, 1, 32, 32]]"}, "input": {}, "output": {"Default/TransData-op99": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false, "stack_info": []}, {"name": "Default/tuple_getitem[10]_0", "type": "aggregation_scope", "is_dynamic_shape_node": false, "attr": {}, "input": {"Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op87": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op3": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op89": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op7": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/SoftmaxCrossEntropyWithLogits-op18": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}}, "output": {"Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op195": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Conv2D-op5": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op205": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op208": {"shape": [[32, 16, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20": {"shape": [[32, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92": {"shape": [[32, 1, 10, 10, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": {"shape": [[32, 16, 4, 3]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94": {"shape": [[32, 1, 28, 28, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": {"shape": [[32, 6, 4, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/ReduceMean-op60": {"shape": [[32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 20, "independent_layout": false, "stack_info": []}, {"name": "Default/make_tuple[9]_3", "type": "aggregation_scope", "is_dynamic_shape_node": false, "attr": {}, "input": {"Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op250": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op251": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op253": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op254": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op256": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op257": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op259": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op260": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op262": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op263": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op265": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op266": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op268": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op269": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op271": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op272": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/Depend-op61": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Default/optimizer-Momentum/Depend[8]_4/Depend-op23": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op26": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op31": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op34": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op39": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op42": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op50": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op57": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 9, "independent_layout": false, "stack_info": []}, {"name": "Default/network-WithLossCell", "type": "name_scope", "is_dynamic_shape_node": false, "attr": {}, "input": {"Default/TransData-op99": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op193": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op197": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op203": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op207": {"shape": [[32, 16, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op211": {"shape": [[32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op193": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op192": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op197": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op196": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op203": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op202": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op207": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op206": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[32, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op210": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op211": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/Depend-op61": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 2, "independent_layout": false, "stack_info": []}, {"name": "Default/optimizer-Momentum", "type": "name_scope", "is_dynamic_shape_node": false, "attr": {}, "input": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op65": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op68": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op71": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op74": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op77": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op80": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op83": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op86": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}}, "output": {"Default/Depend-op61": {"shape": [[], [], [], [], [], [], [], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL']"}, "Default/make_tuple[9]_3/make_tuple-op65": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op68": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op71": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op74": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op77": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op80": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op83": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op86": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 5, "independent_layout": false, "stack_info": []}]}} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/retrieve_single_node.json b/tests/st/func/debugger/expect_results/restful_results/retrieve_single_node.json deleted file mode 100644 index 701395a6..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/retrieve_single_node.json +++ /dev/null @@ -1,1724 +0,0 @@ -{ - "graph": { - "nodes": [ - { - "name": "Default", - "type": "name_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output": { - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": { - "shape": [ - [ - 32, - 6, - 4, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": { - "shape": [ - [ - 32, - 16, - 4, - 3 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": { - "shape": [ - [ - 32, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": { - "shape": [ - [ - 32, - 6, - 14, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20": { - "shape": [ - [ - 32, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92": { - "shape": [ - [ - 32, - 1, - 10, - 10, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94": { - "shape": [ - [ - 32, - 1, - 28, - 28, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 7, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "Gradients", - "type": "name_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Default/tuple_getitem[10]_0/tuple_getitem-op210": { - "shape": [ - [ - 32, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op15": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op12": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op205": { - "shape": [ - [ - 32, - 16, - 10, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op206": { - "shape": [ - [ - 32, - 16, - 4, - 3 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op202": { - "shape": [ - [ - 32, - 1, - 10, - 10, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op197": { - "shape": [ - [ - 32, - 6, - 14, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Cast-op188": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op195": { - "shape": [ - [ - 32, - 6, - 28, - 28 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op196": { - "shape": [ - [ - 32, - 6, - 4, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op192": { - "shape": [ - [ - 32, - 1, - 28, - 28, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/flatten-Flatten/Reshape-op9": { - "shape": [ - [ - 32, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op30": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op49": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op33": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op41": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 1, - "independent_layout": false, - "stack_info": [] - } - ], - "scope_name": "", - "children": { - "nodes": [ - { - "name": "Default/TransData-op99", - "type": "TransData", - "is_dynamic_shape_node": false, - "attr": { - "dst_format": "dtype: DT_STRING\nstr_val: \"NC1HWC0\"\n", - "IsFeatureMapInputList": "dtype: DT_TUPLE\nvalues {\n dtype: DT_UINT64\n uint_val: 0\n}\n", - "pri_format": "dtype: DT_STRING\nstr_val: \"NC1HWC0\"\n", - "_datadump_original_names": "dtype: DT_TUPLE\n", - "IsFeatureMapOutput": "dtype: DT_BOOL\nbool_val: true\n", - "src_format": "dtype: DT_STRING\nstr_val: \"NCHW\"\n" - }, - "input": { - "Default/args0": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output": { - "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 0, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "Default/Depend-op61", - "type": "Depend", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/ReduceMean-op60": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/make_tuple-op58": { - "shape": [ - [], - [], - [], - [], - [], - [], - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL']" - } - }, - "output": { - "Default/make_tuple[9]_3/make_tuple-op284": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 0, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "Default/args0", - "type": "Parameter", - "is_dynamic_shape_node": false, - "attr": { - "type": "DT_TENSOR[DT_FLOAT32]", - "shape": "[[32, 1, 32, 32]]" - }, - "input": {}, - "output": { - "Default/TransData-op99": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 0, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "Default/tuple_getitem[10]_0", - "type": "aggregation_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op87": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op3": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']" - }, - "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op89": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op7": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']" - }, - "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/SoftmaxCrossEntropyWithLogits-op18": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - } - }, - "output": { - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op195": { - "shape": [ - [ - 32, - 6, - 28, - 28 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Conv2D-op5": { - "shape": [ - [ - 32, - 6, - 14, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": { - "shape": [ - [ - 32, - 6, - 14, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op205": { - "shape": [ - [ - 32, - 16, - 10, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op208": { - "shape": [ - [ - 32, - 16, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20": { - "shape": [ - [ - 32, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92": { - "shape": [ - [ - 32, - 1, - 10, - 10, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": { - "shape": [ - [ - 32, - 16, - 4, - 3 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94": { - "shape": [ - [ - 32, - 1, - 28, - 28, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": { - "shape": [ - [ - 32, - 6, - 4, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/ReduceMean-op60": { - "shape": [ - [ - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 20, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "Default/make_tuple[9]_3", - "type": "aggregation_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op250": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op251": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op253": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op254": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op256": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op257": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op259": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op260": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op262": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op263": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op265": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op266": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op268": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op269": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op271": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op272": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/Depend-op61": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output": { - "Default/optimizer-Momentum/Depend[8]_4/Depend-op23": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op26": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op31": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op34": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op39": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op42": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op50": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op57": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 9, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "Default/network-WithLossCell", - "type": "name_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Default/TransData-op99": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op193": { - "shape": [ - [ - 32, - 6, - 28, - 28 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op197": { - "shape": [ - [ - 32, - 6, - 14, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op203": { - "shape": [ - [ - 32, - 16, - 10, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op207": { - "shape": [ - [ - 32, - 16, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op211": { - "shape": [ - [ - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output": { - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op193": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op192": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": { - "shape": [ - [ - 32, - 6, - 28, - 28 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op197": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op196": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op203": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op202": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": { - "shape": [ - [ - 32, - 16, - 10, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op207": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op206": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": { - "shape": [ - [ - 32, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op210": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op211": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/Depend-op61": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 2, - "independent_layout": false, - "stack_info": [] - }, - { - "name": "Default/optimizer-Momentum", - "type": "name_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op65": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op68": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op71": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op74": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op77": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op80": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op83": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op86": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - } - }, - "output": { - "Default/Depend-op61": { - "shape": [ - [], - [], - [], - [], - [], - [], - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL']" - }, - "Default/make_tuple[9]_3/make_tuple-op65": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op68": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op71": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op74": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op77": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op80": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op83": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op86": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 5, - "independent_layout": false, - "stack_info": [] - } - ], - "scope_name": "Default", - "children": {} - } - } -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/retrieve_single_watchpoint_hit.json b/tests/st/func/debugger/expect_results/restful_results/retrieve_single_watchpoint_hit.json deleted file mode 100644 index 4f8bae7c..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/retrieve_single_watchpoint_hit.json +++ /dev/null @@ -1,1754 +0,0 @@ -{ - "tensor_history": [ - { - "name": "Default/TransData-op99:0", - "full_name": "Default/TransData-op99:0", - "node_type": "TransData", - "type": "output", - "graph_name": "graph_0", - "is_hit": true - }, - { - "name": "Default/args0:0", - "full_name": "Default/args0:0", - "node_type": "Parameter", - "type": "input", - "graph_name": "graph_0", - "is_hit": false - } - ], - "metadata": { - "step": 2 - }, - "graph": { - "nodes": [ - { - "name": "Default", - "type": "name_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output": { - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": { - "shape": [ - [ - 32, - 6, - 4, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": { - "shape": [ - [ - 32, - 16, - 4, - 3 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": { - "shape": [ - [ - 32, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": { - "shape": [ - [ - 32, - 6, - 14, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20": { - "shape": [ - [ - 32, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92": { - "shape": [ - [ - 32, - 1, - 10, - 10, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94": { - "shape": [ - [ - 32, - 1, - 28, - 28, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 7, - "independent_layout": false, - "watched": 2, - "disable": false - }, - { - "name": "Gradients", - "type": "name_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Default/tuple_getitem[10]_0/tuple_getitem-op210": { - "shape": [ - [ - 32, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op15": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op12": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op205": { - "shape": [ - [ - 32, - 16, - 10, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op206": { - "shape": [ - [ - 32, - 16, - 4, - 3 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op202": { - "shape": [ - [ - 32, - 1, - 10, - 10, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op197": { - "shape": [ - [ - 32, - 6, - 14, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Cast-op188": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op195": { - "shape": [ - [ - 32, - 6, - 28, - 28 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op196": { - "shape": [ - [ - 32, - 6, - 4, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op192": { - "shape": [ - [ - 32, - 1, - 28, - 28, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/flatten-Flatten/Reshape-op9": { - "shape": [ - [ - 32, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op30": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op49": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op33": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op41": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 1, - "independent_layout": false, - "watched": 2, - "disable": false - } - ], - "scope_name": "", - "children": { - "nodes": [ - { - "name": "Default/TransData-op99", - "type": "TransData", - "is_dynamic_shape_node": false, - "attr": { - "dst_format": "dtype: DT_STRING\nstr_val: \"NC1HWC0\"\n", - "IsFeatureMapInputList": "dtype: DT_TUPLE\nvalues {\n dtype: DT_UINT64\n uint_val: 0\n}\n", - "pri_format": "dtype: DT_STRING\nstr_val: \"NC1HWC0\"\n", - "_datadump_original_names": "dtype: DT_TUPLE\n", - "IsFeatureMapOutput": "dtype: DT_BOOL\nbool_val: true\n", - "src_format": "dtype: DT_STRING\nstr_val: \"NCHW\"\n" - }, - "input": { - "Default/args0": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output": { - "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 0, - "independent_layout": false, - "watched": 2, - "disable": false - }, - { - "name": "Default/Depend-op61", - "type": "Depend", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/ReduceMean-op60": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/make_tuple-op58": { - "shape": [ - [], - [], - [], - [], - [], - [], - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL']" - } - }, - "output": { - "Default/make_tuple[9]_3/make_tuple-op284": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 0, - "independent_layout": false, - "watched": 2, - "disable": false - }, - { - "name": "Default/args0", - "type": "Parameter", - "is_dynamic_shape_node": false, - "attr": { - "type": "DT_TENSOR[DT_FLOAT32]", - "shape": "[[32, 1, 32, 32]]" - }, - "input": {}, - "output": { - "Default/TransData-op99": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 0, - "independent_layout": false, - "watched": 2, - "disable": false - }, - { - "name": "Default/tuple_getitem[10]_0", - "type": "aggregation_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op87": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op3": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']" - }, - "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op89": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op7": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']" - }, - "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/SoftmaxCrossEntropyWithLogits-op18": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - } - }, - "output": { - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op195": { - "shape": [ - [ - 32, - 6, - 28, - 28 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Conv2D-op5": { - "shape": [ - [ - 32, - 6, - 14, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": { - "shape": [ - [ - 32, - 6, - 14, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op205": { - "shape": [ - [ - 32, - 16, - 10, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op208": { - "shape": [ - [ - 32, - 16, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20": { - "shape": [ - [ - 32, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92": { - "shape": [ - [ - 32, - 1, - 10, - 10, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": { - "shape": [ - [ - 32, - 16, - 4, - 3 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94": { - "shape": [ - [ - 32, - 1, - 28, - 28, - 2 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT8]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": { - "shape": [ - [ - 32, - 6, - 4, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_UINT16]" - }, - "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/ReduceMean-op60": { - "shape": [ - [ - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 20, - "independent_layout": false, - "watched": 2, - "disable": false - }, - { - "name": "Default/make_tuple[9]_3", - "type": "aggregation_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op250": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op251": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op253": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op254": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op256": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op257": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op259": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op260": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op262": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op263": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op265": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op266": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op268": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op269": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op271": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op272": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/Depend-op61": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output": { - "Default/optimizer-Momentum/Depend[8]_4/Depend-op23": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op26": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op31": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op34": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op39": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op42": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op50": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/optimizer-Momentum/Depend[8]_4/Depend-op57": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 9, - "independent_layout": false, - "watched": 2, - "disable": false - }, - { - "name": "Default/network-WithLossCell", - "type": "name_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Default/TransData-op99": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op193": { - "shape": [ - [ - 32, - 6, - 28, - 28 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op197": { - "shape": [ - [ - 32, - 6, - 14, - 14 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op203": { - "shape": [ - [ - 32, - 16, - 10, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op207": { - "shape": [ - [ - 32, - 16, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op211": { - "shape": [ - [ - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output": { - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op193": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op192": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": { - "shape": [ - [ - 32, - 6, - 28, - 28 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op197": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op196": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op203": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op202": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": { - "shape": [ - [ - 32, - 16, - 10, - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op207": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op206": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": { - "shape": [ - [ - 32, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": { - "shape": [ - [ - 32, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": { - "shape": [ - [ - 32, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op210": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/tuple_getitem[10]_0/tuple_getitem-op211": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/Depend-op61": { - "shape": [ - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 2, - "independent_layout": false, - "watched": 2, - "disable": false - }, - { - "name": "Default/optimizer-Momentum", - "type": "name_scope", - "is_dynamic_shape_node": false, - "attr": {}, - "input": { - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op65": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op68": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op71": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op74": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op77": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op80": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op83": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - }, - "Default/make_tuple[9]_3/make_tuple-op86": { - "shape": [ - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']" - } - }, - "output": { - "Default/Depend-op61": { - "shape": [ - [], - [], - [], - [], - [], - [], - [], - [] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TUPLE['DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL']" - }, - "Default/make_tuple[9]_3/make_tuple-op65": { - "shape": [ - [ - 10 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op68": { - "shape": [ - [ - 10, - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op71": { - "shape": [ - [ - 84 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op74": { - "shape": [ - [ - 84, - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op77": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op80": { - "shape": [ - [ - 120, - 400 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op83": { - "shape": [ - [ - 16, - 6, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - }, - "Default/make_tuple[9]_3/make_tuple-op86": { - "shape": [ - [ - 6, - 1, - 5, - 5 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]" - } - }, - "output_i": 0, - "proxy_input": {}, - "proxy_output": {}, - "subnode_count": 5, - "independent_layout": false, - "watched": 2, - "disable": false - } - ], - "scope_name": "Default", - "children": {} - } - } -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/retrieve_tensor_graph-0.json b/tests/st/func/debugger/expect_results/restful_results/retrieve_tensor_graph-0.json deleted file mode 100644 index 3a93143f..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/retrieve_tensor_graph-0.json +++ /dev/null @@ -1,195 +0,0 @@ -{ - "graph": { - "nodes": [ - { - "name": "Default/args0", - "full_name": "Default/args0", - "type": "Parameter", - "input": {}, - "output": { - "Default/TransData-op99": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]", - "slot_mapping": [ - [ - "0", - "" - ] - ] - } - }, - "slots": [ - { - "slot": "0", - "statistics": { - "overall_max": 6.0, - "overall_min": 1.0, - "overall_avg": 3.5, - "overall_count": 6, - "overall_nan_count": 0, - "overall_neg_inf_count": 0, - "overall_pos_inf_count": 0, - "overall_zero_count": 0.0, - "overall_neg_zero_count": 0.0, - "overall_pos_zero_count": 6.0 - }, - "shape": [ - 2, - 3 - ], - "has_prev_step": true - } - ], - "stack_info": [], - "graph_name": "graph_0" - }, - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190", - "full_name": "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190", - "type": "Cast", - "input": { - "Default/TransData-op99": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]", - "slot_mapping": [ - [ - "0", - "" - ] - ] - } - }, - "output": {}, - "slots": [ - { - "slot": "0", - "statistics": { - "overall_max": 6.0, - "overall_min": 1.0, - "overall_avg": 3.5, - "overall_count": 6, - "overall_nan_count": 0, - "overall_neg_inf_count": 0, - "overall_pos_inf_count": 0, - "overall_zero_count": 0.0, - "overall_neg_zero_count": 0.0, - "overall_pos_zero_count": 6.0 - }, - "shape": [ - 2, - 3 - ] - } - ], - "stack_info": [], - "graph_name": "graph_0" - }, - { - "name": "Default/TransData-op99", - "full_name": "Default/TransData-op99", - "type": "TransData", - "input": { - "Default/args0": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]", - "slot_mapping": [ - [ - "0", - "" - ] - ] - } - }, - "output": { - "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190": { - "shape": [ - [ - 32, - 1, - 32, - 32 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]", - "slot_mapping": [ - [ - "0", - "" - ] - ] - } - }, - "slots": [ - { - "slot": "0", - "watch_points": [ - { - "id": 1, - "watch_condition": { - "id": "tensor_too_large", - "params": [ - { - "name": "max_gt", - "value": 1.0, - "actual_value": null - } - ], - "abbr": "TL" - }, - "error_code": 0, - "error_list": [] - } - ], - "statistics": { - "overall_max": 6.0, - "overall_min": 1.0, - "overall_avg": 3.5, - "overall_count": 6, - "overall_nan_count": 0, - "overall_neg_inf_count": 0, - "overall_pos_inf_count": 0, - "overall_zero_count": 0.0, - "overall_neg_zero_count": 0.0, - "overall_pos_zero_count": 6.0 - }, - "shape": [ - 2, - 3 - ] - } - ], - "stack_info": [], - "graph_name": "graph_0" - } - ] - } -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/retrieve_tensor_graph-1.json b/tests/st/func/debugger/expect_results/restful_results/retrieve_tensor_graph-1.json deleted file mode 100644 index 5520384c..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/retrieve_tensor_graph-1.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "graph": { - "nodes": [ - { - "name": "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38", - "full_name": "Default/optimizer-Momentum/ApplyMomentum-op38", - "type": "ApplyMomentum", - "input": { - "Default/optimizer-Momentum/Parameter[18]_7/moments.fc1.bias": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]", - "slot_mapping": [ - [ - "0", - "" - ] - ] - } - }, - "output": {}, - "slots": [ - { - "slot": "0", - "statistics": { - "overall_max": 6.0, - "overall_min": 1.0, - "overall_avg": 3.5, - "overall_count": 6, - "overall_nan_count": 0, - "overall_neg_inf_count": 0, - "overall_pos_inf_count": 0, - "overall_zero_count": 0.0, - "overall_neg_zero_count": 0.0, - "overall_pos_zero_count": 6.0 - }, - "shape": [ - 2, - 3 - ] - }, - { - "slot": "1", - "statistics": { - "overall_max": 6.0, - "overall_min": 1.0, - "overall_avg": 3.5, - "overall_count": 6, - "overall_nan_count": 0, - "overall_neg_inf_count": 0, - "overall_pos_inf_count": 0, - "overall_zero_count": 0.0, - "overall_neg_zero_count": 0.0, - "overall_pos_zero_count": 6.0 - }, - "shape": [ - 2, - 3 - ] - } - ], - "stack_info": [], - "graph_name": "graph_0" - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/moments.fc1.bias", - "full_name": "Default/optimizer-Momentum/Parameter[18]_7/moments.fc1.bias", - "type": "Parameter", - "input": {}, - "output": { - "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": { - "shape": [ - [ - 120 - ] - ], - "edge_type": "data", - "independent_layout": false, - "data_type": "DT_TENSOR[DT_FLOAT32]", - "slot_mapping": [ - [ - "0", - "" - ] - ] - } - }, - "slots": [ - { - "slot": "0", - "statistics": { - "overall_max": 6.0, - "overall_min": 1.0, - "overall_avg": 3.5, - "overall_count": 6, - "overall_nan_count": 0, - "overall_neg_inf_count": 0, - "overall_pos_inf_count": 0, - "overall_zero_count": 0.0, - "overall_neg_zero_count": 0.0, - "overall_pos_zero_count": 6.0 - }, - "shape": [ - 2, - 3 - ], - "has_prev_step": true - } - ], - "stack_info": [], - "graph_name": "graph_0" - } - ] - } -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/retrieve_tensor_hits-0.json b/tests/st/func/debugger/expect_results/restful_results/retrieve_tensor_hits-0.json deleted file mode 100644 index 955fdc6c..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/retrieve_tensor_hits-0.json +++ /dev/null @@ -1 +0,0 @@ -{"watch_points": []} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/retrieve_tensor_hits-1.json b/tests/st/func/debugger/expect_results/restful_results/retrieve_tensor_hits-1.json deleted file mode 100644 index 955fdc6c..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/retrieve_tensor_hits-1.json +++ /dev/null @@ -1 +0,0 @@ -{"watch_points": []} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/retrieve_tensor_value.json b/tests/st/func/debugger/expect_results/restful_results/retrieve_tensor_value.json deleted file mode 100644 index 2b164be9..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/retrieve_tensor_value.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "tensor_value": { - "full_name": "Default/TransData-op99:0", - "step": 1, - "dtype": "DT_FLOAT32", - "shape": [ - 2, - 3 - ], - "bytes": 152, - "tensor_status": "cached", - "has_prev_step": false, - "value": [ - 5.0, - 6.0 - ], - "statistics": { - "overall_max": 6.0, - "overall_min": 1.0, - "overall_avg": 3.5, - "overall_count": 6, - "overall_nan_count": 0, - "overall_neg_inf_count": 0, - "overall_pos_inf_count": 0, - "overall_zero_count": 0.0, - "overall_neg_zero_count": 0.0, - "overall_pos_zero_count": 6.0 - }, - "name": "Default/TransData-op99:0" - } -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/retrieve_watchpoint_hit.json b/tests/st/func/debugger/expect_results/restful_results/retrieve_watchpoint_hit.json deleted file mode 100644 index 287f4526..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/retrieve_watchpoint_hit.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "watch_point_hits": [ - { - "node_name": "Default/TransData-op99", - "tensors": [ - { - "slot": "0", - "watch_points": [ - { - "id": 1, - "watch_condition": { - "id": "tensor_too_large", - "params": [ - { - "name": "max_gt", - "value": 1.0, - "actual_value": null - } - ], - "abbr": "TL" - }, - "error_code": 0, - "error_list": [] - } - ] - } - ], - "graph_name": "graph_0" - }, - { - "node_name": "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25", - "tensors": [ - { - "slot": "0", - "watch_points": [ - { - "id": 1, - "watch_condition": { - "id": "tensor_too_large", - "params": [ - { - "name": "max_gt", - "value": 1.0, - "actual_value": null - } - ], - "abbr": "TL" - }, - "error_code": 0, - "error_list": [] - } - ] - } - ], - "graph_name": "graph_0" - } - ], - "outdated": false -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/search_activation.json b/tests/st/func/debugger/expect_results/restful_results/search_activation.json deleted file mode 100644 index 6aa09a3d..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/search_activation.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "nodes": [ - { - "name": "Default", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell/_backbone-LeNet5", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op87", - "type": "ReLUV2", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op89", - "type": "ReLUV2", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op12", - "type": "ReLU", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op15", - "type": "ReLU", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/search_activation_multi_graph.json b/tests/st/func/debugger/expect_results/restful_results/search_activation_multi_graph.json deleted file mode 100644 index 7336bdf3..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/search_activation_multi_graph.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "nodes": [ - { - "name": "graph_0", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Default", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Default/network-WithLossCell", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Default/network-WithLossCell/_backbone-LeNet5", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op87", - "type": "ReLUV2", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op89", - "type": "ReLUV2", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op12", - "type": "ReLU", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op15", - "type": "ReLU", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "name": "graph_1", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Default", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Default/network-WithLossCell", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Default/network-WithLossCell/_backbone-LeNet5", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op87", - "type": "ReLUV2", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op89", - "type": "ReLUV2", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op12", - "type": "ReLU", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op15", - "type": "ReLU", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/search_gradient.json b/tests/st/func/debugger/expect_results/restful_results/search_gradient.json deleted file mode 100644 index 2244a9d3..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/search_gradient.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "nodes": [ - { - "name": "Gradients", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Gradients/Default", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Gradients/Default/network-WithLossCell", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21", - "type": "BiasAddGrad", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29", - "type": "BiasAddGrad", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37", - "type": "BiasAddGrad", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - }, - { - "name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5", - "type": "aggregation_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24", - "type": "MatMul", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op27", - "type": "MatMul", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32", - "type": "MatMul", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op35", - "type": "MatMul", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40", - "type": "MatMul", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op44", - "type": "MatMul", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/search_gradient_multi_graph.json b/tests/st/func/debugger/expect_results/restful_results/search_gradient_multi_graph.json deleted file mode 100644 index b7bbc051..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/search_gradient_multi_graph.json +++ /dev/null @@ -1,610 +0,0 @@ -{ - "nodes": [ - { - "name": "graph_0", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Gradients", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Gradients/Default", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Gradients/Default/network-WithLossCell", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20", - "type": "Mul", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21", - "type": "BiasAddGrad", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29", - "type": "BiasAddGrad", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37", - "type": "BiasAddGrad", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5", - "type": "aggregation_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24", - "type": "MatMul", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op27", - "type": "MatMul", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32", - "type": "MatMul", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op35", - "type": "MatMul", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40", - "type": "MatMul", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op44", - "type": "MatMul", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - } - ] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28", - "type": "ReluGrad", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36", - "type": "ReluGrad", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92", - "type": "ReluGradV2", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94", - "type": "ReluGradV2", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/flatten-Flatten", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/flatten-Flatten/gradReshape", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/flatten-Flatten/gradReshape/Reshape-op45", - "type": "Reshape", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/flatten-Flatten/gradReshape/TransData-op148", - "type": "TransData", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/Cast-op232", - "type": "Cast", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46", - "type": "MaxPoolGradWithArgmax", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/Cast-op234", - "type": "Cast", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53", - "type": "MaxPoolGradWithArgmax", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/Cast-op245", - "type": "Cast", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Cast-op235", - "type": "Cast", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48", - "type": "Conv2DBackpropFilter", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52", - "type": "Conv2DBackpropInput", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Cast-op246", - "type": "Cast", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55", - "type": "Conv2DBackpropFilter", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "name": "graph_1", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Gradients", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Gradients/Default", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Gradients/Default/network-WithLossCell", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20", - "type": "Mul", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21", - "type": "BiasAddGrad", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29", - "type": "BiasAddGrad", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37", - "type": "BiasAddGrad", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5", - "type": "aggregation_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24", - "type": "MatMul", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op27", - "type": "MatMul", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32", - "type": "MatMul", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op35", - "type": "MatMul", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40", - "type": "MatMul", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op44", - "type": "MatMul", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - } - ] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28", - "type": "ReluGrad", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36", - "type": "ReluGrad", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92", - "type": "ReluGradV2", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94", - "type": "ReluGradV2", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/flatten-Flatten", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/flatten-Flatten/gradReshape", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/flatten-Flatten/gradReshape/Reshape-op45", - "type": "Reshape", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/flatten-Flatten/gradReshape/TransData-op148", - "type": "TransData", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/Cast-op232", - "type": "Cast", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46", - "type": "MaxPoolGradWithArgmax", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/Cast-op234", - "type": "Cast", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53", - "type": "MaxPoolGradWithArgmax", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/Cast-op245", - "type": "Cast", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Cast-op235", - "type": "Cast", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48", - "type": "Conv2DBackpropFilter", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52", - "type": "Conv2DBackpropInput", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Cast-op246", - "type": "Cast", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55", - "type": "Conv2DBackpropFilter", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/search_unwatched_leaf_node.json b/tests/st/func/debugger/expect_results/restful_results/search_unwatched_leaf_node.json deleted file mode 100644 index 07536572..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/search_unwatched_leaf_node.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "nodes": [ - { - "name": "Default", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/optimizer-Momentum", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/optimizer-Momentum/Parameter[18]_7", - "type": "aggregation_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/moments.fc3.bias", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [], - "watched": 2, - "disable": false - } - ], - "watched": 2, - "disable": false - } - ], - "watched": 2, - "disable": false - } - ], - "watched": 2, - "disable": false - } - ] -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/search_weight.json b/tests/st/func/debugger/expect_results/restful_results/search_weight.json deleted file mode 100644 index 4ee5fc74..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/search_weight.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "nodes": [ - { - "name": "Default", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell/_backbone-LeNet5", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6", - "type": "aggregation_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6/fc1.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6/fc1.bias", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6/fc2.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6/fc2.bias", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6/fc3.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6/fc3.bias", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/search_weight_multi_graph.json b/tests/st/func/debugger/expect_results/restful_results/search_weight_multi_graph.json deleted file mode 100644 index 5564ebdf..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/search_weight_multi_graph.json +++ /dev/null @@ -1,212 +0,0 @@ -{ - "nodes": [ - { - "name": "graph_0", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Default", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Default/network-WithLossCell", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Default/network-WithLossCell/_backbone-LeNet5", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/conv2.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - }, - { - "name": "graph_0/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/conv1.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - }, - { - "name": "graph_0/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6", - "type": "aggregation_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_0/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6/fc1.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6/fc1.bias", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6/fc2.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6/fc2.bias", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6/fc3.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_0/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6/fc3.bias", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "name": "graph_1", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Default", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Default/network-WithLossCell", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Default/network-WithLossCell/_backbone-LeNet5", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/conv2.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - }, - { - "name": "graph_1/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/conv1.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - }, - { - "name": "graph_1/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6", - "type": "aggregation_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "graph_1/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6/fc1.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6/fc1.bias", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6/fc2.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6/fc2.bias", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6/fc3.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "graph_1/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6/fc3.bias", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/restful_results/version_mismatch.json b/tests/st/func/debugger/expect_results/restful_results/version_mismatch.json deleted file mode 100644 index 7ccbd3d9..00000000 --- a/tests/st/func/debugger/expect_results/restful_results/version_mismatch.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "metadata": { - "state": "mismatch", - "step": 0, - "device_name": "0", - "node_name": "", - "backend": "Ascend", - "enable_recheck": false, - "graph_name": "", - "recommendation_confirmed": false, - "debugger_version": {}, - "data_version": {} - }, - "graph": {}, - "devices": [ - { - "rank_id": 0, - "device_id": "0", - "graph_names": [] - } - ], - "watch_points": [] -} \ No newline at end of file diff --git a/tests/st/func/debugger/expect_results/search_nodes_0.json b/tests/st/func/debugger/expect_results/search_nodes_0.json deleted file mode 100644 index 44bb7437..00000000 --- a/tests/st/func/debugger/expect_results/search_nodes_0.json +++ /dev/null @@ -1 +0,0 @@ -{"nodes": [{"name": "Default", "type": null, "nodes": [{"name": "Default/network-WithLossCell", "type": null, "nodes": [{"name": "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits", "type": null, "nodes": [{"name": "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/OneHot-op0", "type": "OneHot", "nodes": []}, {"name": "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/SoftmaxCrossEntropyWithLogits-op18", "type": "SoftmaxCrossEntropyWithLogits", "nodes": []}, {"name": "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/ReduceMean-op60", "type": "ReduceMean", "nodes": []}, {"name": "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/args1", "type": "Parameter", "nodes": []}, {"name": "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/cst1", "type": "Const", "nodes": []}, {"name": "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/cst2", "type": "Const", "nodes": []}]}]}]}, {"name": "Gradients", "type": null, "nodes": [{"name": "Gradients/Default", "type": null, "nodes": [{"name": "Gradients/Default/network-WithLossCell", "type": null, "nodes": [{"name": "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits", "type": null, "nodes": [{"name": "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits", "type": null, "nodes": [{"name": "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20", "type": "Mul", "nodes": []}, {"name": "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/cst8", "type": "Const", "nodes": []}]}]}]}]}]}]} \ No newline at end of file diff --git a/tests/st/func/debugger/mock_ms_client.py b/tests/st/func/debugger/mock_ms_client.py deleted file mode 100644 index fc312a92..00000000 --- a/tests/st/func/debugger/mock_ms_client.py +++ /dev/null @@ -1,227 +0,0 @@ -# Copyright 2020-2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Mocked MindSpore debugger client.""" -from threading import Thread -from time import sleep - -import grpc -import numpy as np - -import mindinsight -from mindinsight.debugger.proto.debug_grpc_pb2 import Metadata, WatchpointHit, Chunk, EventReply -from mindinsight.debugger.proto.debug_grpc_pb2_grpc import EventListenerStub -from mindinsight.domain.graph.proto import ms_graph_pb2 -from mindinsight.domain.graph.proto.ms_graph_pb2 import TensorProto, DataType -from tests.st.func.debugger.conftest import GRAPH_PROTO_FILE - - -class MockDebuggerClient: - """Mocked Debugger client.""" - - def __init__(self, hostname='localhost:50051', backend='Ascend', graph_num=1, ms_version=None): - channel = grpc.insecure_channel(hostname) - self.stub = EventListenerStub(channel) - self.flag = True - self._step = 0 - self._watchpoint_id = 0 - self._leaf_node = [] - self._cur_node = '' - self._backend = backend - self._graph_num = graph_num - self._ms_version = ms_version if ms_version else mindinsight.__version__ - - def _clean(self): - """Clean cache.""" - self._step = 0 - self._watchpoint_id = 0 - self._leaf_node = [] - self._cur_node = '' - - def get_thread_instance(self): - """Get debugger client thread.""" - return MockDebuggerClientThread(self) - - def next_node(self, name=None): - """Update the current node to next node.""" - if not self._cur_node: - self._cur_node = self._leaf_node[0] - return - cur_index = self._leaf_node.index(self._cur_node) - # if name is not None, go to the specified node. - if not name: - next_index = cur_index + 1 - else: - next_index = self._leaf_node.index(name) - # update step - if next_index <= cur_index or next_index == len(self._leaf_node): - self._step += 1 - # update current node - if next_index == len(self._leaf_node): - self._cur_node = self._leaf_node[0] - else: - self._cur_node = self._leaf_node[next_index] - - def command_loop(self): - """Wait for the command.""" - total_steps = 100 - wait_flag = True - while self.flag and wait_flag: - if self._step > total_steps: - sleep(0.5) - self.send_metadata_cmd(training_done=True) - return - wait_flag = self._wait_cmd() - - def _wait_cmd(self): - """Wait for command and deal with command.""" - metadata = self.get_metadata_cmd() - response = self.stub.WaitCMD(metadata) - assert response.status == EventReply.Status.OK - if response.HasField('run_cmd'): - self._deal_with_run_cmd(response) - elif response.HasField('view_cmd'): - for tensor in response.view_cmd.tensors: - self.send_tensor_cmd(in_tensor=tensor) - elif response.HasField('set_cmd'): - self._watchpoint_id += 1 - elif response.HasField('exit'): - self._watchpoint_id = 0 - self._step = 0 - return False - return True - - def _deal_with_run_cmd(self, response): - self._step += response.run_cmd.run_steps - if response.run_cmd.run_level == 'node': - self.next_node(response.run_cmd.node_name) - if self._watchpoint_id > 0: - self.send_watchpoint_hit() - - def get_metadata_cmd(self, training_done=False): - """Construct metadata message.""" - metadata = Metadata() - metadata.device_name = '0' - metadata.cur_step = self._step - metadata.cur_node = self._cur_node - metadata.backend = self._backend - metadata.training_done = training_done - metadata.ms_version = self._ms_version - return metadata - - def send_metadata_cmd(self, training_done=False): - """Send metadata command.""" - self._clean() - metadata = self.get_metadata_cmd(training_done) - response = self.stub.SendMetadata(metadata) - assert response.status == EventReply.Status.OK - if response.HasField('version_matched') and response.version_matched is False: - self.command_loop() - if training_done is False: - self.send_graph_cmd() - - def send_graph_cmd(self): - """Send graph to debugger server.""" - self._step = 1 - if self._graph_num > 1: - chunks = [] - for i in range(self._graph_num): - chunks.extend(self._get_graph_chunks('graph_' + str(i))) - response = self.stub.SendMultiGraphs(self._generate_graph(chunks)) - else: - chunks = self._get_graph_chunks() - response = self.stub.SendGraph(self._generate_graph(chunks)) - assert response.status == EventReply.Status.OK - # go to command loop - self.command_loop() - - def _get_graph_chunks(self, graph_name='graph_0'): - """Get graph chunks.""" - with open(GRAPH_PROTO_FILE, 'rb') as file_handle: - content = file_handle.read() - size = len(content) - graph = ms_graph_pb2.GraphProto() - graph.ParseFromString(content) - graph.name = graph_name - content = graph.SerializeToString() - self._leaf_node = [node.full_name for node in graph.node] - # the max limit of grpc data size is 4kb - # split graph into 3kb per chunk - chunk_size = 1024 * 1024 * 3 - chunks = [] - for index in range(0, size, chunk_size): - sub_size = min(chunk_size, size - index) - sub_chunk = Chunk(buffer=content[index: index + sub_size]) - chunks.append(sub_chunk) - chunks[-1].finished = True - return chunks - - @staticmethod - def _generate_graph(chunks): - """Construct graph generator.""" - for buffer in chunks: - yield buffer - - def send_tensor_cmd(self, in_tensor=None): - """Send tensor info with value.""" - response = self.stub.SendTensors(self.generate_tensor(in_tensor)) - assert response.status == EventReply.Status.OK - - @staticmethod - def generate_tensor(in_tensor=None): - """Generate tensor message.""" - tensor_content = np.asarray([1, 2, 3, 4, 5, 6]).astype(np.float32).tobytes() - tensors = [TensorProto(), TensorProto()] - tensors[0].CopyFrom(in_tensor) - tensors[0].data_type = DataType.DT_FLOAT32 - tensors[0].dims.extend([2, 3]) - tensors[1].CopyFrom(tensors[0]) - tensors[0].tensor_content = tensor_content[:12] - tensors[1].tensor_content = tensor_content[12:] - tensors[0].finished = 0 - tensors[1].finished = 1 - for sub_tensor in tensors: - yield sub_tensor - - def send_watchpoint_hit(self): - """Send watchpoint hit value.""" - tensors = [TensorProto(node_name='Default/TransData-op99', slot='0'), - TensorProto(node_name='Default/optimizer-Momentum/ApplyMomentum-op25', slot='0')] - response = self.stub.SendWatchpointHits(self._generate_hits(tensors)) - assert response.status == EventReply.Status.OK - - @staticmethod - def _generate_hits(tensors): - """Construct watchpoint hits.""" - for tensor in tensors: - hit = WatchpointHit() - hit.id = 1 - hit.tensor.CopyFrom(tensor) - yield hit - - -class MockDebuggerClientThread: - """Mocked debugger client thread.""" - def __init__(self, debugger_client): - self._debugger_client = debugger_client - self._debugger_client_thread = Thread(target=debugger_client.send_metadata_cmd) - - def __enter__(self, backend='Ascend'): - self._debugger_client.flag = True - self._debugger_client_thread.start() - return self._debugger_client_thread - - def __exit__(self, exc_type, exc_val, exc_tb): - self._debugger_client_thread.join(timeout=2) - self._debugger_client.flag = False diff --git a/tests/st/func/debugger/stream_operator/__init__.py b/tests/st/func/debugger/stream_operator/__init__.py deleted file mode 100644 index 3dc1bea3..00000000 --- a/tests/st/func/debugger/stream_operator/__init__.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -Function: - Test debugger services. -Usage: - pytest tests/st/func/debugger -""" diff --git a/tests/st/func/debugger/stream_operator/test_graph_runs_operator.py b/tests/st/func/debugger/stream_operator/test_graph_runs_operator.py deleted file mode 100644 index 8cb2d22c..00000000 --- a/tests/st/func/debugger/stream_operator/test_graph_runs_operator.py +++ /dev/null @@ -1,98 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Test GraphRunOperator for offline debugger.""" -import json -import os -import shutil -from unittest import mock - -import pytest - -from mindinsight.debugger.debugger_cache import DebuggerCache -from mindinsight.debugger.debugger_services.debugger_offline_server import DebuggerOfflineManager -from mindinsight.debugger.stream_operator.graph_runs_operator import GraphRunsOperator -from tests.st.func.debugger.conftest import DEBUGGER_EXPECTED_RESULTS -from tests.st.func.debugger.debugger_services import mock_dbg_services -from tests.st.func.debugger.utils import build_multi_net_dump_structure, DumpStructureGenerator -from tests.utils.tools import compare_result_with_file - - -class TestGraphRunsOperator: - """Test GraphRunsOperator.""" - - @classmethod - def setup_class(cls): - """Prepare dump structure.""" - cls.debug = False - cls.debugger_tmp_dir = build_multi_net_dump_structure() - cls.cache_store = cls.get_cache_store(cls.debugger_tmp_dir) - - @classmethod - def teardown_class(cls): - """Run after test this class.""" - if os.path.exists(cls.debugger_tmp_dir): - shutil.rmtree(cls.debugger_tmp_dir) - - @staticmethod - def get_cache_store(dump_dir): - """Get initialized cache store.""" - cache_store = DebuggerCache() - with mock.patch.object(DebuggerOfflineManager, 'get_dbg_service_module', return_value=mock_dbg_services): - offline_manager = DebuggerOfflineManager(cache_store, dump_dir) - offline_manager.initialize() - return cache_store - - @pytest.mark.level - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_get_graph_runs(self): - """Test load graph history.""" - res = GraphRunsOperator(self.cache_store).get_graph_runs(0) - real_path = os.path.join(DEBUGGER_EXPECTED_RESULTS, 'offline_debugger', 'get_graph_runs.json') - if self.debug: - json.dump(res, open(real_path, 'w')) - compare_result_with_file(res, real_path) - - def test_graph_history_mismatch(self): - """Test get graph run when graph history mismatch.""" - path = os.path.join(self.debugger_tmp_dir, 'mismatch') - gen = DumpStructureGenerator(path) - history = {0: [0, 2, 4], - 3: [1, 3, 5, 6]} - steps = {0: [0, 1, 2]} - gen.generate(history=history, dump_steps=steps) - cache_store = self.get_cache_store(path) - res = GraphRunsOperator(cache_store).get_graph_runs(0) - assert res == {'graph_runs': []} - gen.clean() - - def test_data_sink_exception(self): - """Test get graph run when graph history mismatch.""" - path = os.path.join(self.debugger_tmp_dir, 'exception') - gen = DumpStructureGenerator(path) - history = {0: {0, 2, 4}, - 3: {1, 3, 5, 6}} - steps = {0: {0, 2, 5}} - gen.generate(history=history, dump_steps=steps) - cache_store = self.get_cache_store(path) - res = GraphRunsOperator(cache_store).get_graph_runs(0) - real_path = os.path.join(DEBUGGER_EXPECTED_RESULTS, 'offline_debugger', 'get_graph_runs_exception.json') - if self.debug: - json.dump(res, open(real_path, 'w')) - compare_result_with_file(res, real_path) - gen.clean() diff --git a/tests/st/func/debugger/test_data_loader.py b/tests/st/func/debugger/test_data_loader.py deleted file mode 100644 index c3007c16..00000000 --- a/tests/st/func/debugger/test_data_loader.py +++ /dev/null @@ -1,215 +0,0 @@ -# Copyright 2021-2022 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Test DataLoader of offline debugger.""" -import os -import shutil - -import pytest - -from mindinsight.debugger.common.exceptions.exceptions import DebuggerNodeTooLarge -from mindinsight.debugger.stream_cache.data_loader import DataLoader -from tests.st.func.debugger.conftest import GRAPH_PROTO_FILE -from tests.st.func.debugger.utils import build_dump_file_structure, build_multi_net_dump_structure -from tests.utils.tools import compare_result_with_file, compare_result_with_binary_file - - -class TestDataLoader: - """Test DataLoader.""" - - @classmethod - def setup_class(cls): - """Init TestDataLoader for DataLoader unittest.""" - cls.debugger_tmp_dir = build_dump_file_structure() - cls.expected_results_dir = os.path.join(os.path.dirname(__file__), - 'expect_results/offline_debugger') - cls.dump_files_dir_ascend = os.path.join(cls.debugger_tmp_dir, - 'Ascend/sync') - cls.data_loader_ascend = DataLoader(cls.dump_files_dir_ascend) - cls.dump_files_dir_gpu = os.path.join(cls.debugger_tmp_dir, - 'GPU/sync') - cls.data_loader_gpu = DataLoader(cls.dump_files_dir_gpu) - cls.dump_files_dir_ascend_async = os.path.join(cls.debugger_tmp_dir, - 'Ascend/async') - cls.data_loader_ascend_async = DataLoader(cls.dump_files_dir_ascend_async) - - @classmethod - def teardown_class(cls): - """Run after test this class.""" - if os.path.exists(cls.debugger_tmp_dir): - shutil.rmtree(cls.debugger_tmp_dir) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_load_graphs_ascend(self): - """Test load_graphs function of offline-debugger.""" - res = self.data_loader_ascend.load_graphs() - expected_result0 = GRAPH_PROTO_FILE - res0 = res[0]['graph_protos'][0].SerializeToString() - compare_result_with_binary_file(res0, expected_result0) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_load_graphs_ascend_except(self): - """Test load_graphs function of offline-debugger when node too large.""" - with pytest.raises(DebuggerNodeTooLarge) as exc_info: - self.data_loader_ascend.load_graphs(321) - assert "Node limit: 321, current node num: 322." in exc_info.value.message - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_load_device_info_ascend(self): - """Test load_device_info of ascend chip for offline-debugger.""" - res = self.data_loader_ascend.load_device_info() - expected_result = os.path.join(self.expected_results_dir, 'load_device_info_ascend.json') - compare_result_with_file(res, expected_result) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_load_step_num_ascend(self): - """Test load_step_num of ascend chip for offline-debugger.""" - res = self.data_loader_ascend.load_dumped_step() - expected_result = {0: {0: [0, 1, 2, 3]}, 1: {0: [0, 1, 2, 3]}} - self._compare_dumped_steps(res, expected_result) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_get_net_name_ascend(self): - """Test get_net_name of ascend chip for offline-debugger.""" - res = self.data_loader_ascend.get_net_name() - assert res == 'Lenet' - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_get_sync_flag(self): - """Test get_sync_flag of ascend chip for offline-debugger.""" - res = self.data_loader_ascend.get_sync_flag() - assert res - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_load_graphs_gpu(self): - """Test load_graphs function of offline-debugger.""" - res = self.data_loader_gpu.load_graphs() - expected_result0 = GRAPH_PROTO_FILE - res0 = res[0]['graph_protos'][0].SerializeToString() - compare_result_with_binary_file(res0, expected_result0) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_load_step_num_gpu(self): - """Test load_step_num of ascend chip for offline-debugger.""" - res = self.data_loader_gpu.load_dumped_step() - expected_result = {0: {0: [0, 1, 2]}, 1: {0: [0, 1, 2]}} - self._compare_dumped_steps(res, expected_result) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_load_step_num_ascend_async(self): - """Test load_step_num of ascend chip for offline-debugger.""" - res = self.data_loader_ascend_async.load_dumped_step() - expected_result = {0: {1: [0, 1, 2]}, 1: {1: [0, 1, 2]}} - self._compare_dumped_steps(res, expected_result) - - @staticmethod - def _compare_dumped_steps(actual_res, expect_res): - """Compare dumped steps.""" - convert_res = {} - for key, value in actual_res.items(): - convert_res[key] = {} - for graph_id, step_ids in value.items(): - convert_res[key][graph_id] = list(step_ids) - convert_res[key][graph_id].sort() - assert convert_res == expect_res - - -class TestMultiNetDataLoader: - """Test MultiNet DataLoader.""" - - @classmethod - def setup_class(cls): - """Init TestDataLoader for DataLoader unittest.""" - cls.debugger_tmp_dir = build_multi_net_dump_structure() - cls.data_loader = DataLoader(cls.debugger_tmp_dir) - - @classmethod - def teardown_class(cls): - """Run after test this class.""" - if os.path.exists(cls.debugger_tmp_dir): - shutil.rmtree(cls.debugger_tmp_dir) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_get_graph_history(self): - """Test load graph history.""" - res = self.data_loader.load_graph_history() - expect = {0: {0: {0, 2, 4}, 3: {1, 3, 5, 6}}, - 1: {0: {0, 2, 4}, 3: {1, 3, 5, 6}}} - assert res == expect - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - @pytest.mark.parametrize("step, rank, result", [ - (0, None, True), - (1, 0, True), - (7, 1, False), - ]) - def test_has_data(self, step, rank, result): - """Test has data in specific step.""" - res = self.data_loader.has_data(step, rank) - assert res == result diff --git a/tests/st/func/debugger/test_offline_api.py b/tests/st/func/debugger/test_offline_api.py deleted file mode 100644 index de3a9ac2..00000000 --- a/tests/st/func/debugger/test_offline_api.py +++ /dev/null @@ -1,308 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Test DataLoader of offline debugger.""" -import os -from unittest import mock - -import pytest - -from mindinsight.debugger.debugger_services.debugger_offline_server import DebuggerOfflineManager -from mindinsight.conf import settings -from tests.st.func.debugger.utils import check_offline_dbg_server_state, get_request_result, \ - build_dump_file_structure, send_and_compare_result, send_and_save_result, build_multi_net_dump_structure -from tests.st.func.debugger.debugger_services import mock_dbg_services - - -OFFLINE_BASE_DIR = '/v1/mindinsight/debugger/sessions' - - -def stop_session(app_client, session_id): - """Stop session.""" - url = os.path.join(OFFLINE_BASE_DIR, session_id, 'delete') - session_id = get_request_result(app_client=app_client, url=url, body_data={}, method='post', full_url=True) - return session_id - - -class TestAscendDebugger: - """Test debugger on Ascend backend.""" - - @classmethod - def setup_class(cls): - """Setup class.""" - cls.save_results = False - cls.debugger_tmp_dir = build_dump_file_structure() - settings.SUMMARY_BASE_DIR = cls.debugger_tmp_dir - cls.dump_dir = "./GPU/sync" - cls.base_url = '/v1/mindinsight/debugger/sessions/' - cls.expect_file_dir = 'offline_debugger' - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - @pytest.mark.parametrize("body_data, expect_file", [ - ({'mode': 'all'}, 'retrieve_all.json'), - ({'mode': 'node', 'params': {'name': 'Default'}}, 'retrieve_scope_node.json'), - ({'mode': 'node', 'params': {'name': 'Default/optimizer-Momentum/Parameter[18]_7'}}, - 'retrieve_aggregation_scope_node.json'), - ({'mode': 'node', 'params': { - 'name': 'Default/TransData-op99', - 'single_node': True}}, 'retrieve_single_node.json') - ]) - @mock.patch.object(DebuggerOfflineManager, 'get_dbg_service_module') - def test_retrieve_when_train_begin(self, mock_method, app_client, body_data, expect_file): - """Test retrieve when train_begin.""" - session_id = self.create_session(mock_method, app_client) - url = os.path.join(os.path.join(self.base_url, session_id), 'retrieve') - check_offline_dbg_server_state(app_client, session_id) - send_and_compare_result(app_client, url, body_data, expect_file, full_url=True, - expect_file_dir=self.expect_file_dir) - stop_session(app_client, session_id) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - @mock.patch.object(DebuggerOfflineManager, 'get_dbg_service_module') - def test_create_and_delete_watchpoint(self, mock_method, app_client): - """Test create and delete watchpoint.""" - conditions = [ - {'id': 'tensor_too_large', 'params': [{'name': 'max_gt', 'value': 1.0}]}, - {'id': 'tensor_too_small', 'params': [{'name': 'max_lt', 'value': -1.0}]}, - {'id': 'tensor_too_large', 'params': [{'name': 'min_gt', 'value': 1e+32}]}, - {'id': 'tensor_too_small', 'params': [{'name': 'min_lt', 'value': -1e+32}]}, - {'id': 'tensor_too_large', 'params': [{'name': 'mean_gt', 'value': 0}]}, - {'id': 'tensor_too_small', 'params': [{'name': 'mean_lt', 'value': 0}]} - ] - session_id = self.create_session(mock_method, app_client) - check_offline_dbg_server_state(app_client, session_id) - for idx, condition in enumerate(conditions): - self.create_watchpoint(app_client, session_id, condition, idx + 1) - # delete 4-th watchpoint - url = os.path.join(os.path.join(self.base_url, session_id), 'delete-watchpoint') - body_data = {'watch_point_id': 4} - get_request_result(app_client, url, body_data, full_url=True) - # test watchpoint list - url = os.path.join(os.path.join(self.base_url, session_id), 'retrieve') - body_data = {'mode': 'watchpoint'} - expect_file = 'create_and_delete_watchpoint.json' - send_and_compare_result(app_client, url, body_data, expect_file, full_url=True) - stop_session(app_client, session_id) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - @mock.patch.object(DebuggerOfflineManager, 'get_dbg_service_module') - def test_update_watchpoint(self, mock_method, app_client): - """Test retrieve when train_begin.""" - watch_point_id = 1 - leaf_node_name = "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56" - session_id = self.create_session(mock_method, app_client) - check_offline_dbg_server_state(app_client, session_id) - condition = {'id': 'tensor_too_large', 'params': [{'name': 'max_gt', 'value': 1.0}]} - self.create_watchpoint(app_client, session_id, condition, watch_point_id) - # update watchpoint watchpoint list - url = os.path.join(os.path.join(self.base_url, session_id), 'update-watchpoint') - body_data = {'watch_point_id': watch_point_id, - 'watch_nodes': [leaf_node_name], - 'mode': 1} - get_request_result(app_client, url, body_data, full_url=True) - # get updated nodes - url = os.path.join(os.path.join(self.base_url, session_id), 'search') - body_data = {'name': leaf_node_name, 'watch_point_id': watch_point_id} - expect_file = 'search_unwatched_leaf_node.json' - send_and_compare_result(app_client, url, body_data, expect_file, method='get', full_url=True, - expect_file_dir=self.expect_file_dir) - stop_session(app_client, session_id) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - @mock.patch.object(DebuggerOfflineManager, 'get_dbg_service_module') - def test_retrieve_tensor_history(self, mock_method, app_client): - """Test retrieve tensor value.""" - node_name = 'Default/TransData-op99' - session_id = self.create_session(mock_method, app_client) - # prepare tensor value - self.run_one_step(app_client, session_id) - check_offline_dbg_server_state(app_client, session_id) - tensor_history_url = os.path.join(os.path.join(self.base_url, session_id), 'tensor-history') - body_data = {'name': node_name, 'rank_id': 0} - expect_file = 'retrieve_empty_tensor_history.json' - send_and_compare_result(app_client, tensor_history_url, body_data, expect_file, full_url=True, - expect_file_dir=self.expect_file_dir) - # check full tensor history from poll data - self.check_poll_data(app_client, session_id, "node_name", node_name, 0) - expect_file = 'retrieve_full_tensor_history.json' - send_and_compare_result(app_client, tensor_history_url, body_data, expect_file, full_url=True, - expect_file_dir=self.expect_file_dir) - stop_session(app_client, session_id) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - @mock.patch.object(DebuggerOfflineManager, 'get_dbg_service_module') - def test_retrieve_tensor_value(self, mock_method, app_client): - """Test compare tensor value.""" - node_name = 'Default/TransData-op99' - session_id = self.create_session(mock_method, app_client) - # prepare tensor value - self.run_one_step(app_client, session_id) - self.send_tensor_history(app_client, session_id, node_name) - # check full tensor history from poll data - pos = self.check_poll_data(app_client, session_id, "node_name", node_name, 0) - url = os.path.join(os.path.join(self.base_url, session_id), 'tensors') - body_data = { - 'name': node_name + ':0', - 'detail': 'data' - } - get_request_result(app_client, url, body_data, method='GET', full_url=True) - self.check_poll_data(app_client, session_id, "tensor_name", body_data['name'], pos) - expect_file = 'retrieve_tensor_value.json' - send_and_compare_result(app_client, url, body_data, expect_file, method='get', full_url=True, - expect_file_dir=self.expect_file_dir) - stop_session(app_client, session_id) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - @pytest.mark.parametrize("body_data, expect_file", [ - ({'tensor_name': 'Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25:0', - 'graph_name': 'kernel_graph_0'}, - 'retrieve_tensor_graph-0.json') - ]) - @mock.patch.object(DebuggerOfflineManager, 'get_dbg_service_module') - def test_retrieve_tensor_graph(self, mock_method, app_client, body_data, expect_file): - """Test retrieve tensor graph.""" - node_name = 'Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25' - session_id = self.create_session(mock_method, app_client) - self.run_one_step(app_client, session_id) - self.send_tensor_history(app_client, session_id, node_name) - check_offline_dbg_server_state(app_client, session_id) - pos = self.check_poll_data(app_client, session_id, "node_name", node_name, 0) - url = os.path.join(os.path.join(self.base_url, session_id), 'tensor-graphs') - get_request_result(app_client, url, body_data, method='GET', full_url=True) - self.check_poll_data(app_client, session_id, "tensor_name", node_name + ":0", pos) - if self.save_results: - send_and_save_result(app_client, url, body_data, expect_file, method='GET', full_url=True, - expect_file_dir=self.expect_file_dir) - send_and_compare_result(app_client, url, body_data, expect_file, method='GET', full_url=True, - expect_file_dir=self.expect_file_dir) - stop_session(app_client, session_id) - - def create_session(self, mock_method, app_client): - """Create session.""" - mock_method.return_value = mock_dbg_services - session_id = get_request_result(app_client=app_client, url='/v1/mindinsight/debugger/sessions', - body_data={ - "session_type": "OFFLINE", - "dump_dir": self.dump_dir, - }, - method='post', full_url=True) - return session_id - - def create_watchpoint(self, app_client, session_id, condition, expect_id): - """Create watchpoint.""" - url = os.path.join(os.path.join(self.base_url, session_id), 'create-watchpoint') - body_data = {'condition': condition, - 'watch_nodes': ['Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25']} - res = get_request_result(app_client, url, body_data, full_url=True) - assert res.get('id') == expect_id - - def run_one_step(self, app_client, session_id): - """Run one step""" - check_offline_dbg_server_state(app_client, session_id) - url = os.path.join(os.path.join(self.base_url, session_id), 'control') - body_data = {'mode': 'continue', - 'steps': 1} - get_request_result(app_client, url, body_data, full_url=True) - - def send_tensor_history(self, app_client, session_id, node_name): - """Send tensor history""" - check_offline_dbg_server_state(app_client, session_id) - tensor_history_url = os.path.join(os.path.join(self.base_url, session_id), 'tensor-history') - body_data = {'name': node_name, 'rank_id': 0} - get_request_result(app_client, tensor_history_url, body_data, full_url=True) - - def check_poll_data(self, app_client, session_id, param_name, expect_result, pos): - """Check poll data""" - url = os.path.join(os.path.join(self.base_url, session_id), 'poll-data') - i = 0 - # The backend should response after no more than 2 requests. - max_retry_times = 2 - while i < max_retry_times: - res = get_request_result( - app_client=app_client, url=url, body_data={'pos': pos}, method='get', full_url=True) - pos = res.get('metadata', {}).get('pos') - if res.get('receive_tensor', {}).get(param_name) == expect_result: - break - i += 1 - return pos - - -class TestMultiNetDebugger: - """Test debugger with multiple network.""" - - @classmethod - def setup_class(cls): - """Setup class.""" - cls.save_results = False - cls.dump_dir = 'multi/dump' - cls.debugger_tmp_dir = build_multi_net_dump_structure(cls.dump_dir) - settings.SUMMARY_BASE_DIR = cls.debugger_tmp_dir - cls.base_url = '/v1/mindinsight/debugger/sessions/' - cls.expect_file_dir = 'offline_debugger' - - def create_session(self, app_client): - """Create offline session.""" - with mock.patch.object(DebuggerOfflineManager, 'get_dbg_service_module', return_value=mock_dbg_services): - session_id = get_request_result(app_client=app_client, url=OFFLINE_BASE_DIR, - body_data={ - "session_type": "OFFLINE", - "dump_dir": self.dump_dir, - }, - method='post', full_url=True) - return session_id - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_get_run_graphs(self, app_client): - """Test retrieve when train_begin.""" - session_id = self.create_session(app_client) - check_offline_dbg_server_state(app_client, session_id) - url = os.path.join(OFFLINE_BASE_DIR, session_id, 'ranks', '0', 'graph-runs') - expect_file = 'get_graph_runs.json' - send_and_compare_result(app_client, url, {}, expect_file, method='get', expect_file_dir='offline_debugger') - stop_session(app_client, session_id) diff --git a/tests/st/func/debugger/test_restful_api.py b/tests/st/func/debugger/test_restful_api.py deleted file mode 100644 index f8a3b3ac..00000000 --- a/tests/st/func/debugger/test_restful_api.py +++ /dev/null @@ -1,750 +0,0 @@ -# Copyright 2020-2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -Function: - Test query debugger restful api. -Usage: - pytest tests/st/func/debugger/test_restful_api.py -""" -import os -import time - -import pytest - -from mindinsight.conf import settings -from mindinsight.debugger.common.utils import ServerStatus -from tests.st.func.debugger.conftest import DEBUGGER_BASE_URL -from tests.st.func.debugger.mock_ms_client import MockDebuggerClient -from tests.st.func.debugger.utils import check_state, get_request_result, \ - send_and_compare_result, send_and_save_result - - -def send_terminate_cmd(app_client): - """Send terminate command to debugger client.""" - url = os.path.join(DEBUGGER_BASE_URL, 'control') - body_data = {'mode': 'terminate'} - send_and_compare_result(app_client, url, body_data) - - -class TestAscendDebugger: - """Test debugger on Ascend backend.""" - - @classmethod - def setup_class(cls): - """Setup class.""" - cls.save_results = False - cls._debugger_client = MockDebuggerClient(backend='Ascend') - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_before_train_begin(self, app_client): - """Test retrieve all.""" - url = 'retrieve' - body_data = {'mode': 'all'} - expect_file = 'before_train_begin.json' - send_and_compare_result(app_client, url, body_data, expect_file) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - @pytest.mark.parametrize("body_data, expect_file", [ - ({'mode': 'all'}, 'retrieve_all.json'), - ({'mode': 'node', 'params': {'name': 'Default'}}, 'retrieve_scope_node.json'), - ({'mode': 'node', 'params': {'name': 'Default/optimizer-Momentum/Parameter[18]_7'}}, - 'retrieve_aggregation_scope_node.json'), - ({'mode': 'node', 'params': { - 'name': 'Default/TransData-op99', - 'single_node': True}}, 'retrieve_single_node.json') - ]) - def test_retrieve_when_train_begin(self, app_client, body_data, expect_file): - """Test retrieve when train_begin.""" - url = 'retrieve' - with self._debugger_client.get_thread_instance(): - check_state(app_client) - if self.save_results: - send_and_save_result(app_client, url, body_data, expect_file) - send_and_compare_result(app_client, url, body_data, expect_file) - send_terminate_cmd(app_client) - - def test_get_conditions(self, app_client): - """Test get conditions for ascend.""" - url = '/v1/mindinsight/debugger/sessions/0/condition-collections' - body_data = {} - expect_file = 'get_conditions_for_ascend.json' - with self._debugger_client.get_thread_instance(): - check_state(app_client) - if self.save_results: - send_and_save_result(app_client, url, body_data, expect_file, method='get', full_url=True) - send_and_compare_result(app_client, url, body_data, expect_file, method='get', full_url=True) - send_terminate_cmd(app_client) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - @pytest.mark.parametrize("body_data, expect_file", [ - ({'mode': 'all'}, 'multi_retrieve_all.json'), - ({'mode': 'node', 'params': {'name': 'Default', 'graph_name': 'graph_1'}}, 'retrieve_scope_node.json'), - ({'mode': 'node', 'params': {'name': 'graph_0'}}, 'multi_retrieve_scope_node.json'), - ({'mode': 'node', 'params': {'name': 'graph_0/Default/optimizer-Momentum/Parameter[18]_7'}}, - 'multi_retrieve_aggregation_scope_node.json'), - ({'mode': 'node', 'params': { - 'name': 'graph_0/Default/TransData-op99', - 'single_node': True}}, 'multi_retrieve_single_node.json'), - ({'mode': 'node', 'params': { - 'name': 'Default/TransData-op99', - 'single_node': True, 'graph_name': 'graph_0'}}, 'retrieve_single_node.json') - ]) - def test_multi_retrieve_when_train_begin(self, app_client, body_data, expect_file): - """Test retrieve when train_begin.""" - url = 'retrieve' - debugger_client = MockDebuggerClient(backend='Ascend', graph_num=2) - with debugger_client.get_thread_instance(): - check_state(app_client) - if self.save_results: - send_and_save_result(app_client, url, body_data, expect_file) - send_and_compare_result(app_client, url, body_data, expect_file) - send_terminate_cmd(app_client) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_create_and_delete_watchpoint(self, app_client): - """Test create and delete watchpoint.""" - with self._debugger_client.get_thread_instance(): - check_state(app_client) - conditions = [ - {'id': 'tensor_too_large', 'params': [{'name': 'max_gt', 'value': 1.0}]}, - {'id': 'tensor_too_small', 'params': [{'name': 'max_lt', 'value': -1.0}]}, - {'id': 'tensor_too_large', 'params': [{'name': 'min_gt', 'value': 1e+32}]}, - {'id': 'tensor_too_small', 'params': [{'name': 'min_lt', 'value': -1e+32}]}, - {'id': 'tensor_too_large', 'params': [{'name': 'mean_gt', 'value': 0}]}, - {'id': 'tensor_too_small', 'params': [{'name': 'mean_lt', 'value': 0}]} - ] - for idx, condition in enumerate(conditions): - create_watchpoint(app_client, condition, idx + 1) - # delete 4-th watchpoint - url = 'delete-watchpoint' - body_data = {'watch_point_id': 4} - get_request_result(app_client, url, body_data) - # test watchpoint list - url = 'retrieve' - body_data = {'mode': 'watchpoint'} - expect_file = 'create_and_delete_watchpoint.json' - if self.save_results: - send_and_save_result(app_client, url, body_data, expect_file) - send_and_compare_result(app_client, url, body_data, expect_file) - send_terminate_cmd(app_client) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_update_watchpoint(self, app_client): - """Test retrieve when train_begin.""" - watch_point_id = 1 - leaf_node_name = 'Default/optimizer-Momentum/Parameter[18]_7/moments.fc3.bias' - with self._debugger_client.get_thread_instance(): - check_state(app_client) - condition = {'id': 'tensor_too_large', 'params': [{'name': 'max_gt', 'value': 1.0}]} - create_watchpoint(app_client, condition, watch_point_id) - # update watchpoint watchpoint list - url = 'update-watchpoint' - body_data = {'watch_point_id': watch_point_id, - 'watch_nodes': [leaf_node_name], - 'mode': 1} - get_request_result(app_client, url, body_data) - # get updated nodes - url = 'search' - body_data = {'name': leaf_node_name, 'watch_point_id': watch_point_id} - expect_file = 'search_unwatched_leaf_node.json' - if self.save_results: - send_and_save_result(app_client, url, body_data, expect_file, method='get') - send_and_compare_result(app_client, url, body_data, expect_file, method='get') - send_terminate_cmd(app_client) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_retrieve_tensor_history(self, app_client): - """Test retrieve tensor value.""" - node_name = 'Default/TransData-op99' - with self._debugger_client.get_thread_instance(): - check_state(app_client) - # prepare tensor value - url = 'tensor-history' - body_data = {'name': node_name, 'rank_id': 0} - expect_file = 'retrieve_empty_tensor_history.json' - if self.save_results: - send_and_save_result(app_client, url, body_data, expect_file) - send_and_compare_result(app_client, url, body_data, expect_file) - # check full tensor history from poll data - res = get_request_result( - app_client=app_client, url='poll-data', body_data={'pos': 0}, method='get') - assert res.get('receive_tensor', {}).get('node_name') == node_name, 'Node name unmatched.' - expect_file = 'retrieve_full_tensor_history.json' - if self.save_results: - send_and_save_result(app_client, url, body_data, expect_file) - send_and_compare_result(app_client, url, body_data, expect_file) - send_terminate_cmd(app_client) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_retrieve_tensor_value(self, app_client): - """Test retrieve tensor value.""" - node_name = 'Default/TransData-op99' - with self._debugger_client.get_thread_instance(): - check_state(app_client) - # prepare tensor value - url = 'tensor-history' - body_data = {'name': node_name, 'rank_id': 0} - get_request_result(app_client, url, body_data, method='post') - get_request_result(app_client=app_client, url='poll-data', body_data={'pos': 0}, method='get') - url = 'tensors' - body_data = { - 'name': node_name + ':0', - 'detail': 'data', - 'shape': '[1, 1:3]' - } - get_request_result(app_client, url, body_data, method='GET') - # sleep 0.01 second to wait the tensor update. - time.sleep(0.01) - res = get_request_result( - app_client=app_client, url='poll-data', body_data={'pos': 0}, method='get') - assert res.get('receive_tensor', {}).get('node_name') == node_name, 'Node name unmatched.' - expect_file = 'retrieve_tensor_value.json' - if self.save_results: - send_and_save_result(app_client, url, body_data, expect_file, method='get') - send_and_compare_result(app_client, url, body_data, expect_file, method='get') - send_terminate_cmd(app_client) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_compare_tensor_value(self, app_client): - """Test compare tensor value.""" - node_name = 'Default/args0' - with self._debugger_client.get_thread_instance(): - check_state(app_client) - # prepare tensor values - url = 'control' - body_data = {'mode': 'continue', - 'steps': 2} - get_request_result(app_client, url, body_data) - check_state(app_client) - get_request_result( - app_client=app_client, url='tensor-history', body_data={'name': node_name, 'rank_id': 0}) - res = get_request_result( - app_client=app_client, url='poll-data', body_data={'pos': 0}, method='get') - assert res.get('receive_tensor', {}).get('node_name') == node_name, 'Node name unmatched.' - # get compare results - url = 'tensor-comparisons' - body_data = { - 'name': node_name + ':0', - 'detail': 'data', - 'shape': '[:, :]', - 'tolerance': 1, - 'rank_id': 0} - get_request_result(app_client, url, body_data, method='GET') - # sleep 0.01 second to wait the tensor update. - time.sleep(0.01) - res = get_request_result( - app_client=app_client, url='poll-data', body_data={'pos': 0}, method='get') - assert res.get('receive_tensor', {}).get('node_name') == node_name, 'Node name unmatched.' - expect_file = 'compare_tensors.json' - if self.save_results: - send_and_save_result(app_client, url, body_data, expect_file, method='get') - send_and_compare_result(app_client, url, body_data, expect_file, method='get') - send_terminate_cmd(app_client) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_pause(self, app_client): - """Test pause the training.""" - with self._debugger_client.get_thread_instance(): - check_state(app_client) - # send run command to execute to next node - url = 'control' - body_data = {'mode': 'continue', - 'steps': -1} - res = get_request_result(app_client, url, body_data) - assert res == {'metadata': {'state': 'sending', 'enable_recheck': False}} - # send pause command - check_state(app_client, 'running') - url = 'control' - body_data = {'mode': 'pause'} - res = get_request_result(app_client, url, body_data) - assert res == {'metadata': {'state': 'sending', 'enable_recheck': False}} - send_terminate_cmd(app_client) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - @pytest.mark.parametrize("url, body_data, enable_recheck", [ - ('create-watchpoint', - {'condition': {'id': 'tensor_too_large', 'params': [{'name': 'max_gt', 'value': 1.0}]}, - 'watch_nodes': ['Default']}, True), - ('update-watchpoint', - {'watch_point_id': 1, 'watch_nodes': ['Default/optimizer-Momentum/Parameter[18]_7'], - 'mode': 1}, True), - ('update-watchpoint', - {'watch_point_id': 1, 'watch_nodes': ['Default/optimizer-Momentum'], - 'mode': 1}, True), - ('delete-watchpoint', {}, True) - ]) - def test_recheck(self, app_client, url, body_data, enable_recheck): - """Test recheck.""" - with self._debugger_client.get_thread_instance(): - create_watchpoint_and_wait(app_client) - # create watchpoint - res = get_request_result(app_client, url, body_data, method='post') - assert res['metadata']['enable_recheck'] is enable_recheck - send_terminate_cmd(app_client) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_recommend_watchpoints(self, app_client): - """Test generating recommended watchpoints.""" - original_value = settings.ENABLE_RECOMMENDED_WATCHPOINTS - settings.ENABLE_RECOMMENDED_WATCHPOINTS = True - try: - with self._debugger_client.get_thread_instance(): - check_state(app_client) - url = 'retrieve' - body_data = {'mode': 'watchpoint'} - expect_file = 'recommended_watchpoints_at_startup.json' - send_and_compare_result(app_client, url, body_data, expect_file, method='post') - send_terminate_cmd(app_client) - finally: - settings.ENABLE_RECOMMENDED_WATCHPOINTS = original_value - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - @pytest.mark.parametrize("body_data, expect_file", [ - ({'tensor_name': 'Default/TransData-op99:0', 'graph_name': 'graph_0'}, 'retrieve_tensor_graph-0.json'), - ({'tensor_name': 'Default/optimizer-Momentum/Parameter[18]_7/moments.fc1.bias:0', 'graph_name': 'graph_0'}, - 'retrieve_tensor_graph-1.json') - ]) - def test_retrieve_tensor_graph(self, app_client, body_data, expect_file): - """Test retrieve tensor graph.""" - url = 'tensor-graphs' - with self._debugger_client.get_thread_instance(): - create_watchpoint_and_wait(app_client) - get_request_result(app_client, url, body_data, method='GET') - # sleep 0.01 second to wait the tensor update. - time.sleep(0.01) - # check full tensor history from poll data - res = get_request_result( - app_client=app_client, url='poll-data', body_data={'pos': 0}, method='get') - assert res.get('receive_tensor', {}).get('tensor_name') == body_data.get('tensor_name') - if self.save_results: - send_and_save_result(app_client, url, body_data, expect_file, method='GET') - send_and_compare_result(app_client, url, body_data, expect_file, method='GET') - send_terminate_cmd(app_client) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_load(self, app_client): - """Test load.""" - node_name = 'Default/TransData-op99' - with self._debugger_client.get_thread_instance(): - check_state(app_client) - # prepare tensor value - url = 'tensor-history' - body_data = {'name': node_name, 'rank_id': 0} - get_request_result(app_client, url, body_data, method='post') - get_request_result(app_client=app_client, url='poll-data', body_data={'pos': 0}, method='get') - - url = 'tensor-files/load' - body_data = {'name': 'Default/TransData-op99:0', 'rank_id': 0} - - res = get_request_result(app_client, url, body_data, method='post') - assert res == {'node_name': 'Default/TransData-op99:0'} - - time.sleep(0.01) - res = get_request_result( - app_client=app_client, url='poll-data', body_data={'pos': 0}, method='get') - assert res.get('receive_tensor', {}).get('node_name') == node_name, 'Node name unmatched.' - - send_terminate_cmd(app_client) - - -class TestGPUDebugger: - """Test debugger on Ascend backend.""" - - @classmethod - def setup_class(cls): - """Setup class.""" - cls.save_results = False - cls._debugger_client = MockDebuggerClient(backend='GPU') - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_next_node_on_gpu(self, app_client): - """Test get next node on GPU.""" - with self._debugger_client.get_thread_instance(): - check_state(app_client) - # send run command to get watchpoint hit - url = 'control' - body_data = {'mode': 'continue', - 'level': 'node', - 'name': 'Default/TransData-op99'} - res = get_request_result(app_client, url, body_data) - assert res == {'metadata': {'state': 'sending', 'enable_recheck': False}} - # get metadata - check_state(app_client) - url = 'retrieve' - body_data = {'mode': 'all'} - expect_file = 'retrieve_next_node_on_gpu.json' - if self.save_results: - send_and_save_result(app_client, url, body_data, expect_file) - send_and_compare_result(app_client, url, body_data, expect_file) - send_terminate_cmd(app_client) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - @pytest.mark.parametrize("url, body_data, enable_recheck", [ - ('create-watchpoint', - {'condition': {'id': 'tensor_too_large', 'params': [{'name': 'max_gt', 'value': 1.0}]}, - 'watch_nodes': ['Default']}, True), - ('create-watchpoint', - {'condition': {'id': 'tensor_too_large', 'params': [{'name': 'max_gt', 'value': 1.0}]}, - 'watch_nodes': ['Default/TransData-op99']}, True), - ('update-watchpoint', - {'watch_point_id': 1, 'watch_nodes': ['Default/optimizer-Momentum/Parameter[18]_7'], - 'mode': 1}, True), - ('update-watchpoint', - {'watch_point_id': 1, 'watch_nodes': ['Default/optimizer-Momentum'], - 'mode': 1}, True), - ('update-watchpoint', - [{'watch_point_id': 1, 'watch_nodes': ['Default/optimizer-Momentum'], - 'mode': 1}, - {'watch_point_id': 1, 'watch_nodes': ['Default/optimizer-Momentum'], - 'mode': 0} - ], True), - ('update-watchpoint', - [{'watch_point_id': 1, 'watch_nodes': ['Default/TransData-op99'], - 'mode': 1}, - {'watch_point_id': 1, 'watch_nodes': ['Default/TransData-op99'], - 'mode': 0} - ], True), - ('delete-watchpoint', {'watch_point_id': 1}, True) - ]) - def test_recheck_state(self, app_client, url, body_data, enable_recheck): - """Test update watchpoint and check the value of enable_recheck.""" - with self._debugger_client.get_thread_instance(): - create_watchpoint_and_wait(app_client) - if not isinstance(body_data, list): - body_data = [body_data] - for sub_body_data in body_data: - res = get_request_result(app_client, url, sub_body_data, method='post') - assert res['metadata']['enable_recheck'] is enable_recheck - send_terminate_cmd(app_client) - - def test_get_conditions(self, app_client): - """Test get conditions for gpu.""" - url = '/v1/mindinsight/debugger/sessions/0/condition-collections' - body_data = {} - expect_file = 'get_conditions_for_gpu.json' - with self._debugger_client.get_thread_instance(): - check_state(app_client) - if self.save_results: - send_and_save_result(app_client, url, body_data, expect_file, method='get', full_url=True) - send_and_compare_result(app_client, url, body_data, expect_file, method='get', full_url=True) - send_terminate_cmd(app_client) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - def test_recheck(self, app_client): - """Test recheck request.""" - with self._debugger_client.get_thread_instance(): - create_watchpoint_and_wait(app_client) - # send recheck when disable to do recheck - get_request_result(app_client, 'recheck', {}, method='post', expect_code=400) - # send recheck when enable to do recheck - create_watchpoint(app_client, {'id': 'tensor_too_large', 'params': [{'name': 'max_gt', 'value': 1.0}]}, 2) - res = get_request_result(app_client, 'recheck', {}, method='post') - assert res['metadata']['enable_recheck'] is False - - send_terminate_cmd(app_client) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - @pytest.mark.parametrize("filter_condition, expect_file", [ - ({'name': 'fc', 'node_category': 'weight'}, 'search_weight.json'), - ({'name': 'fc', 'node_category': 'gradient'}, 'search_gradient.json'), - ({'node_category': 'activation'}, 'search_activation.json') - ]) - def test_search_by_category(self, app_client, filter_condition, expect_file): - """Test recheck request.""" - with self._debugger_client.get_thread_instance(): - check_state(app_client) - send_and_compare_result(app_client, 'search', filter_condition, expect_file, - method='get') - send_terminate_cmd(app_client) - - -class TestMultiGraphDebugger: - """Test debugger on Ascend backend for multi_graph.""" - - @classmethod - def setup_class(cls): - """Setup class.""" - cls.save_results = False - cls._debugger_client = MockDebuggerClient(backend='Ascend', graph_num=2) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - @pytest.mark.parametrize("body_data, expect_file", [ - ({'mode': 'all'}, 'multi_retrieve_all.json'), - ({'mode': 'node', 'params': {'name': 'Default', 'graph_name': 'graph_1'}}, 'retrieve_scope_node.json'), - ({'mode': 'node', 'params': {'name': 'graph_0'}}, 'multi_retrieve_scope_node.json'), - ({'mode': 'node', 'params': {'name': 'graph_0/Default/optimizer-Momentum/Parameter[18]_7'}}, - 'multi_retrieve_aggregation_scope_node.json'), - ({'mode': 'node', 'params': { - 'name': 'graph_0/Default/TransData-op99', - 'single_node': True}}, 'multi_retrieve_single_node.json'), - ({'mode': 'node', 'params': { - 'name': 'Default/TransData-op99', - 'single_node': True, 'graph_name': 'graph_0'}}, 'retrieve_single_node.json') - ]) - def test_multi_retrieve_when_train_begin(self, app_client, body_data, expect_file): - """Test retrieve when train_begin.""" - url = 'retrieve' - check_state(app_client, 'pending') - with self._debugger_client.get_thread_instance(): - check_state(app_client) - if self.save_results: - send_and_save_result(app_client, url, body_data, expect_file) - send_and_compare_result(app_client, url, body_data, expect_file) - send_terminate_cmd(app_client) - - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - @pytest.mark.parametrize("filter_condition, expect_file", [ - ({'name': '', 'node_category': 'weight'}, 'search_weight_multi_graph.json'), - ({'node_category': 'activation'}, 'search_activation_multi_graph.json'), - ({'node_category': 'gradient'}, 'search_gradient_multi_graph.json') - ]) - def test_search_by_category_with_multi_graph(self, app_client, filter_condition, expect_file): - """Test search by category request.""" - with self._debugger_client.get_thread_instance(): - check_state(app_client) - if self.save_results: - send_and_save_result(app_client, 'search', filter_condition, expect_file, method='get') - send_and_compare_result(app_client, 'search', filter_condition, expect_file, method='get') - send_terminate_cmd(app_client) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - @pytest.mark.parametrize("filter_condition, expect_id", [ - ({'condition': {'id': 'tensor_too_large', 'params': [{'name': 'max_gt', 'value': 1.0}]}, - 'watch_nodes': ['Default/optimizer-Momentum/Parameter[18]_7'], - 'graph_name': 'graph_0'}, 1), - ({'condition': {'id': 'tensor_too_large', 'params': [{'name': 'max_gt', 'value': 1.0}]}, - 'watch_nodes': ['graph_0/Default/optimizer-Momentum/ApplyMomentum[8]_1'], - 'graph_name': None}, 1) - ]) - def test_create_watchpoint(self, app_client, filter_condition, expect_id): - """Test create watchpoint with multiple graphs.""" - url = 'create-watchpoint' - with self._debugger_client.get_thread_instance(): - check_state(app_client) - res = get_request_result(app_client, url, filter_condition) - assert res.get('id') == expect_id - send_terminate_cmd(app_client) - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - @pytest.mark.parametrize("params, expect_file", [ - ({'level': 'node'}, 'multi_next_node.json'), - ({'level': 'node', 'node_name': 'graph_0/Default/TransData-op99'}, 'multi_next_node.json'), - ({'level': 'node', 'node_name': 'Default/TransData-op99', 'graph_name': 'graph_0'}, - 'multi_next_node.json') - ]) - def test_continue_on_gpu(self, app_client, params, expect_file): - """Test get next node on GPU.""" - gpu_debugger_client = MockDebuggerClient(backend='GPU', graph_num=2) - original_value = settings.ENABLE_RECOMMENDED_WATCHPOINTS - settings.ENABLE_RECOMMENDED_WATCHPOINTS = True - try: - with gpu_debugger_client.get_thread_instance(): - check_state(app_client) - # send run command to get watchpoint hit - url = 'control' - body_data = {'mode': 'continue'} - body_data.update(params) - res = get_request_result(app_client, url, body_data) - assert res == {'metadata': {'state': 'sending', 'enable_recheck': False}} - # get metadata - check_state(app_client) - url = 'retrieve' - body_data = {'mode': 'all'} - if self.save_results: - send_and_save_result(app_client, url, body_data, expect_file) - send_and_compare_result(app_client, url, body_data, expect_file) - send_terminate_cmd(app_client) - finally: - settings.ENABLE_RECOMMENDED_WATCHPOINTS = original_value - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - @pytest.mark.parametrize("body_data, expect_file", [ - ({'tensor_name': 'Default/TransData-op99:0', 'graph_name': 'graph_0'}, 'retrieve_tensor_hits-0.json'), - ({'tensor_name': 'Default/optimizer-Momentum/Parameter[18]_7/moments.fc1.bias:0', 'graph_name': 'graph_0'}, - 'retrieve_tensor_hits-1.json') - ]) - def test_retrieve_tensor_hits(self, app_client, body_data, expect_file): - """Test retrieve tensor graph.""" - url = 'tensor-hits' - with self._debugger_client.get_thread_instance(): - check_state(app_client) - if self.save_results: - send_and_save_result(app_client, url, body_data, expect_file, method='GET') - send_and_compare_result(app_client, url, body_data, expect_file, method='GET') - send_terminate_cmd(app_client) - - -def create_watchpoint(app_client, condition, expect_id): - """Create watchpoint.""" - url = 'create-watchpoint' - body_data = {'condition': condition, - 'watch_nodes': ['Default/optimizer-Momentum/Parameter[18]_7', - 'Default/optimizer-Momentum/Parameter[18]_7/moments.fc3.bias', - 'Default/optimizer-Momentum/Parameter[18]_7/moments.fc1.bias', - 'Default/TransData-op99']} - res = get_request_result(app_client, url, body_data) - assert res.get('id') == expect_id - - -def create_watchpoint_and_wait(app_client): - """Preparation for recheck.""" - check_state(app_client) - create_watchpoint(app_client, condition={'id': 'tensor_too_large', 'params': [{'name': 'max_gt', 'value': 1.0}]}, - expect_id=1) - # send run command to get watchpoint hit - url = 'control' - body_data = {'mode': 'continue', - 'steps': 2} - res = get_request_result(app_client, url, body_data) - assert res == {'metadata': {'state': 'sending', 'enable_recheck': False}} - # wait for server has received watchpoint hit - check_state(app_client) - - -class TestMismatchDebugger: - """Test debugger when Mindinsight and Mindspore is mismatched.""" - - @classmethod - def setup_class(cls): - """Setup class.""" - cls._debugger_client = MockDebuggerClient(backend='Ascend', ms_version='1.0.0') - - @pytest.mark.level0 - @pytest.mark.env_single - @pytest.mark.platform_x86_cpu - @pytest.mark.platform_arm_ascend_training - @pytest.mark.platform_x86_gpu_training - @pytest.mark.platform_x86_ascend_training - @pytest.mark.parametrize("body_data, expect_file", [ - ({'mode': 'all'}, 'version_mismatch.json') - ]) - def test_retrieve_when_version_mismatch(self, app_client, body_data, expect_file): - """Test retrieve when train_begin.""" - url = 'retrieve' - with self._debugger_client.get_thread_instance(): - check_state(app_client, ServerStatus.MISMATCH.value) - send_and_compare_result(app_client, url, body_data, expect_file) - send_terminate_cmd(app_client) diff --git a/tests/st/func/debugger/utils.py b/tests/st/func/debugger/utils.py deleted file mode 100644 index f64e3b76..00000000 --- a/tests/st/func/debugger/utils.py +++ /dev/null @@ -1,291 +0,0 @@ -# Copyright 2020-2022 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Test debugger server utils.""" -import json -import os -import csv -import stat -import shutil -import tempfile -import time -from pathlib import Path -import numpy as np - -from mindinsight.domain.graph.proto import ms_graph_pb2 -from tests.st.func.debugger.conftest import DEBUGGER_EXPECTED_RESULTS, DEBUGGER_BASE_URL, GRAPH_PROTO_FILE -from tests.utils.tools import compare_result_with_file, get_url - - -def check_state(app_client, server_state='waiting'): - """Check if the Server is ready.""" - url = 'retrieve' - body_data = {'mode': 'all'} - max_try_times = 30 - count = 0 - flag = False - while count < max_try_times: - res = get_request_result(app_client, url, body_data) - state = res.get('metadata', {}).get('state') - if state == server_state: - flag = True - break - count += 1 - time.sleep(0.1) - assert flag is True - - -def check_offline_dbg_server_state(app_client, session_id, server_state='waiting'): - """Check if the Server is ready.""" - url = os.path.join(os.path.join('/v1/mindinsight/debugger/sessions/', session_id), 'retrieve') - body_data = {'mode': 'all'} - max_try_times = 30 - count = 0 - flag = False - while count < max_try_times: - res = get_request_result(app_client, url, body_data, full_url=True) - state = res.get('metadata', {}).get('state') - if state == server_state: - flag = True - break - count += 1 - time.sleep(0.1) - assert flag is True - - -def get_request_result(app_client, url, body_data, method='post', expect_code=200, full_url=False): - """Get request result.""" - if not full_url: - real_url = os.path.join(DEBUGGER_BASE_URL, url) - else: - real_url = url - if method == 'post': - response = app_client.post(real_url, data=json.dumps(body_data)) - else: - real_url = get_url(real_url, body_data) - response = app_client.get(real_url) - assert response.status_code == expect_code - res = response.get_json() - return res - - -def send_and_compare_result(app_client, url, body_data, expect_file=None, method='post', full_url=False, - expect_file_dir='restful_results'): - """Send and compare result.""" - res = get_request_result(app_client, url, body_data, method=method, full_url=full_url) - delete_random_items(res) - if expect_file: - real_path = os.path.join(DEBUGGER_EXPECTED_RESULTS, expect_file_dir, expect_file) - compare_result_with_file(res, real_path) - - -def send_and_save_result(app_client, url, body_data, file_path, method='post', full_url=False, - expect_file_dir='restful_results'): - """Send and save result.""" - res = get_request_result(app_client, url, body_data, method=method, full_url=full_url) - delete_random_items(res) - real_path = os.path.join(DEBUGGER_EXPECTED_RESULTS, expect_file_dir, file_path) - json.dump(res, open(real_path, 'w')) - - -def delete_random_items(res): - """delete the random items in metadata.""" - if isinstance(res, dict): - if res.get('metadata'): - if res['metadata'].get('ip'): - res['metadata'].pop('ip') - if res['metadata'].get('pos'): - res['metadata'].pop('pos') - if res['metadata'].get('debugger_version') and res['metadata']['debugger_version'].get('mi'): - res['metadata']['debugger_version'].pop('mi') - res['metadata']['debugger_version'].pop('ms') - if res['metadata'].get('data_version') and res['metadata']['data_version'].get('mi'): - res['metadata']['data_version'].pop('mi') - res['metadata']['data_version'].pop('ms') - res['metadata']['data_version'].pop('state') - if res.get('devices'): - for device in res.get('devices'): - if device.get('server_ip'): - device.pop('server_ip') - - -def build_dump_file_structure(): - """Build the dump file structure.""" - debugger_tmp_dir = tempfile.mkdtemp(suffix='debugger_tmp') - build_dump_structue(debugger_tmp_dir, 'Ascend/async', step_num=3, graph_id=1) - build_dump_structue(debugger_tmp_dir, 'Ascend/sync', step_num=4, graph_id=0) - build_dump_structue(debugger_tmp_dir, 'GPU/sync', step_num=3, graph_id=0) - return debugger_tmp_dir - - -def build_dump_structue(base_dir, dump_name, step_num, graph_id): - """Build the dump file structure.""" - dump_dir = os.path.join(base_dir, dump_name) - gen = DumpStructureGenerator(dump_dir) - gen.generate(rank_num=2, - root_graphs={graph_id: {}}, - history={}, - dump_steps={graph_id: list(range(step_num))}) - - -def build_multi_net_dump_structure(dump_name=None, create_tensor=False, create_statistic=False): - """Build the multi-net dump file structure.""" - debugger_tmp_dir = tempfile.mkdtemp(suffix='debugger_tmp') - dump_dir = os.path.join(debugger_tmp_dir, dump_name) if dump_name else debugger_tmp_dir - gen = DumpStructureGenerator(dump_dir) - gen.generate(rank_num=2, create_tensor=create_tensor, create_statistic=create_statistic) - return debugger_tmp_dir - - -def write_graph(model, dst_graph_file, graph_name=None, root_name=None): - """Write graph file.""" - src_graph_proto = model.graph - if graph_name: - src_graph_proto.name = graph_name - if root_name: - src_graph_proto.root_name = root_name - dst_graph_str = model.SerializeToString() - with open(dst_graph_file, 'wb') as file_handler: - file_handler.write(dst_graph_str) - - -class DumpStructureGenerator: - """Generate Dump structure.""" - - def __init__(self, dump_dir, sync=True): - self._dump_dir = Path(dump_dir) - self._dump_mode = 'sync' if sync else 'async' - - @staticmethod - def generate_dump_metadata(rank_dir, dump_mode): - """Generate .dump_metadata dir.""" - temp_metadata_dir = os.path.join(os.path.dirname(__file__), 'dump_files', - 'Ascend', dump_mode, 'rank_0', '.dump_metadata') - shutil.copytree(temp_metadata_dir, rank_dir / '.dump_metadata') - - @staticmethod - def generate_graphs(rank_dir, root_graphs): - """Generate graph dir.""" - if root_graphs is None: - root_graphs = {0: {'graph_name': 'kernel_graph_0', - 'sub_graph_names': ['kernel_graph_1', 'kernel_graph_2']}, - 3: {'graph_name': 'kernel_graph_3'}} - graph_dir = rank_dir / 'graphs' - graph_dir.mkdir() - with open(GRAPH_PROTO_FILE, 'rb') as file_handler: - content = file_handler.read() - model = ms_graph_pb2.ModelProto() - model.graph.ParseFromString(content) - # if graph_num is greater than 1, all graphs except last one are belong to root graph 0. - for graph_id, root_graph in root_graphs.items(): - graph_file = graph_dir / f'ms_output_trace_code_graph_{graph_id}.pb' - if root_graph: - write_graph(model, graph_file, root_graph.get('graph_name'), str(graph_id)) - for sub_graph_name in root_graph.get('sub_graph_names', []): - sub_graph_id = sub_graph_name.split('_')[-1] - graph_file = graph_dir / f'ms_output_trace_code_graph_{sub_graph_id}.pb' - write_graph(model, graph_file, sub_graph_name, str(graph_id)) - else: - write_graph(model, graph_file) - - @staticmethod - def generate_execution(rank_dir, history): - """Generate execution directory.""" - if history is None: - history = {0: [0, 2, 4], - 3: [1, 3, 5, 6]} - exec_dir = rank_dir / 'execution_order' - exec_dir.mkdir() - for graph_id, exec_counts in history.items(): - file = exec_dir / f'ms_global_execution_order_graph_{graph_id}.csv' - with open(file, 'w') as handle: - for count in exec_counts: - handle.write(str(count) + '\n') - - @staticmethod - def generate_dump_steps(rank_dir, dump_steps=None, create_tensor=False, create_statistic=False): - """Generate dump steps.""" - if dump_steps is None: - dump_steps = {0: [0, 4], 3: [1, 6]} - net_dir = rank_dir / 'Lenet' - net_dir.mkdir() - for graph_id, steps in dump_steps.items(): - graph_dir = net_dir / str(graph_id) - graph_dir.mkdir() - for step in steps: - step_dir = graph_dir / str(step) - step_dir.mkdir() - # Create tensor file in the graph 0 directory. - if graph_id == 0 and create_tensor: - time_stamp0 = int(time.time()) - conv_name = 'Conv2D.Conv2D-op1.0.0.' + str(time_stamp0) + '.output.0.DefaultFormat.npy' - tensor0_dir = step_dir / conv_name - conv_tensor = np.zeros((32, 6, 28, 28), dtype=np.float32) - np.save(tensor0_dir, conv_tensor) - time_stamp1 = int(time.time()) - cast_name = 'Cast.Cast-op189.0.0.' + str(time_stamp1) + '.output.0.DefaultFormat.npy' - tensor1_dir = step_dir / cast_name - cast_tensor = np.zeros((6, 1, 5, 5), dtype=np.float32) - np.save(tensor1_dir, cast_tensor) - time_stamp2 = int(time.time()) - cast2_name = 'Cast.Cast-op190.0.0.' + str(time_stamp2) + '.output.0.DefaultFormat.npy' - tensor2_dir = step_dir / cast2_name - cast2_tensor = np.zeros((32, 1, 32, 32), dtype=np.float32) - np.save(tensor2_dir, cast2_tensor) - # Create file statistic.csv in the graph 0 directory. - if graph_id == 0 or graph_id == 3 and create_statistic: - statistic_file_name = 'statistic.csv' - statistic_dir = step_dir / statistic_file_name - flags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC - modes = stat.S_IWUSR | stat.S_IRUSR - with os.fdopen(os.open(statistic_dir, flags, modes), 'w', newline='') as f: - csv_writer = csv.writer(f) - statistic_header = ["Op Type", "Op Name", "Task ID", "Stream ID", "Timestamp", "IO", "Slot", - "Data Size", - "Data Type", "Shape", "Max Value", "Min Value", "Avg Value", "Count", - "Negative Zero Count", "Positive Zero Count", "NaN Count", - "Negative Inf Count", - "Positive Inf Count", "Zero Count"] - csv_writer.writerow(statistic_header) - conv2d_statistic = ['Conv2D', 'Conv2D-op1', 0, 0, int(time.time()), 'output', 0, - 32 * 6 * 28 * 28 * 2, - 'float32', '(32, 6, 28, 28)', 65504, -65504, 0, 32 * 6 * 28 * 28, - 10, 10, 0, 1, 1, 1000] - csv_writer.writerow(conv2d_statistic) - cast1_statistic = ['Cast', 'Cast-op189', 0, 0, int(time.time()), 'output', 0, - 6 * 1 * 5 * 5 * 2, - 'float32', '(32, 6, 28, 28)', 65504, -65504, 0, 6 * 1 * 5 * 5, - 10, 10, 0, 1, 1, 1000] - csv_writer.writerow(cast1_statistic) - cast2_statistic = ['Cast', 'Cast-op190', 0, 0, int(time.time()), 'output', 0, - 32 * 1 * 32 * 32 * 2, - 'float32', '(32, 6, 28, 28)', 65504, -65504, 0, 32 * 1 * 32 * 32, - 10, 10, 0, 1, 1, 1000] - csv_writer.writerow(cast2_statistic) - - def generate(self, root_graphs=None, rank_num=1, history=None, dump_steps=None, create_tensor=False, - create_statistic=False): - """Generate dump structure.""" - for rank_id in range(rank_num): - rank_dir = self._dump_dir / f'rank_{rank_id}' - rank_dir.mkdir(parents=True) - self.generate_dump_metadata(rank_dir, self._dump_mode) - self.generate_graphs(rank_dir, root_graphs) - self.generate_execution(rank_dir, history) - self.generate_dump_steps(rank_dir, dump_steps, create_tensor, create_statistic) - - def clean(self): - """Clean cache.""" - if self._dump_dir.is_dir(): - shutil.rmtree(self._dump_dir) diff --git a/tests/ut/debugger/__init__.py b/tests/ut/debugger/__init__.py deleted file mode 100644 index c6e0e62c..00000000 --- a/tests/ut/debugger/__init__.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -Function: - Unit test for debugger module. -Usage: - pytest tests/ut/debugger/ -""" diff --git a/tests/ut/debugger/configurations.py b/tests/ut/debugger/configurations.py deleted file mode 100644 index feedf66f..00000000 --- a/tests/ut/debugger/configurations.py +++ /dev/null @@ -1,171 +0,0 @@ -# Copyright 2020-2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Common configurations for debugger unit testing.""" -import json -import os - -from google.protobuf import json_format - -from mindinsight.debugger.stream_handler.graph_handler import GraphHandler, MultiCardGraphHandler -from mindinsight.debugger.stream_handler.watchpoint_handler import WatchpointHitHandler -from mindinsight.domain.graph.proto import ms_graph_pb2 -from tests.utils.tools import compare_result_with_file - -GRAPH_PROTO_FILE = os.path.join( - os.path.dirname(__file__), '../../utils/resource/graph_pb/lenet.pb' -) -DEBUGGER_EXPECTED_RESULTS = os.path.join(os.path.dirname(__file__), 'expected_results') - - -def get_graph_proto(): - """Get graph proto.""" - with open(GRAPH_PROTO_FILE, 'rb') as f: - content = f.read() - - graph = ms_graph_pb2.GraphProto() - graph.ParseFromString(content) - - return graph - - -def init_graph_handler(): - """Init GraphHandler.""" - graph = get_graph_proto() - graph_handler = GraphHandler() - graph_handler.put({graph.name: graph}) - - return graph_handler - - -def init_multi_card_graph_handler(): - """Init GraphHandler.""" - graph = get_graph_proto() - multi_card_graph_handler = MultiCardGraphHandler() - multi_card_graph_handler.put({0: {graph.name: graph}, 1: {graph.name: graph}}) - - return multi_card_graph_handler - - -def init_watchpoint_hit_handler(values): - """Init WatchpointHitHandler.""" - wph_handler = WatchpointHitHandler() - for value in values: - wph_handler.put(value) - - return wph_handler - - -def get_node_basic_infos(node_names): - """Get node info according to node names.""" - if not node_names: - return [] - graph_stream = init_graph_handler() - graph_name = graph_stream.graph_names[0] - node_infos = [] - for node_name in node_names: - node_infos.append(graph_stream.get_node_basic_info(node_name, graph_name)) - return node_infos - - -def get_watch_nodes_by_search(watch_nodes): - """Get watched leaf nodes by search name.""" - watched_leaf_nodes = [] - graph_stream = init_graph_handler() - graph_name = graph_stream.graph_names[0] - for search_name in watch_nodes: - search_node_info = graph_stream.get_node_basic_info_by_scope(search_name, graph_name) - watched_leaf_nodes.extend(search_node_info) - - return watched_leaf_nodes - - -def mock_tensor_proto(): - """Mock tensor proto.""" - tensor_dict = { - "node_name": - "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92", - "slot": "0" - } - tensor_proto = json_format.Parse(json.dumps(tensor_dict), ms_graph_pb2.TensorProto()) - - return tensor_proto - - -def mock_tensor_history(): - """Mock tensor history.""" - tensor_history = { - "tensor_history": [ - {"name": "Default/TransData-op99:0", - "full_name": "Default/TransData-op99:0", - "graph_name": "kernel_graph_0", - "node_type": "TransData", - "type": "output", - "step": 0, - "dtype": "DT_FLOAT32", - "shape": [2, 3], - "has_prev_step": False, - "value": "click to view"}, - {"name": "Default/args0:0", - "full_name": "Default/args0:0", - "graph_name": "kernel_graph_0", - "node_type": "Parameter", - "type": "input", - "step": 0, - "dtype": "DT_FLOAT32", - "shape": [2, 3], - "has_prev_step": False, - "value": "click to view"} - ], - "metadata": { - "state": "waiting", - "step": 0, - "device_name": "0", - "pos": "0", - "ip": "127.0.0.1:57492", - "node_name": "", - "backend": "Ascend" - } - } - - return tensor_history - - -class WatchpointHit: - """Watchpoint hit structure.""" - def __init__(self, name, slot, condition, watchpoint_id, parameters, error_code, rank_id, root_graph_id): - self.name = name - self.slot = slot - self.condition = condition - self.watchpoint_id = watchpoint_id - self.parameters = parameters - self.error_code = error_code - self.rank_id = rank_id - self.root_graph_id = root_graph_id - - -def compare_debugger_result_with_file(res, expect_file, save=False): - """ - Compare debugger result with file. - - Args: - res (dict): The debugger result in dict type. - expect_file: The expected file name. - """ - real_path = os.path.join(DEBUGGER_EXPECTED_RESULTS, expect_file) - if save: - with open(real_path, 'w') as file_handler: - json.dump(res, file_handler) - else: - compare_result_with_file(res, real_path) diff --git a/tests/ut/debugger/expected_results/debugger_server/retrieve_all.json b/tests/ut/debugger/expected_results/debugger_server/retrieve_all.json deleted file mode 100644 index 1f608e21..00000000 --- a/tests/ut/debugger/expected_results/debugger_server/retrieve_all.json +++ /dev/null @@ -1 +0,0 @@ -{"metadata": {"state": "waiting", "step": 0, "device_name": "", "pos": "0", "ip": "", "node_name": "", "backend": "", "enable_recheck": false, "graph_name": "", "recommendation_confirmed": false, "debugger_version": {}, "data_version": {}}, "graph": {}, "devices": [{"rank_id": 0, "server_ip": "", "device_id": "", "graph_names": []}], "watch_points": []} \ No newline at end of file diff --git a/tests/ut/debugger/expected_results/debugger_server/retrieve_tensor_history.json b/tests/ut/debugger/expected_results/debugger_server/retrieve_tensor_history.json deleted file mode 100644 index ad608779..00000000 --- a/tests/ut/debugger/expected_results/debugger_server/retrieve_tensor_history.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "tensor_history": [ - { - "name": "Default/TransData-op99:0", - "full_name": "Default/TransData-op99:0", - "graph_name": "kernel_graph_0", - "node_type": "TransData", - "type": "output", - "step": 0, - "dtype": "DT_FLOAT32", - "shape": [ - 2, - 3 - ], - "has_prev_step": false, - "value": "click to view" - }, - { - "name": "Default/args0:0", - "full_name": "Default/args0:0", - "graph_name": "kernel_graph_0", - "node_type": "Parameter", - "type": "input", - "step": 0, - "dtype": "DT_FLOAT32", - "shape": [ - 2, - 3 - ], - "has_prev_step": false, - "value": "click to view" - } - ], - "metadata": { - "step": 0 - } -} \ No newline at end of file diff --git a/tests/ut/debugger/expected_results/graph/get_tensor_graph-0.json b/tests/ut/debugger/expected_results/graph/get_tensor_graph-0.json deleted file mode 100644 index 42ea736e..00000000 --- a/tests/ut/debugger/expected_results/graph/get_tensor_graph-0.json +++ /dev/null @@ -1 +0,0 @@ -{"graph": {"nodes": [{"name": "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/args1", "full_name": "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/args1", "type": "Parameter", "input": {}, "output": {"Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/OneHot-op0": {"shape": [[32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_INT32]", "slot_mapping": [["0", ""]]}}, "slots": [{"slot": "0"}], "stack_info": []}, {"name": "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/cst1", "full_name": "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/cst1", "type": "Const", "input": {}, "output": {"Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/OneHot-op0": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "", "slot_mapping": [["0", ""]]}}, "slots": [{"slot": "0"}], "stack_info": []}, {"name": "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/cst2", "full_name": "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/cst2", "type": "Const", "input": {}, "output": {"Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/OneHot-op0": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "", "slot_mapping": [["0", ""]]}}, "slots": [{"slot": "0"}], "stack_info": []}, {"name": "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/SoftmaxCrossEntropyWithLogits-op18", "full_name": "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/SoftmaxCrossEntropyWithLogits-op18", "type": "SoftmaxCrossEntropyWithLogits", "input": {"Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/OneHot-op0": {"shape": [[32, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]", "slot_mapping": [["0", ""]]}}, "output": {}, "slots": [{"slot": "0"}, {"slot": "1"}], "stack_info": []}, {"name": "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/OneHot-op0", "full_name": "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/OneHot-op0", "type": "OneHot", "input": {"Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/args1": {"shape": [[32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_INT32]", "slot_mapping": [["0", ""]]}, "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/cst1": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "", "slot_mapping": [["0", ""]]}, "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/cst2": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "", "slot_mapping": [["0", ""]]}}, "output": {"Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/SoftmaxCrossEntropyWithLogits-op18": {"shape": [[32, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]", "slot_mapping": [["0", ""]]}}, "slots": [{"slot": "0"}], "stack_info": []}]}} \ No newline at end of file diff --git a/tests/ut/debugger/expected_results/graph/get_tensor_graph-1.json b/tests/ut/debugger/expected_results/graph/get_tensor_graph-1.json deleted file mode 100644 index 18882941..00000000 --- a/tests/ut/debugger/expected_results/graph/get_tensor_graph-1.json +++ /dev/null @@ -1 +0,0 @@ -{"graph": {"nodes": [{"name": "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Cast-op201", "full_name": "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Cast-op201", "type": "Cast", "input": {}, "output": {"Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op89": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]", "slot_mapping": [["0", ""]]}}, "slots": [{"slot": "0"}], "stack_info": []}, {"name": "Default/tuple_getitem[10]_0/tuple_getitem-op203", "full_name": "Default/tuple_getitem-op203", "type": "tuple_getitem", "input": {"Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op89": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']", "slot_mapping": [["0", ""], ["1", ""]]}}, "output": {}, "slots": [{"slot": "0"}], "stack_info": []}, {"name": "Default/tuple_getitem[10]_0/tuple_getitem-op202", "full_name": "Default/tuple_getitem-op202", "type": "tuple_getitem", "input": {"Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op89": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']", "slot_mapping": [["0", ""], ["1", ""]]}}, "output": {}, "slots": [{"slot": "0"}], "stack_info": []}, {"name": "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op89", "full_name": "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op89", "type": "ReLUV2", "input": {"Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Cast-op201": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]", "slot_mapping": [["0", ""]]}}, "output": {"Default/tuple_getitem[10]_0/tuple_getitem-op203": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']", "slot_mapping": [["0", ""], ["1", ""]]}, "Default/tuple_getitem[10]_0/tuple_getitem-op202": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']", "slot_mapping": [["0", ""], ["1", ""]]}}, "slots": [{"slot": "0"}, {"slot": "1"}], "stack_info": []}]}} \ No newline at end of file diff --git a/tests/ut/debugger/expected_results/graph/get_tensor_graph-2.json b/tests/ut/debugger/expected_results/graph/get_tensor_graph-2.json deleted file mode 100644 index d20cc609..00000000 --- a/tests/ut/debugger/expected_results/graph/get_tensor_graph-2.json +++ /dev/null @@ -1 +0,0 @@ -{"graph": {"nodes": [{"name": "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op7", "full_name": "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op7", "type": "MaxPoolWithArgmax", "input": {}, "output": {"Default/tuple_getitem[10]_0/tuple_getitem-op206": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']", "slot_mapping": [["0", ""], ["1", ""]]}}, "slots": [{"slot": "0"}, {"slot": "1"}], "stack_info": []}, {"name": "Default/tuple_getitem[10]_0/cst28", "full_name": "Default/tuple_getitem[10]_0/cst28", "type": "Const", "input": {}, "output": {"Default/tuple_getitem[10]_0/tuple_getitem-op206": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "", "slot_mapping": [["0", ""]]}}, "slots": [{"slot": "0"}], "stack_info": []}, {"name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46", "full_name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46", "type": "MaxPoolGradWithArgmax", "input": {"Default/tuple_getitem[10]_0/tuple_getitem-op206": {"shape": [[32, 16, 4, 3]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]", "slot_mapping": [["0", ""]]}}, "output": {}, "slots": [{"slot": "0"}], "stack_info": []}, {"name": "Default/tuple_getitem[10]_0/tuple_getitem-op206", "full_name": "Default/tuple_getitem-op206", "type": "tuple_getitem", "input": {"Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op7": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']", "slot_mapping": [["0", ""], ["1", ""]]}, "Default/tuple_getitem[10]_0/cst28": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "", "slot_mapping": [["0", ""]]}}, "output": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": {"shape": [[32, 16, 4, 3]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]", "slot_mapping": [["0", ""]]}}, "slots": [{"slot": "0"}], "stack_info": []}]}} \ No newline at end of file diff --git a/tests/ut/debugger/expected_results/graph/graph_handler_get_1_no_filter_condintion.json b/tests/ut/debugger/expected_results/graph/graph_handler_get_1_no_filter_condintion.json deleted file mode 100644 index b68d3335..00000000 --- a/tests/ut/debugger/expected_results/graph/graph_handler_get_1_no_filter_condintion.json +++ /dev/null @@ -1 +0,0 @@ -{"graph": {"graph_names": ["kernel_graph_0"], "nodes": [{"name": "Default", "type": "name_scope", "attr": {}, "input": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": {"shape": [[32, 6, 4, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": {"shape": [[32, 16, 4, 3]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[32, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20": {"shape": [[32, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92": {"shape": [[32, 1, 10, 10, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94": {"shape": [[32, 1, 28, 28, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 7, "independent_layout": false, "stack_info": []}, {"name": "Gradients", "type": "name_scope", "attr": {}, "input": {"Default/tuple_getitem[10]_0/tuple_getitem-op210": {"shape": [[32, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op15": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op12": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op205": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op206": {"shape": [[32, 16, 4, 3]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op202": {"shape": [[32, 1, 10, 10, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op197": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Cast-op188": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op195": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op196": {"shape": [[32, 6, 4, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op192": {"shape": [[32, 1, 28, 28, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/flatten-Flatten/Reshape-op9": {"shape": [[32, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op30": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op49": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op33": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op41": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 1, "independent_layout": false, "stack_info": []}]}} \ No newline at end of file diff --git a/tests/ut/debugger/expected_results/graph/graph_handler_get_2_list_nodes.json b/tests/ut/debugger/expected_results/graph/graph_handler_get_2_list_nodes.json deleted file mode 100644 index b32f98eb..00000000 --- a/tests/ut/debugger/expected_results/graph/graph_handler_get_2_list_nodes.json +++ /dev/null @@ -1 +0,0 @@ -{"graph": {"nodes": [{"name": "Default/TransData-op99", "type": "TransData", "attr": {"dst_format": "dtype: DT_STRING\nstr_val: \"NC1HWC0\"\n", "IsFeatureMapInputList": "dtype: DT_TUPLE\nvalues {\n dtype: DT_UINT64\n uint_val: 0\n}\n", "pri_format": "dtype: DT_STRING\nstr_val: \"NC1HWC0\"\n", "_datadump_original_names": "dtype: DT_TUPLE\n", "IsFeatureMapOutput": "dtype: DT_BOOL\nbool_val: true\n", "src_format": "dtype: DT_STRING\nstr_val: \"NCHW\"\n"}, "input": {"Default/args0": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false, "stack_info": []}, {"name": "Default/Depend-op61", "type": "Depend", "attr": {}, "input": {"Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/ReduceMean-op60": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/make_tuple-op58": {"shape": [[], [], [], [], [], [], [], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL']"}}, "output": {"Default/make_tuple[9]_3/make_tuple-op284": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false, "stack_info": []}, {"name": "Default/args0", "type": "Parameter", "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[32, 1, 32, 32]]"}, "input": {}, "output": {"Default/TransData-op99": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false, "stack_info": []}, {"name": "Default/tuple_getitem[10]_0", "type": "aggregation_scope", "attr": {}, "input": {"Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op87": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op3": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op89": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op7": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/SoftmaxCrossEntropyWithLogits-op18": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}}, "output": {"Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op195": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Conv2D-op5": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op205": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op208": {"shape": [[32, 16, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20": {"shape": [[32, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92": {"shape": [[32, 1, 10, 10, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": {"shape": [[32, 16, 4, 3]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94": {"shape": [[32, 1, 28, 28, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": {"shape": [[32, 6, 4, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/ReduceMean-op60": {"shape": [[32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 20, "independent_layout": false, "stack_info": []}, {"name": "Default/make_tuple[9]_3", "type": "aggregation_scope", "attr": {}, "input": {"Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op250": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op251": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op253": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op254": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op256": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op257": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op259": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op260": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op262": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op263": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op265": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op266": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op268": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op269": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op271": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op272": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/Depend-op61": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Default/optimizer-Momentum/Depend[8]_4/Depend-op23": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op26": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op31": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op34": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op39": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op42": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op50": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op57": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 9, "independent_layout": false, "stack_info": []}, {"name": "Default/network-WithLossCell", "type": "name_scope", "attr": {}, "input": {"Default/TransData-op99": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op193": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op197": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op203": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op207": {"shape": [[32, 16, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op211": {"shape": [[32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op193": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op192": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op197": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op196": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op203": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op202": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op207": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op206": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[32, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op210": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op211": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/Depend-op61": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 2, "independent_layout": false, "stack_info": []}, {"name": "Default/optimizer-Momentum", "type": "name_scope", "attr": {}, "input": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op65": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op68": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op71": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op74": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op77": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op80": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op83": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op86": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}}, "output": {"Default/Depend-op61": {"shape": [[], [], [], [], [], [], [], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL']"}, "Default/make_tuple[9]_3/make_tuple-op65": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op68": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op71": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op74": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op77": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op80": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op83": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op86": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 5, "independent_layout": false, "stack_info": []}]}} \ No newline at end of file diff --git a/tests/ut/debugger/expected_results/graph/graph_handler_get_3_single_node.json b/tests/ut/debugger/expected_results/graph/graph_handler_get_3_single_node.json deleted file mode 100644 index 9e4ce898..00000000 --- a/tests/ut/debugger/expected_results/graph/graph_handler_get_3_single_node.json +++ /dev/null @@ -1 +0,0 @@ -{"graph": {"nodes": [{"name": "Default", "type": "name_scope", "attr": {}, "input": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": {"shape": [[32, 6, 4, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": {"shape": [[32, 16, 4, 3]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[32, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20": {"shape": [[32, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92": {"shape": [[32, 1, 10, 10, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94": {"shape": [[32, 1, 28, 28, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 7, "independent_layout": false, "stack_info": []}, {"name": "Gradients", "type": "name_scope", "attr": {}, "input": {"Default/tuple_getitem[10]_0/tuple_getitem-op210": {"shape": [[32, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op15": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op12": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op205": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op206": {"shape": [[32, 16, 4, 3]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op202": {"shape": [[32, 1, 10, 10, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op197": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Cast-op188": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op195": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op196": {"shape": [[32, 6, 4, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op192": {"shape": [[32, 1, 28, 28, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/flatten-Flatten/Reshape-op9": {"shape": [[32, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op30": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op38": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op49": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op56": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op25": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op33": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op41": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 1, "independent_layout": false, "stack_info": []}], "scope_name": "", "children": {"nodes": [{"name": "Default/TransData-op99", "type": "TransData", "attr": {"dst_format": "dtype: DT_STRING\nstr_val: \"NC1HWC0\"\n", "IsFeatureMapInputList": "dtype: DT_TUPLE\nvalues {\n dtype: DT_UINT64\n uint_val: 0\n}\n", "pri_format": "dtype: DT_STRING\nstr_val: \"NC1HWC0\"\n", "_datadump_original_names": "dtype: DT_TUPLE\n", "IsFeatureMapOutput": "dtype: DT_BOOL\nbool_val: true\n", "src_format": "dtype: DT_STRING\nstr_val: \"NCHW\"\n"}, "input": {"Default/args0": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false, "stack_info": []}, {"name": "Default/Depend-op61", "type": "Depend", "attr": {}, "input": {"Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/ReduceMean-op60": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/make_tuple-op58": {"shape": [[], [], [], [], [], [], [], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL']"}}, "output": {"Default/make_tuple[9]_3/make_tuple-op284": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false, "stack_info": []}, {"name": "Default/args0", "type": "Parameter", "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[32, 1, 32, 32]]"}, "input": {}, "output": {"Default/TransData-op99": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false, "stack_info": []}, {"name": "Default/tuple_getitem[10]_0", "type": "aggregation_scope", "attr": {}, "input": {"Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op87": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op3": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op89": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/MaxPoolWithArgmax-op7": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/SoftmaxCrossEntropyWithLogits-op18": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}}, "output": {"Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op195": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Conv2D-op5": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op205": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/Cast-op208": {"shape": [[32, 16, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/Mul-op20": {"shape": [[32, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92": {"shape": [[32, 1, 10, 10, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": {"shape": [[32, 16, 4, 3]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op94": {"shape": [[32, 1, 28, 28, 2]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT8]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": {"shape": [[32, 6, 4, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_UINT16]"}, "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/ReduceMean-op60": {"shape": [[32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 20, "independent_layout": false, "stack_info": []}, {"name": "Default/make_tuple[9]_3", "type": "aggregation_scope", "attr": {}, "input": {"Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op250": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op251": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op253": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op254": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op256": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op257": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op259": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op260": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op262": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op263": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op265": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op266": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op268": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op269": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op271": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/optimizer-Momentum/tuple_getitem[16]_2/tuple_getitem-op272": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/Depend-op61": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Default/optimizer-Momentum/Depend[8]_4/Depend-op23": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op26": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op31": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op34": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op39": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op42": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op50": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/optimizer-Momentum/Depend[8]_4/Depend-op57": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 9, "independent_layout": false, "stack_info": []}, {"name": "Default/network-WithLossCell", "type": "name_scope", "attr": {}, "input": {"Default/TransData-op99": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op193": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op197": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op203": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op207": {"shape": [[32, 16, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op211": {"shape": [[32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op193": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op192": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op197": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op196": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op203": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op202": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op207": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op206": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[32, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op210": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op211": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/Depend-op61": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 2, "independent_layout": false, "stack_info": []}, {"name": "Default/optimizer-Momentum", "type": "name_scope", "attr": {}, "input": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op29": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op37": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropFilter-op48": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op65": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op68": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op71": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op74": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op77": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op80": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op83": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/make_tuple[9]_3/make_tuple-op86": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}}, "output": {"Default/Depend-op61": {"shape": [[], [], [], [], [], [], [], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL', 'DT_BOOL']"}, "Default/make_tuple[9]_3/make_tuple-op65": {"shape": [[10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op68": {"shape": [[10, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op71": {"shape": [[84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op74": {"shape": [[84, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op77": {"shape": [[120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op80": {"shape": [[120, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op83": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/make_tuple[9]_3/make_tuple-op86": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 5, "independent_layout": false, "stack_info": []}], "scope_name": "Default", "children": {"nodes": [{"name": "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits", "type": "name_scope", "attr": {}, "input": {"Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/MatMul-op16": {"shape": [[32, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op211": {"shape": [[32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Default/tuple_getitem[10]_0/tuple_getitem-op210": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op211": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_FLOAT32]']"}, "Default/Depend-op61": {"shape": [[]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 6, "independent_layout": false, "stack_info": []}, {"name": "Default/network-WithLossCell/_backbone-LeNet5", "type": "name_scope", "attr": {}, "input": {"Default/TransData-op99": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op193": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op197": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op203": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op207": {"shape": [[32, 16, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op193": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op192": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op197": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op196": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op203": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op202": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op207": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op206": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[32, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/SoftmaxCrossEntropyWithLogits-op18": {"shape": [[32, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 6, "independent_layout": false, "stack_info": []}], "scope_name": "Default/network-WithLossCell", "children": {"nodes": [{"name": "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d", "type": "name_scope", "attr": {}, "input": {"Default/tuple_getitem[10]_0/tuple_getitem-op197": {"shape": [[32, 6, 14, 14]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/gradConv2D/Conv2DBackpropInput-op52": {"shape": [[16, 6, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op89": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 4, "independent_layout": false, "stack_info": []}, {"name": "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d", "type": "name_scope", "attr": {}, "input": {"Default/TransData-op99": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op87": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 5, "independent_layout": false, "stack_info": []}, {"name": "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU", "type": "name_scope", "attr": {}, "input": {"Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op191": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/Cast-op201": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/MatMul-op10": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/MatMul-op13": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Default/tuple_getitem[10]_0/tuple_getitem-op193": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op192": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op203": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op202": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT8]']"}, "Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/MatMul-op13": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op36": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op32": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/MatMul-op16": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGrad-op28": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op24": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 4, "independent_layout": false, "stack_info": []}, {"name": "Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d", "type": "name_scope", "attr": {}, "input": {"Default/tuple_getitem[10]_0/tuple_getitem-op193": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op203": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op207": {"shape": [[32, 16, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op53": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op197": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op196": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/gradMaxPoolWithArgmax/MaxPoolGradWithArgmax-op46": {"shape": [[32, 16, 10, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/tuple_getitem[10]_0/tuple_getitem-op207": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/tuple_getitem[10]_0/tuple_getitem-op206": {"shape": [[], []], "edge_type": "data", "independent_layout": false, "data_type": "DT_TUPLE['DT_TENSOR[DT_FLOAT32]', 'DT_TENSOR[DT_UINT16]']"}, "Default/network-WithLossCell/_backbone-LeNet5/flatten-Flatten/Reshape-op9": {"shape": [[32, 16, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 6, "independent_layout": false, "stack_info": []}, {"name": "Default/network-WithLossCell/_backbone-LeNet5/flatten-Flatten", "type": "name_scope", "attr": {}, "input": {"Default/network-WithLossCell/_backbone-LeNet5/max_pool2d-MaxPool2d/TransData-op123": {"shape": [[32, 16, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/MatMul-op10": {"shape": [[32, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradMatMul/MatMul[6]_5/MatMul-op40": {"shape": [[32, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 1, "independent_layout": false, "stack_info": []}, {"name": "Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense", "type": "name_scope", "attr": {}, "input": {"Default/network-WithLossCell/_backbone-LeNet5/flatten-Flatten/Reshape-op9": {"shape": [[32, 400]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op12": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op15": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op12": {"shape": [[32, 120]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op15": {"shape": [[32, 84]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/SoftmaxCrossEntropyWithLogits-op18": {"shape": [[32, 10]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 4, "independent_layout": false, "stack_info": []}], "scope_name": "Default/network-WithLossCell/_backbone-LeNet5", "children": {"nodes": [{"name": "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op189", "type": "Cast", "attr": {"_datadump_original_names": "dtype: DT_TUPLE\n", "IsFeatureMapInputList": "dtype: DT_TUPLE\n", "is_backed_cast": "dtype: DT_BOOL\nbool_val: true\n", "IsFeatureMapOutput": "dtype: DT_BOOL\nbool_val: false\n"}, "input": {"Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/conv1.weight": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Conv2D-op1": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false, "stack_info": []}, {"name": "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190", "type": "Cast", "attr": {"_datadump_original_names": "dtype: DT_TUPLE\n", "IsFeatureMapInputList": "dtype: DT_TUPLE\nvalues {\n dtype: DT_UINT64\n uint_val: 0\n}\n", "is_backed_cast": "dtype: DT_BOOL\nbool_val: true\n", "IsFeatureMapOutput": "dtype: DT_BOOL\nbool_val: true\n"}, "input": {"Default/TransData-op99": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Conv2D-op1": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Gradients/Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/gradConv2D/Conv2DBackpropFilter-op55": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false, "stack_info": []}, {"name": "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Conv2D-op1", "type": "Conv2D", "attr": {"stride": "dtype: DT_TUPLE\nvalues {\n dtype: DT_INT32\n int_val: 1\n}\nvalues {\n dtype: DT_INT32\n int_val: 1\n}\nvalues {\n dtype: DT_INT32\n int_val: 1\n}\nvalues {\n dtype: DT_INT32\n int_val: 1\n}\n", "pad": "dtype: DT_INT32\nint_val: 0\n", "kernel_size": "dtype: DT_TUPLE\nvalues {\n dtype: DT_INT32\n int_val: 5\n}\nvalues {\n dtype: DT_INT32\n int_val: 5\n}\n", "out_channel": "dtype: DT_INT32\nint_val: 6\n", "mode": "dtype: DT_INT32\nint_val: 1\n", "dilation": "dtype: DT_TUPLE\nvalues {\n dtype: DT_INT32\n int_val: 1\n}\nvalues {\n dtype: DT_INT32\n int_val: 1\n}\nvalues {\n dtype: DT_INT32\n int_val: 1\n}\nvalues {\n dtype: DT_INT32\n int_val: 1\n}\n", "output_names": "dtype: DT_LIST\nvalues {\n dtype: DT_STRING\n str_val: \"output\"\n}\n", "group": "dtype: DT_INT32\nint_val: 1\n", "pad_mode": "dtype: DT_STRING\nstr_val: \"valid\"\n", "data_format": "dtype: DT_STRING\nstr_val: \"NCHW\"\n", "offset_a": "dtype: DT_INT32\nint_val: 0\n", "input_names": "dtype: DT_LIST\nvalues {\n dtype: DT_STRING\n str_val: \"x\"\n}\nvalues {\n dtype: DT_STRING\n str_val: \"w\"\n}\n", "pad_list": "dtype: DT_TUPLE\nvalues {\n dtype: DT_INT32\n int_val: 0\n}\nvalues {\n dtype: DT_INT32\n int_val: 0\n}\nvalues {\n dtype: DT_INT32\n int_val: 0\n}\nvalues {\n dtype: DT_INT32\n int_val: 0\n}\n", "IsFeatureMapOutput": "dtype: DT_BOOL\nbool_val: true\n", "IsFeatureMapInputList": "dtype: DT_TUPLE\nvalues {\n dtype: DT_UINT64\n uint_val: 0\n}\n", "pri_format": "dtype: DT_STRING\nstr_val: \"NC1HWC0\"\n"}, "input": {"Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190": {"shape": [[32, 1, 32, 32]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}, "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op189": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op191": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false, "stack_info": []}, {"name": "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op191", "type": "Cast", "attr": {"_datadump_original_names": "dtype: DT_TUPLE\n", "IsFeatureMapInputList": "dtype: DT_TUPLE\nvalues {\n dtype: DT_UINT64\n uint_val: 0\n}\n", "is_backed_cast": "dtype: DT_BOOL\nbool_val: true\n", "IsFeatureMapOutput": "dtype: DT_BOOL\nbool_val: true\n"}, "input": {"Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Conv2D-op1": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output": {"Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op87": {"shape": [[32, 6, 28, 28]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false, "stack_info": []}, {"name": "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/conv1.weight", "type": "Parameter", "attr": {"type": "DT_TENSOR[DT_FLOAT32]", "shape": "[[6, 1, 5, 5]]"}, "input": {}, "output": {"Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op189": {"shape": [[6, 1, 5, 5]], "edge_type": "data", "independent_layout": false, "data_type": "DT_TENSOR[DT_FLOAT32]"}}, "output_i": 0, "proxy_input": {}, "proxy_output": {}, "subnode_count": 0, "independent_layout": false, "stack_info": []}], "scope_name": "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d", "children": {}}}}}}} \ No newline at end of file diff --git a/tests/ut/debugger/expected_results/graph/search_node_1.json b/tests/ut/debugger/expected_results/graph/search_node_1.json deleted file mode 100644 index c7086bb7..00000000 --- a/tests/ut/debugger/expected_results/graph/search_node_1.json +++ /dev/null @@ -1,310 +0,0 @@ -{ - "nodes": [ - { - "name": "Default", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/cst1", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/cst2", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - }, - { - "name": "Default/tuple_getitem[10]_0", - "type": "aggregation_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/tuple_getitem[10]_0/cst3", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/tuple_getitem[10]_0/cst4", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/tuple_getitem[10]_0/cst5", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/tuple_getitem[10]_0/cst6", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/tuple_getitem[10]_0/cst7", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/tuple_getitem[10]_0/cst27", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/tuple_getitem[10]_0/cst28", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/tuple_getitem[10]_0/cst32", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/tuple_getitem[10]_0/cst33", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/tuple_getitem[10]_0/cst37", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - }, - { - "name": "Default/optimizer-Momentum", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/optimizer-Momentum/tuple_getitem[16]_2", - "type": "aggregation_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/optimizer-Momentum/tuple_getitem[16]_2/cst9", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/optimizer-Momentum/tuple_getitem[16]_2/cst10", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/optimizer-Momentum/tuple_getitem[16]_2/cst12", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/optimizer-Momentum/tuple_getitem[16]_2/cst13", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/optimizer-Momentum/tuple_getitem[16]_2/cst15", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/optimizer-Momentum/tuple_getitem[16]_2/cst16", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/optimizer-Momentum/tuple_getitem[16]_2/cst18", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/optimizer-Momentum/tuple_getitem[16]_2/cst19", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/optimizer-Momentum/tuple_getitem[16]_2/cst21", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/optimizer-Momentum/tuple_getitem[16]_2/cst22", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/optimizer-Momentum/tuple_getitem[16]_2/cst24", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/optimizer-Momentum/tuple_getitem[16]_2/cst25", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/optimizer-Momentum/tuple_getitem[16]_2/cst29", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/optimizer-Momentum/tuple_getitem[16]_2/cst30", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/optimizer-Momentum/tuple_getitem[16]_2/cst34", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/optimizer-Momentum/tuple_getitem[16]_2/cst35", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - }, - { - "name": "Default/optimizer-Momentum/Depend[8]_4", - "type": "aggregation_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/optimizer-Momentum/Depend[8]_4/cst11", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/optimizer-Momentum/Depend[8]_4/cst14", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/optimizer-Momentum/Depend[8]_4/cst17", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/optimizer-Momentum/Depend[8]_4/cst20", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/optimizer-Momentum/Depend[8]_4/cst23", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/optimizer-Momentum/Depend[8]_4/cst26", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/optimizer-Momentum/Depend[8]_4/cst31", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/optimizer-Momentum/Depend[8]_4/cst36", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - } - ] - }, - { - "name": "Gradients", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Gradients/Default", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Gradients/Default/network-WithLossCell", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits/cst8", - "type": "Const", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/tests/ut/debugger/expected_results/graph/search_nodes_0.json b/tests/ut/debugger/expected_results/graph/search_nodes_0.json deleted file mode 100644 index b9b58e70..00000000 --- a/tests/ut/debugger/expected_results/graph/search_nodes_0.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "nodes": [ - { - "name": "Default", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - }, - { - "name": "Gradients", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Gradients/Default", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Gradients/Default/network-WithLossCell", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Gradients/Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/gradSoftmaxCrossEntropyWithLogits", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/tests/ut/debugger/expected_results/graph/search_nodes_by_type_0.json b/tests/ut/debugger/expected_results/graph/search_nodes_by_type_0.json deleted file mode 100644 index 70eafe3b..00000000 --- a/tests/ut/debugger/expected_results/graph/search_nodes_by_type_0.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "nodes": [ - { - "name": "Default", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell/_backbone-LeNet5", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/conv2-Conv2d/conv2.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - }, - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/conv1.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - }, - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6", - "type": "aggregation_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6/fc1.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6/fc1.bias", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6/fc2.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6/fc2.bias", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6/fc3.weight", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/Parameter[6]_6/fc3.bias", - "type": "Parameter", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/tests/ut/debugger/expected_results/graph/search_nodes_by_type_1.json b/tests/ut/debugger/expected_results/graph/search_nodes_by_type_1.json deleted file mode 100644 index fa382af5..00000000 --- a/tests/ut/debugger/expected_results/graph/search_nodes_by_type_1.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "nodes": [ - { - "name": "Default", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell/_backbone-LeNet5", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU", - "type": "name_scope", - "is_dynamic_shape_node": false, - "nodes": [ - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op12", - "type": "ReLU", - "is_dynamic_shape_node": false, - "nodes": [] - }, - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLU-op15", - "type": "ReLU", - "is_dynamic_shape_node": false, - "nodes": [] - } - ] - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/tests/ut/debugger/expected_results/graph/tensor_hist_0.json b/tests/ut/debugger/expected_results/graph/tensor_hist_0.json deleted file mode 100644 index bdc01dac..00000000 --- a/tests/ut/debugger/expected_results/graph/tensor_hist_0.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "tensor_history": [ - { - "name": "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190:0", - "full_name": "Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190:0", - "node_type": "Cast", - "type": "output", - "graph_name": "kernel_graph_0" - }, - { - "name": "Default/TransData-op99:0", - "full_name": "Default/TransData-op99:0", - "node_type": "TransData", - "type": "input", - "graph_name": "kernel_graph_0" - } - ] -} \ No newline at end of file diff --git a/tests/ut/debugger/expected_results/graph/tensor_hist_1.json b/tests/ut/debugger/expected_results/graph/tensor_hist_1.json deleted file mode 100644 index b4501bd8..00000000 --- a/tests/ut/debugger/expected_results/graph/tensor_hist_1.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "tensor_history": [ - { - "name": "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22:0", - "full_name": "Default/optimizer-Momentum/ApplyMomentum-op22:0", - "node_type": "ApplyMomentum", - "type": "output", - "graph_name": "kernel_graph_0" - }, - { - "name": "Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22:1", - "full_name": "Default/optimizer-Momentum/ApplyMomentum-op22:1", - "node_type": "ApplyMomentum", - "type": "output", - "graph_name": "kernel_graph_0" - }, - { - "name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21:0", - "full_name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/fc3-Dense/gradBiasAdd/BiasAddGrad-op21:0", - "node_type": "BiasAddGrad", - "type": "input", - "graph_name": "kernel_graph_0" - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/fc3.bias:0", - "full_name": "Default/optimizer-Momentum/Parameter[18]_7/fc3.bias:0", - "node_type": "Parameter", - "type": "input", - "graph_name": "kernel_graph_0" - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/moments.fc3.bias:0", - "full_name": "Default/optimizer-Momentum/Parameter[18]_7/moments.fc3.bias:0", - "node_type": "Parameter", - "type": "input", - "graph_name": "kernel_graph_0" - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/learning_rate:0", - "full_name": "Default/optimizer-Momentum/Parameter[18]_7/learning_rate:0", - "node_type": "Parameter", - "type": "input", - "graph_name": "kernel_graph_0" - }, - { - "name": "Default/optimizer-Momentum/Parameter[18]_7/momentum:0", - "full_name": "Default/optimizer-Momentum/Parameter[18]_7/momentum:0", - "node_type": "Parameter", - "type": "input", - "graph_name": "kernel_graph_0" - } - ] -} \ No newline at end of file diff --git a/tests/ut/debugger/expected_results/watchpoint/watchpoint_handler_get_0.json b/tests/ut/debugger/expected_results/watchpoint/watchpoint_handler_get_0.json deleted file mode 100644 index 90c79626..00000000 --- a/tests/ut/debugger/expected_results/watchpoint/watchpoint_handler_get_0.json +++ /dev/null @@ -1,80 +0,0 @@ -[ - { - "watchCondition": { - "condition": "tensor_too_small", - "value": 1.0, - "params": [ - { - "name": "abs_mean_lt", - "disabled": true - }, - { - "name": "max_lt", - "value": 1.0 - }, - { - "name": "min_lt", - "disabled": true - }, - { - "name": "mean_lt", - "disabled": true - } - ] - }, - "id": 1, - "watch_nodes_num": 0 - }, - { - "watchCondition": { - "condition": "tensor_too_small", - "value": 1.0, - "params": [ - { - "name": "abs_mean_lt", - "disabled": true - }, - { - "name": "max_lt", - "disabled": true - }, - { - "name": "min_lt", - "value": 1.0 - }, - { - "name": "mean_lt", - "disabled": true - } - ] - }, - "id": 2, - "watch_nodes_num": 106 - }, - { - "watchCondition": { - "condition": "tensor_too_large", - "value": 1.0, - "params": [ - { - "name": "abs_mean_gt", - "disabled": true - }, - { - "name": "max_gt", - "value": 1.0 - }, - { - "name": "min_gt", - "disabled": true - }, - { - "name": "mean_gt", - "disabled": true - } - ] - }, - "id": 3, - "watch_nodes_num": 1 - } -] \ No newline at end of file diff --git a/tests/ut/debugger/expected_results/watchpoint/watchpoint_handler_get_1.json b/tests/ut/debugger/expected_results/watchpoint/watchpoint_handler_get_1.json deleted file mode 100644 index 43e21dd3..00000000 --- a/tests/ut/debugger/expected_results/watchpoint/watchpoint_handler_get_1.json +++ /dev/null @@ -1 +0,0 @@ -[{"id": 1, "watch_condition": {"id": "tensor_too_small", "params": [{"name": "max_lt", "value": 1.0}], "abbr": "TS"}}, {"id": 2, "watch_condition": {"id": "tensor_too_small", "params": [{"name": "min_lt", "value": 1.0}], "abbr": "TS"}}, {"id": 3, "watch_condition": {"id": "tensor_too_large", "params": [{"name": "max_gt", "value": 1.0}], "abbr": "TL"}}] \ No newline at end of file diff --git a/tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_group_focused_node_0.json b/tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_group_focused_node_0.json deleted file mode 100644 index 26d5d057..00000000 --- a/tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_group_focused_node_0.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "offset": 1, - "total": 2, - "watch_point_hits": [ - { - "node_name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op96", - "tensors": [ - { - "slot": "0", - "watch_points": [ - { - "id": 1, - "watch_condition": { - "condition": "MAX_GT", - "param": 1 - }, - "error_code": 0, - "error_list": [] - } - ] - } - ], - "graph_name": "kernel_graph_1", - "graph_id": "kernel_graph_1", - "watchpoint_id": [ - 1 - ] - } - ] -} \ No newline at end of file diff --git a/tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_group_focused_node_1.json b/tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_group_focused_node_1.json deleted file mode 100644 index 84183546..00000000 --- a/tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_group_focused_node_1.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "offset": 0, - "total": 1, - "watch_point_hits": [ - { - "node_name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op96", - "tensors": [ - { - "slot": "0", - "watch_points": [ - { - "id": 1, - "watch_condition": { - "condition": "MAX_GT", - "param": 1 - }, - "error_code": 0, - "error_list": [] - } - ] - } - ], - "graph_name": "kernel_graph_1", - "graph_id": "kernel_graph_1", - "watchpoint_id": [ - 1 - ] - } - ] -} \ No newline at end of file diff --git a/tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_handler_get_0.json b/tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_handler_get_0.json deleted file mode 100644 index 32fcdd9e..00000000 --- a/tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_handler_get_0.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "watch_point_hits": [ - { - "node_name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op96", - "tensors": [ - { - "slot": "0", - "watch_points": [ - { - "id": 1, - "watch_condition": { - "condition": "MAX_GT", - "param": 1 - }, - "error_code": 0, - "error_list": [] - } - ] - } - ], - "graph_name": "kernel_graph_1", - "graph_id": "kernel_graph_1", - "watchpoint_id": [ - 1 - ] - }, - { - "node_name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92", - "tensors": [ - { - "slot": "0", - "watch_points": [ - { - "id": 2, - "watch_condition": { - "condition": "MIN_LT", - "param": 1 - }, - "error_code": 0, - "error_list": [] - } - ] - } - ], - "graph_name": "kernel_graph_0", - "graph_id": "kernel_graph_0", - "watchpoint_id": [ - 2 - ] - } - ] -} \ No newline at end of file diff --git a/tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_handler_get_1.json b/tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_handler_get_1.json deleted file mode 100644 index ec747fa4..00000000 --- a/tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_handler_get_1.json +++ /dev/null @@ -1 +0,0 @@ -null \ No newline at end of file diff --git a/tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_handler_group_by_None.json b/tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_handler_group_by_None.json deleted file mode 100644 index fb5fa34c..00000000 --- a/tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_handler_group_by_None.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "offset": 0, - "total": 2, - "watch_point_hits": [ - { - "node_name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92", - "tensors": [ - { - "slot": "0", - "watch_points": [ - { - "id": 2, - "watch_condition": { - "condition": "MIN_LT", - "param": 1 - }, - "error_code": 0, - "error_list": [] - } - ] - } - ], - "graph_name": "kernel_graph_0", - "graph_id": "kernel_graph_0", - "watchpoint_id": [ - 2 - ] - }, - { - "node_name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op96", - "tensors": [ - { - "slot": "0", - "watch_points": [ - { - "id": 1, - "watch_condition": { - "condition": "MAX_GT", - "param": 1 - }, - "error_code": 0, - "error_list": [] - } - ] - } - ], - "graph_name": "kernel_graph_1", - "graph_id": "kernel_graph_1", - "watchpoint_id": [ - 1 - ] - } - ] -} \ No newline at end of file diff --git a/tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_handler_group_by_graph.json b/tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_handler_group_by_graph.json deleted file mode 100644 index 94fbea16..00000000 --- a/tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_handler_group_by_graph.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "offset": 0, - "total": 1, - "watch_point_hits": [ - { - "node_name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92", - "tensors": [ - { - "slot": "0", - "watch_points": [ - { - "id": 2, - "watch_condition": { - "condition": "MIN_LT", - "param": 1 - }, - "error_code": 0, - "error_list": [] - } - ] - } - ], - "graph_name": "kernel_graph_0", - "graph_id": "kernel_graph_0", - "watchpoint_id": [ - 2 - ] - } - ] -} \ No newline at end of file diff --git a/tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_handler_group_by_watchpoint.json b/tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_handler_group_by_watchpoint.json deleted file mode 100644 index 94fbea16..00000000 --- a/tests/ut/debugger/expected_results/watchpoint/watchpoint_hit_handler_group_by_watchpoint.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "offset": 0, - "total": 1, - "watch_point_hits": [ - { - "node_name": "Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92", - "tensors": [ - { - "slot": "0", - "watch_points": [ - { - "id": 2, - "watch_condition": { - "condition": "MIN_LT", - "param": 1 - }, - "error_code": 0, - "error_list": [] - } - ] - } - ], - "graph_name": "kernel_graph_0", - "graph_id": "kernel_graph_0", - "watchpoint_id": [ - 2 - ] - } - ] -} \ No newline at end of file diff --git a/tests/ut/debugger/stream_cache/__init__.py b/tests/ut/debugger/stream_cache/__init__.py deleted file mode 100644 index 4dda6d23..00000000 --- a/tests/ut/debugger/stream_cache/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Test for debugger stream cache.""" diff --git a/tests/ut/debugger/stream_cache/test_node_type_identifier.py b/tests/ut/debugger/stream_cache/test_node_type_identifier.py deleted file mode 100644 index 56350ed9..00000000 --- a/tests/ut/debugger/stream_cache/test_node_type_identifier.py +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -Function: - Test query debugger node type identifier. -Usage: - pytest tests/ut/debugger -""" -from unittest.mock import MagicMock - -import pytest - -from mindinsight.debugger.common.exceptions.exceptions import DebuggerParamValueError -from mindinsight.debugger.stream_cache.node_type_identifier import NodeTypeIdentifier - - -class TestNodeTypeIdentifier: - """Test NodeTypeIdentifier.""" - - @pytest.mark.parametrize("name, node_type, result", [ - ('Default/mock/node_name.bias', "Parameter", True), - ('Default/mock/node_name.weight', "Parameter", True), - ('Gradients/mock/node_name.bias', "Parameter", False), - ('Default/optimizer-mock/node_name.bias', "Parameter", False), - ]) - def test_weight_node(self, name, node_type, result): - """Test weight node.""" - identifier = NodeTypeIdentifier('weight') - mock_node = MagicMock(type=node_type) - mock_node.full_name = name - res = identifier.is_match(mock_node) - assert res is result - - @pytest.mark.parametrize("name, node_type, result", [ - ('Default/mock/node_name.bias', "Parameter", False), - ('Gradients/mock/node_name.bias', "Parameter", False), - ('Gradients/mock-mock/node_name.bias', "ReluGrad", True), - ]) - def test_gradient_node(self, name, node_type, result): - """Test gradient node.""" - identifier = NodeTypeIdentifier('gradient') - mock_node = MagicMock(type=node_type) - mock_node.full_name = name - res = identifier.is_match(mock_node) - assert res is result - - @pytest.mark.parametrize("name, node_type, condition, result", [ - ('Default/mock/relu_ReLU-op11', "ReLU", None, True), - ('Gradients/mock/relu_ReLU-op11', "ReLU", None, False), - ('Default/mock/relu_ReLU-op11', "Parameter", None, False), - ('Default/mock/relu_ReLU-op11', "ReLU", {'activation_func': 'softmax'}, False), - ('Default/mock/relu_ReLU-op11', "Softmax", {'activation_func': ['relu', 'softmax']}, True) - ]) - def test_activate_node(self, name, node_type, condition, result): - """Test activate node.""" - identifier = NodeTypeIdentifier('activation') - mock_node = MagicMock(type=node_type) - mock_node.full_name = name - res = identifier.is_match(mock_node, condition) - assert res is result - - def test_invalid_func(self): - """Test invalid func.""" - with pytest.raises(DebuggerParamValueError, match='Invalid identify type.'): - NodeTypeIdentifier('invalid_type') diff --git a/tests/ut/debugger/stream_handler/__init__.py b/tests/ut/debugger/stream_handler/__init__.py deleted file mode 100644 index 17d2c558..00000000 --- a/tests/ut/debugger/stream_handler/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Test for debugger stream handler.""" diff --git a/tests/ut/debugger/stream_handler/test_graph_handler.py b/tests/ut/debugger/stream_handler/test_graph_handler.py deleted file mode 100644 index 20f65cfe..00000000 --- a/tests/ut/debugger/stream_handler/test_graph_handler.py +++ /dev/null @@ -1,137 +0,0 @@ -# Copyright 2020-2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -Function: - Test query debugger graph handler. -Usage: - pytest tests/ut/debugger -""" -import os - -import pytest - -from tests.ut.debugger.configurations import init_graph_handler, init_multi_card_graph_handler, \ - compare_debugger_result_with_file -from tests.utils.tools import compare_result_with_file - - -class TestGraphHandler: - """Test GraphHandler.""" - @classmethod - def setup_class(cls): - """Init WatchpointHandler for watchpoint unittest.""" - cls.graph_results_dir = os.path.join(os.path.dirname(__file__), - '../expected_results/graph') - cls.graph_handler = init_graph_handler() - - @pytest.mark.parametrize("filter_condition, result_file", [ - (None, "graph_handler_get_1_no_filter_condintion.json"), - ({'name': 'Default'}, "graph_handler_get_2_list_nodes.json"), - ({'name': 'Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190', - 'single_node': True}, - "graph_handler_get_3_single_node.json") - ]) - def test_get(self, filter_condition, result_file): - """Test get.""" - result = self.graph_handler.get(filter_condition) - file_path = os.path.join(self.graph_results_dir, result_file) - compare_debugger_result_with_file(result, file_path, True) - compare_result_with_file(result, file_path) - - @pytest.mark.parametrize("node_name, result_file", [ - ("Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190", - "tensor_hist_0.json"), - ("Default/optimizer-Momentum/ApplyMomentum[8]_1/ApplyMomentum-op22", - "tensor_hist_1.json") - ]) - def test_get_tensor_history(self, node_name, result_file): - """Test get tensor history.""" - result = self.graph_handler.get_tensor_history(node_name) - file_path = os.path.join(self.graph_results_dir, result_file) - compare_result_with_file(result, file_path) - - @pytest.mark.parametrize("pattern, result_file", [ - ("withlogits", "search_nodes_0.json"), - ("cst", "search_node_1.json") - ]) - def test_search_nodes(self, pattern, result_file): - """Test search nodes.""" - result = self.graph_handler.search_nodes({'name': pattern}) - file_path = os.path.join(self.graph_results_dir, result_file) - compare_result_with_file(result, file_path) - - @pytest.mark.parametrize("node_type, condition, result_file", [ - ("weight", None, "search_nodes_by_type_0.json"), - ("activation", {'activation_func': ['relu', 'softmax']}, "search_nodes_by_type_1.json") - ]) - def test_search_nodes_by_type(self, node_type, condition, result_file): - """Test search nodes by type.""" - result = self.graph_handler.search_nodes( - {'node_category': node_type, 'condition': condition, 'graph_name': 'kernel_graph_0'}) - file_path = os.path.join(self.graph_results_dir, result_file) - compare_result_with_file(result, file_path) - - @pytest.mark.parametrize("node_name, expect_type", [ - ("Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/cst1", 'Const'), - ("Default/TransData-op99", "TransData") - ]) - def test_get_node_type(self, node_name, expect_type): - """Test get node type.""" - node_type = self.graph_handler.get_node_type(node_name) - assert node_type == expect_type - - @pytest.mark.parametrize("node_name, expect_full_name", [ - (None, ""), - ("Default/make_tuple[9]_3/make_tuple-op284", "Default/make_tuple-op284"), - ("Default/args0", "Default/args0") - ]) - def test_get_full_name(self, node_name, expect_full_name): - """Test get full name.""" - full_name = self.graph_handler.get_full_name(node_name) - assert full_name == expect_full_name - - @pytest.mark.parametrize("full_name, expect_node_name", [ - (None, ""), - ("Default/make_tuple-op284", "Default/make_tuple[9]_3/make_tuple-op284"), - ("Default/args0", "Default/args0") - ]) - def test_get_node_name_by_full_name(self, full_name, expect_node_name): - """Test get node name by full name.""" - node_name = self.graph_handler.get_node_name_by_full_name(full_name, 'kernel_graph_0') - assert node_name == expect_node_name - - @pytest.mark.parametrize("tensor_name, expect_file", [ - ("Default/network-WithLossCell/_loss_fn-SoftmaxCrossEntropyWithLogits/OneHot-op0:0", "get_tensor_graph-0.json"), - ("Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/ReLUV2-op89:1", "get_tensor_graph-1.json"), - ("Default/tuple_getitem[10]_0/tuple_getitem-op206:1", "get_tensor_graph-2.json"), - ]) - def test_get_tensor_graph(self, tensor_name, expect_file): - """Test get tensor graph.""" - res = self.graph_handler.get_tensor_graph(tensor_name, None) - compare_debugger_result_with_file(res, expect_file=os.path.join('graph', expect_file)) - - -class TestMultiCardGraphHandler: - """Test GraphHandler.""" - @classmethod - def setup_class(cls): - """Init MultiCardGraphHandler for unittest.""" - cls.multi_card_graph_handler = init_multi_card_graph_handler() - - @pytest.mark.parametrize("rank_id, expect_res", [(0, True), (1, True), (2, False)]) - def test_validate_rank_id(self, rank_id, expect_res): - """Test validate_rank_id.""" - res = self.multi_card_graph_handler.validate_rank_id(rank_id) - assert res == expect_res diff --git a/tests/ut/debugger/stream_handler/test_metadata_handler.py b/tests/ut/debugger/stream_handler/test_metadata_handler.py deleted file mode 100644 index 5f041a27..00000000 --- a/tests/ut/debugger/stream_handler/test_metadata_handler.py +++ /dev/null @@ -1,91 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Test metadata_handler.py.""" -from mindinsight.debugger.common.utils import ServerStatus -from mindinsight.debugger.stream_handler.metadata_handler import MetadataHandler -from mindinsight.debugger.proto.debug_grpc_pb2 import Metadata - - -class TestMetadataHandler: - """test class for MetadataHandler""" - def setup_method(self): - """set up function, init a MetaDataHandler for use""" - self.metadata_handler = MetadataHandler() - - def test_device_name(self): - """test device_name property""" - res = self.metadata_handler.device_name - assert res == "" - - def test_step(self): - """test step property.""" - res = self.metadata_handler.step - assert res == 0 - - def test_node_name(self): - """test property of current node name""" - res = self.metadata_handler.node_name - assert res == "" - - def test_node_name_setter(self): - """test set property of node name""" - self.metadata_handler.node_name = "node_name" - res = self.metadata_handler.node_name - assert res == "node_name" - - def test_full_name(self): - """test full_name property""" - res = self.metadata_handler.full_name - assert res == "" - - def test_backend(self): - """test backend property""" - res = self.metadata_handler.backend - assert res == "" - - def test_state(self): - """test state property""" - res = self.metadata_handler.state - assert res == ServerStatus.PENDING.value - - def test_state_setter(self): - """test set the property of state""" - self.metadata_handler.state = ServerStatus.RUNNING - res = self.metadata_handler.state - assert res == ServerStatus.RUNNING.value - - def test_client_ip(self): - """test client_ip property""" - res = self.metadata_handler.client_ip - assert res == "" - - def test_put(self): - """test put value into metadata cache""" - value = Metadata() - self.metadata_handler.put(value) - res_device_name = self.metadata_handler.device_name - assert res_device_name == value.device_name.split(':')[0] - res_step = self.metadata_handler.step - assert res_step == value.cur_step - res_cur_node = self.metadata_handler.full_name - assert res_cur_node == value.cur_node - res_backend = self.metadata_handler.backend - expect_backend = value.backend if value.backend else "Ascend" - assert res_backend == expect_backend - - def test_get(self): - """test get updated value""" - res = self.metadata_handler.get('state') - assert res == {'metadata': {'state': ServerStatus.PENDING.value}} diff --git a/tests/ut/debugger/stream_handler/test_tensor_handler.py b/tests/ut/debugger/stream_handler/test_tensor_handler.py deleted file mode 100644 index 8aaa1ca5..00000000 --- a/tests/ut/debugger/stream_handler/test_tensor_handler.py +++ /dev/null @@ -1,90 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Test tensor_handler.py""" -from unittest import mock -import pytest - -from mindinsight.debugger.common.exceptions.exceptions import DebuggerParamValueError -from mindinsight.debugger.common.log import LOGGER as log -from mindinsight.debugger.stream_handler.tensor_handler import TensorHandler -from mindinsight.debugger.stream_handler.tensor_handler import MemoryMgr, DownloadMgr - - -class TestTensorHandler: - """Test TensorHandler.""" - - def setup_method(self): - """Setup method for each test case.""" - memory_mgr = MemoryMgr() - download_mgr = DownloadMgr() - self.tensor_handler = TensorHandler(memory_mgr, download_mgr, rank_id=0) - - @mock.patch.object(TensorHandler, '_get_tensor') - @mock.patch.object(log, "error") - def test_get(self, mock_get_tensor, mock_error): - """Test get full tensor value.""" - mock_get_tensor.return_value = None - mock_error.return_value = None - with pytest.raises(DebuggerParamValueError) as ex: - self.tensor_handler.get({}) - assert "No tensor named {}".format(None) in str(ex.value) - - def test_get_tensor_value_by_name_none(self): - """Test get_tensor_value_by_name.""" - res = self.tensor_handler.get_valid_tensor_by_name('tensor_name', step=0, prev=True) - assert res is None - - @mock.patch.object(log, "error") - @pytest.mark.parametrize("tensor_name", "name") - def test_get_tensors_diff_error(self, mock_error, tensor_name): - """Test get_tensors_diff.""" - mock_error.return_value = None - with pytest.raises(DebuggerParamValueError) as ex: - self.tensor_handler.get_tensors_diff(tensor_name, {1, 1}, step=0) - assert f"Get current step and previous step for this tensor name {tensor_name} failed." in str(ex.value) - - def test_request_memory(self): - """Test cache oversize tensor.""" - memory_mgr = MemoryMgr() - - def release_func(over_size=False): - assert over_size is False - memory_mgr.request(1, 1073741823, release_func) - assert memory_mgr.remaining_cache_space == 4294967297 - - def test_oversize_tensor(self): - """Test cache oversize tensor.""" - memory_mgr = MemoryMgr() - - def release_func(over_size=False): - assert over_size is True - memory_mgr.request(1, 1073741825, release_func) - assert memory_mgr.remaining_cache_space == 5368709120 - - def test_release_memory(self): - """Test release memory.""" - memory_mgr = MemoryMgr() - - def release_func(over_size=False): - assert over_size is False - memory_mgr.request(1, 1073741823, release_func) - memory_mgr.request(2, 1073741823, release_func) - memory_mgr.request(3, 1073741823, release_func) - memory_mgr.request(4, 1073741823, release_func) - memory_mgr.request(5, 1073741823, release_func) - memory_mgr.request(6, 1073741823, release_func) - assert memory_mgr.remaining_cache_space == 5 - memory_mgr.request(7, 1073741822, release_func) - assert memory_mgr.remaining_cache_space == 6 diff --git a/tests/ut/debugger/stream_handler/test_watchpoint_handler.py b/tests/ut/debugger/stream_handler/test_watchpoint_handler.py deleted file mode 100644 index 0362e523..00000000 --- a/tests/ut/debugger/stream_handler/test_watchpoint_handler.py +++ /dev/null @@ -1,283 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -Function: - Test query debugger watchpoint handler. -Usage: - pytest tests/ut/debugger -""" -import json -import os -from unittest import mock, TestCase - -import pytest -from google.protobuf import json_format - -from mindinsight.debugger.conditionmgr.conditionmgr import ConditionMgr -from mindinsight.debugger.common.exceptions.exceptions import DebuggerParamValueError, \ - DebuggerParamTypeError -from mindinsight.debugger.common.log import LOGGER as log -from mindinsight.debugger.stream_cache.watchpoint import Watchpoint -from mindinsight.debugger.stream_handler import MultiCardGraphHandler -from mindinsight.debugger.stream_handler.watchpoint_handler import WatchpointHandler, \ - WatchpointHitHandler, validate_watch_condition, validate_watch_condition_params -from mindinsight.debugger.stream_operator.watchpoint_operator import WatchpointOperator -from tests.ut.debugger.configurations import init_graph_handler, mock_tensor_proto, \ - mock_tensor_history, get_node_basic_infos, \ - init_watchpoint_hit_handler -from tests.utils.tools import compare_result_with_file - - -class TestWatchpointHandler: - """Test WatchpointHandler.""" - - @classmethod - def setup_class(cls): - """Init WatchpointHandler for watchpoint unittest.""" - cls.results_dir = os.path.join(os.path.dirname(__file__), - '../expected_results/watchpoint') - cls.graph_results_dir = os.path.join(os.path.dirname(__file__), - '../expected_results/graph') - cls.multi_graph_stream = MultiCardGraphHandler() - cls.graph_stream = init_graph_handler() - cls.multi_graph_stream.register_graph_handler(0, cls.graph_stream) - cls.conditionmgr = None - cls.handler = None - - def setup_method(self): - """Init watchpoint for each unittest.""" - self.conditionmgr = ConditionMgr() - self.handler = WatchpointHandler() - self._create_watchpoint() - - def _create_watchpoint(self): - """Test create_watchpoint.""" - watchpoints = [ - ({'id': 'tensor_too_small', 'params': [{'name': 'max_lt', 'value': 1.0}]}, None, None, 1), - ({'id': 'tensor_too_small', 'params': [{'name': 'min_lt', 'value': 1.0}]}, ["Default"], None, 2), - ({'id': 'tensor_too_large', 'params': [{'name': 'max_gt', 'value': 1.0}]}, - ["Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92"], - None, 3) - ] - for watch_condition, watch_nodes, watch_point_id, expect_new_id in watchpoints: - watch_nodes = get_node_basic_infos(watch_nodes) - watch_point_id = self.handler.create_watchpoint(self.conditionmgr, watch_condition, {0: watch_nodes}, - watch_point_id) - assert watch_point_id == expect_new_id - - @pytest.mark.parametrize( - "watch_point_id, watch_nodes, watched, expect_updated_id", [ - (3, ["Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92"], 1, 3), - (3, [], 1, 3) - ]) - def test_update_watchpoint_add(self, watch_point_id, watch_nodes, watched, expect_updated_id): - """Test update_watchpoint on addition.""" - watch_nodes = get_node_basic_infos(watch_nodes) - with TestCase().assertLogs(logger=log, level='DEBUG') as log_content: - self.handler.update_watchpoint(watch_point_id, watch_nodes, watched) - TestCase().assertIn(f"DEBUG:debugger.debugger:Update watchpoint {expect_updated_id} in cache.", - log_content.output) - - @pytest.mark.parametrize( - "watch_point_id, watch_nodes, watched, expect_updated_id", [ - (2, ["Default"], 0, 2), - (2, [], 0, 2), - ]) - def test_update_watchpoint_delete(self, watch_point_id, watch_nodes, watched, expect_updated_id): - """Test update_watchpoint on deletion.""" - watch_nodes = get_node_basic_infos(watch_nodes) - with TestCase().assertLogs(logger=log, level='DEBUG') as log_content: - self.handler.update_watchpoint(watch_point_id, watch_nodes, watched) - TestCase().assertIn(f"DEBUG:debugger.debugger:Update watchpoint {expect_updated_id} in cache.", - log_content.output) - - def test_get_pending_commands(self): - """Test get with filter_condition is True.""" - result_file = 'watchpoint_handler_get_0.json' - file_path = os.path.join(self.results_dir, result_file) - with open(file_path, 'r') as file_handler: - contents = json.load(file_handler) - protos = self.handler.get_pending_commands() - for proto in protos: - WatchpointOperator.add_set_cmd_detail(proto, self.handler, self.multi_graph_stream) - msg_dict = json_format.MessageToDict(proto) - msg_dict['watch_nodes_num'] = len(msg_dict.pop('watchNodes', [])) - assert msg_dict in contents - - @pytest.mark.parametrize("filter_condition, result_file", [ - (None, 'watchpoint_handler_get_1.json') - ]) - def test_get_without_filter(self, filter_condition, result_file): - """Test get with filer_condition is False.""" - file_path = os.path.join(self.results_dir, result_file) - reply = self.handler.get(filter_condition) - watch_points = reply.get('watch_points') - compare_result_with_file(watch_points, file_path) - - def test_get_watchpoint_by_id_except(self): - """Test get_watchpoint_by_id.""" - watchpoint_id = 4 - with pytest.raises(DebuggerParamValueError) as err: - self.handler.get_watchpoint_by_id(watchpoint_id) - assert err.value.error_code == '5054B081' - assert err.value.message == f"ValueError. Invalid watchpoint id: {watchpoint_id}" - - @pytest.mark.parametrize("graph_file, watch_point_id", [ - ('graph_handler_get_3_single_node.json', 4) - ]) - def test_set_watch_nodes(self, graph_file, watch_point_id): - """Test set_watch_nodes.""" - path = os.path.join(self.graph_results_dir, graph_file) - with open(path, 'r') as file_handler: - graph = json.load(file_handler) - self.handler.set_watch_nodes(graph, self.graph_stream, watch_point_id) - - @pytest.mark.parametrize( - "watch_point_id, expect_deleted_ids", [ - (3, 3), (None, 2) - ]) - def test_delete_watchpoint(self, watch_point_id, expect_deleted_ids): - """Test delete_watchpoint.""" - self.handler.sync_set_cmd({}) - with TestCase().assertLogs(logger=log, level='DEBUG') as log_content: - self.handler.delete_watchpoint(watch_point_id) - TestCase().assertIn( - f"DEBUG:debugger.debugger:Delete watchpoint {expect_deleted_ids} in cache.", - log_content.output) - - @pytest.mark.parametrize( - "watch_point_id, expect_deleted_ids", [ - (3, 3), (2, 2) - ]) - def test_delete_watchpoint_in_cache(self, watch_point_id, - expect_deleted_ids): - """Test delete_watchpoint.""" - for _ in range(watch_point_id): - self.handler.create_watchpoint(self.conditionmgr, - {'id': 'tensor_too_small', 'params': [{'name': 'max_lt', 'value': 1.0}]}) - with TestCase().assertLogs(logger=log, level='DEBUG') as log_content: - self.handler.delete_watchpoint(watch_point_id) - TestCase().assertIn( - f"DEBUG:debugger.debugger:Cancel create watchpoint {expect_deleted_ids} in cache.", - log_content.output) - - -class TestWatchpointHitHandler: - """Test WatchpointHitHandler.""" - watchpoint1 = Watchpoint( - watch_condition={'condition': 'MAX_GT', 'param': 1}, - watchpoint_id=1 - ) - value1 = { - 'tensor_proto': mock_tensor_proto(), - 'watchpoint': watchpoint1, - 'node_name': 'Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op96', - 'graph_name': 'kernel_graph_1', - } - watchpoint2 = Watchpoint( - watch_condition={'condition': 'MIN_LT', 'param': 1}, - watchpoint_id=2 - ) - value2 = { - 'tensor_proto': mock_tensor_proto(), - 'watchpoint': watchpoint2, - 'node_name': 'Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU/ReluGradV2-op92', - 'graph_name': 'kernel_graph_0', - } - values = [value1, value2] - - @classmethod - def setup_class(cls): - """Setup.""" - cls.handler = init_watchpoint_hit_handler(cls.values) - cls.tensor_hist = mock_tensor_history() - cls.results_dir = os.path.join(os.path.dirname(__file__), - '../expected_results/watchpoint') - - @mock.patch('mindinsight.debugger.stream_cache.watchpoint.WatchpointHit') - def test_put(self, mock_hit): - """Test put.""" - for value in self.values: - mock_hit.return_value = mock.MagicMock( - tensor_proto=value.get('tensor_proto'), - watchpoint=value.get('watchpoint'), - node_name=value.get('node_name') - ) - WatchpointHitHandler().put(value) - - @pytest.mark.parametrize("filter_condition, result_file", [ - (None, "watchpoint_hit_handler_get_0.json"), - ("Default/network-WithLossCell/_backbone-LeNet5/conv1-Conv2d/Cast-op190", - "watchpoint_hit_handler_get_1.json") - ]) - def test_get(self, filter_condition, result_file): - """Test get.""" - reply = self.handler.get(filter_condition) - file_path = os.path.join(self.results_dir, result_file) - compare_result_with_file(reply, file_path) - - def test_update_tensor_history(self): - """Test update_tensor_history.""" - self.handler.update_tensor_history(self.tensor_hist) - for tensor_info in self.tensor_hist.get('tensor_history'): - assert tensor_info['is_hit'] is False - - @pytest.mark.parametrize("group_condition, result_file", [ - ({'limit': 5}, "watchpoint_hit_handler_group_by_None.json"), - ({'limit': 5, 'graph_id': 'kernel_graph_0'}, "watchpoint_hit_handler_group_by_graph.json"), - ({'limit': 5, 'watchpoint_id': 2}, "watchpoint_hit_handler_group_by_watchpoint.json"), - ({'limit': 1, 'focused_node': {'graph_name': 'kernel_graph_1', - 'node_name': 'Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU' - '/gradReLU/ReluGradV2-op96'}}, - "watchpoint_hit_group_focused_node_0.json"), - ({'limit': 1, 'watchpoint_id': 1, - 'focused_node': {'graph_name': 'kernel_graph_1', - 'node_name': 'Gradients/Default/network-WithLossCell/_backbone-LeNet5/relu-ReLU/gradReLU' - '/ReluGradV2-op96'}}, - "watchpoint_hit_group_focused_node_1.json") - ]) - def test_group_by(self, group_condition, result_file): - """Test group watchpointhits by group_condition""" - reply = self.handler.group_by(group_condition) - file_path = os.path.join(self.results_dir, result_file) - compare_result_with_file(reply, file_path) - - -def test_validate_watch_condition_type_error(): - """Test validate_watch_condition.""" - watch_condition = [] - conditionmgr = ConditionMgr() - with pytest.raises(DebuggerParamTypeError) as err: - validate_watch_condition(conditionmgr, watch_condition) - assert err.value.error_code == '5054B080' - - watch_condition = {'watch_condition': {'condition': 'MAXIMUM'}} - with pytest.raises(DebuggerParamValueError) as err: - validate_watch_condition(conditionmgr, watch_condition) - assert err.value.error_code == '5054B081' - - -def test_validate_watch_condition_params_except(): - """Test validate_watch_condition_params.""" - watch_condition = {'id': 'weight_overflow', 'params': [{'name': 'param', 'value': 0}]} - conditionmgr = ConditionMgr() - with pytest.raises(DebuggerParamValueError) as err: - validate_watch_condition_params(conditionmgr, watch_condition) - assert err.value.error_code == '5054B081' - - watch_condition = {'id': 'tensor_overflow', 'params': [{'name': 'param', 'value': '0'}]} - with pytest.raises(DebuggerParamValueError) as err: - validate_watch_condition_params(conditionmgr, watch_condition) - assert err.value.error_code == '5054B081' diff --git a/tests/ut/debugger/stream_operator/__init__.py b/tests/ut/debugger/stream_operator/__init__.py deleted file mode 100644 index b9a89c12..00000000 --- a/tests/ut/debugger/stream_operator/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Test for debugger stream operator.""" diff --git a/tests/ut/debugger/stream_operator/test_training_control_operator.py b/tests/ut/debugger/stream_operator/test_training_control_operator.py deleted file mode 100644 index 8a4cf663..00000000 --- a/tests/ut/debugger/stream_operator/test_training_control_operator.py +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -Function: - Test debugger training control operator. -Usage: - pytest tests/ut/debugger/stream_operator/test_training_control_operator.py -""" -from unittest import mock - -import pytest - -from mindinsight.debugger.common.exceptions.exceptions import DebuggerParamValueError -from mindinsight.debugger.debugger_cache import DebuggerCache -from mindinsight.debugger.proto.debug_grpc_pb2 import RunCMD -from mindinsight.debugger.stream_handler import GraphHandler, MetadataHandler, MultiCardGraphHandler -from mindinsight.debugger.stream_operator.training_control_operator import TrainingControlOperator - - -class TestTrainingControlOperator: - """Test debugger server.""" - - @classmethod - def setup_class(cls): - """Initialize for test class.""" - cls._server = None - - def setup_method(self): - """Prepare debugger server object.""" - cache_store = DebuggerCache() - cache_store.initialize() - self._server = TrainingControlOperator(cache_store) - - @mock.patch.object(MultiCardGraphHandler, 'get_graph_handler_by_rank_id') - @mock.patch.object(GraphHandler, 'get_node_type') - def test_validate_leaf_name(self, *args): - """Test validate leaf name.""" - args[0].return_value = 'name_scope' - with pytest.raises(DebuggerParamValueError, match='Invalid leaf node name.'): - self._server._validate_continue_node_name(node_name='mock_node_name', graph_name='mock_graph_name', - rank_id=0) - - @pytest.mark.parametrize('mode, cur_state, state', [ - ('continue', 'waiting', 'sending'), - ('pause', 'running', 'sending'), - ('terminate', 'waiting', 'sending')]) - def test_control(self, mode, cur_state, state): - """Test control request.""" - with mock.patch.object(MetadataHandler, 'state', cur_state): - res = self._server.control(mode=mode, params={}) - assert res == {'metadata': {'enable_recheck': False, 'state': state}} - - def test_construct_run_event(self): - """Test construct run event.""" - res = self._server._construct_run_event({'level': 'node'}) - assert res.run_cmd == RunCMD(run_level='node', node_name='') - - @pytest.mark.parametrize('mode, state', [ - ('reset', 'waiting')]) - def test_control_reset_step(self, mode, state): - """Test control request, in 'reset' mode.""" - with mock.patch.object(MetadataHandler, 'max_step_num', 10), \ - mock.patch.object(MetadataHandler, 'debugger_type', 'offline'): - res = self._server.control(mode=mode, params={'steps': 9}) - assert res == {'metadata': {'enable_recheck': True, 'state': state, 'step': 9}} diff --git a/tests/ut/debugger/test_debugger_grpc_server.py b/tests/ut/debugger/test_debugger_grpc_server.py deleted file mode 100644 index 46a11f2c..00000000 --- a/tests/ut/debugger/test_debugger_grpc_server.py +++ /dev/null @@ -1,255 +0,0 @@ -# Copyright 2020-2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -Function: - Test debugger grpc server. -Usage: - pytest tests/ut/debugger/test_debugger_grpc_server.py -""" -from unittest import mock -from unittest.mock import MagicMock - -import numpy as np - -import mindinsight -from mindinsight.debugger.common.utils import get_ack_reply, ServerStatus -from mindinsight.debugger.debugger_cache import DebuggerCache -from mindinsight.debugger.debugger_services.debugger_grpc_server import DebuggerGrpcServer -from mindinsight.debugger.proto.debug_grpc_pb2 import EventReply, SetCMD, Chunk, WatchpointHit -from mindinsight.debugger.stream_handler import WatchpointHitHandler, GraphHandler, \ - WatchpointHandler, MultiCardGraphHandler -from mindinsight.domain.graph.proto.ms_graph_pb2 import TensorProto, DataType -from tests.ut.debugger.configurations import GRAPH_PROTO_FILE - - -class MockDataGenerator: - """Mocked Data generator.""" - - @staticmethod - def get_run_cmd(steps=0, level='step', node_name=''): - """Get run command.""" - event = get_ack_reply() - event.run_cmd.run_level = level - if level == 'node': - event.run_cmd.node_name = node_name - else: - event.run_cmd.run_steps = steps - return event - - @staticmethod - def get_exit_cmd(): - """Get exit command.""" - event = get_ack_reply() - event.exit = True - return event - - @staticmethod - def get_set_cmd(): - """Get set command""" - event = get_ack_reply() - event.set_cmd.CopyFrom(SetCMD(id=1, watch_condition=1)) - return event - - @staticmethod - def get_view_cmd(): - """Get set command""" - view_event = get_ack_reply() - ms_tensor = view_event.view_cmd.tensors.add() - ms_tensor.node_name, ms_tensor.slot = 'mock_node_name', '0' - event = {'view_cmd': view_event, 'node_name': 'mock_node_name', 'graph_name': 'mock_graph_name'} - return event - - @staticmethod - def get_graph_chunks(): - """Get graph chunks.""" - chunk_size = 1024 - with open(GRAPH_PROTO_FILE, 'rb') as file_handler: - content = file_handler.read() - chunks = [Chunk(buffer=content[0:chunk_size]), Chunk(buffer=content[chunk_size:])] - return chunks - - @staticmethod - def get_tensors(): - """Get tensors.""" - tensor_content = np.asarray([1, 2, 3, 4, 5, 6]).astype(np.float32).tobytes() - tensor_pre = TensorProto( - node_name='mock_node_name', - slot='0', - data_type=DataType.DT_FLOAT32, - dims=[2, 3], - tensor_content=tensor_content[:12], - finished=0 - ) - tensor_succ = TensorProto() - tensor_succ.CopyFrom(tensor_pre) - tensor_succ.tensor_content = tensor_content[12:] - tensor_succ.finished = 1 - return [tensor_pre, tensor_succ] - - @staticmethod - def get_watchpoint_hit(): - """Get watchpoint hit.""" - res = WatchpointHit(id=1) - res.tensor.node_name = 'mock_node_name' - res.tensor.slot = '0' - return res - - -class TestDebuggerGrpcServer: - """Test debugger grpc server.""" - - @classmethod - def setup_class(cls): - """Initialize for test class.""" - cls._server = None - - def setup_method(self): - """Initialize for each testcase.""" - cache_store = DebuggerCache() - self._server = DebuggerGrpcServer(cache_store) - - def test_waitcmd_with_pending_status(self): - """Test wait command interface when status is pending.""" - res = self._server.WaitCMD(MagicMock(), MagicMock()) - assert res.status == EventReply.Status.FAILED - - @mock.patch.object(MultiCardGraphHandler, 'get_graph_handler_by_rank_id') - @mock.patch.object(WatchpointHitHandler, 'empty', False) - @mock.patch.object(WatchpointHitHandler, 'put') - @mock.patch.object(DebuggerGrpcServer, '_deal_with_old_command') - def test_waitcmd_with_old_command(self, *args): - """Test wait command interface with old command.""" - old_command = MockDataGenerator.get_run_cmd(steps=1) - args[0].return_value = old_command - setattr(self._server, '_status', ServerStatus.WAITING) - setattr(self._server, '_received_view_cmd', {'node_name': 'mock_node_name'}) - setattr(self._server, '_received_hit', [MagicMock()]) - res = self._server.WaitCMD(MagicMock(cur_step=1, cur_node=''), MagicMock()) - assert res == old_command - - @mock.patch.object(MultiCardGraphHandler, 'get_graph_handler_by_rank_id') - @mock.patch.object(DebuggerGrpcServer, '_deal_with_old_command', return_value=None) - @mock.patch.object(DebuggerGrpcServer, '_wait_for_next_command') - def test_waitcmd_with_next_command(self, *args): - """Test wait for next command.""" - old_command = MockDataGenerator.get_run_cmd(steps=1) - args[0].return_value = old_command - setattr(self._server, '_status', ServerStatus.WAITING) - res = self._server.WaitCMD(MagicMock(cur_step=1, cur_node=''), MagicMock()) - assert res == old_command - - @mock.patch.object(MultiCardGraphHandler, 'get_graph_handler_by_rank_id') - @mock.patch.object(DebuggerGrpcServer, '_deal_with_old_command', return_value=None) - @mock.patch.object(DebuggerGrpcServer, '_wait_for_next_command') - def test_waitcmd_with_next_command_is_none(self, *args): - """Test wait command interface with next command is None.""" - args[2].return_value.get.return_value = {} - args[0].return_value = None - setattr(self._server, '_status', ServerStatus.RECEIVE_GRAPH) - res = self._server.WaitCMD(MagicMock(cur_step=1, cur_node=''), MagicMock()) - assert res == get_ack_reply(1) - - @mock.patch.object(DebuggerCache, 'get_command', return_value=(0, None)) - @mock.patch.object(DebuggerCache, 'has_command') - def test_deal_with_old_command_with_continue_steps(self, *args): - """Test deal with old command with continue steps.""" - args[0].side_effect = [True, False] - setattr(self._server, '_old_run_cmd', {'left_step_count': 1}) - res = self._server._deal_with_old_command() - assert res == MockDataGenerator.get_run_cmd(steps=1) - - @mock.patch.object(DebuggerCache, 'get_command') - @mock.patch.object(DebuggerCache, 'has_command', return_value=True) - def test_deal_with_old_command_with_exit_cmd(self, *args): - """Test deal with exit command.""" - cmd = MockDataGenerator.get_exit_cmd() - args[1].return_value = ('0', cmd) - res = self._server._deal_with_old_command() - assert res == cmd - - @mock.patch.object(DebuggerCache, 'get_command') - @mock.patch.object(DebuggerCache, 'has_command', return_value=True) - def test_deal_with_old_command_with_view_cmd(self, *args): - """Test deal with view command.""" - cmd = MockDataGenerator.get_view_cmd() - args[1].return_value = ('0', cmd.copy()) - res = self._server._deal_with_old_command() - assert res == cmd.pop('view_cmd') - expect_received_view_cmd = {'node_info': cmd, 'wait_for_tensor': True, 'view_cmd': res} - assert getattr(self._server, '_received_view_cmd') == expect_received_view_cmd - - @mock.patch.object(DebuggerCache, 'get_command') - def test_wait_for_run_command(self, *args): - """Test wait for run command.""" - cmd = MockDataGenerator.get_run_cmd(steps=2) - args[0].return_value = ('0', cmd) - setattr(self._server, '_status', ServerStatus.WAITING) - res = self._server._wait_for_next_command() - assert res == MockDataGenerator.get_run_cmd(steps=1) - assert getattr(self._server, '_old_run_cmd') == {'left_step_count': 1} - - @mock.patch.object(DebuggerCache, 'get_command') - def test_wait_for_pause_and_run_command(self, *args): - """Test wait for run command.""" - pause_cmd = MockDataGenerator.get_run_cmd(steps=0) - empty_view_cmd = MockDataGenerator.get_view_cmd() - empty_view_cmd.pop('view_cmd') - run_cmd = MockDataGenerator.get_run_cmd(steps=2) - args[0].side_effect = [('0', pause_cmd), ('0', empty_view_cmd), ('0', run_cmd)] - setattr(self._server, '_status', ServerStatus.WAITING) - res = self._server._wait_for_next_command() - assert res == run_cmd - assert getattr(self._server, '_old_run_cmd') == {'left_step_count': 1} - - def test_send_matadata(self): - """Test SendMatadata interface.""" - ms_version = mindinsight.__version__ - res = self._server.SendMetadata(MagicMock(training_done=False, ms_version=ms_version), MagicMock()) - expect_reply = get_ack_reply() - expect_reply.version_matched = True - assert res == expect_reply - - def test_send_matadata_with_mismatched(self): - """Test SendMatadata interface.""" - res = self._server.SendMetadata(MagicMock(training_done=False, ms_version='1.0.0'), MagicMock()) - expect_reply = get_ack_reply() - expect_reply.version_matched = False - assert res == expect_reply - - def test_send_matadata_with_training_done(self): - """Test SendMatadata interface.""" - res = self._server.SendMetadata(MagicMock(training_done=True), MagicMock()) - assert res == get_ack_reply() - - def test_send_graph(self): - """Test SendGraph interface.""" - res = self._server.SendGraph(MockDataGenerator.get_graph_chunks(), MagicMock()) - assert res == get_ack_reply() - - def test_send_tensors(self): - """Test SendTensors interface.""" - res = self._server.SendTensors(MockDataGenerator.get_tensors(), MagicMock()) - assert res == get_ack_reply() - - @mock.patch.object(MultiCardGraphHandler, 'get_graph_handler_by_rank_id') - @mock.patch.object(WatchpointHandler, 'get_watchpoint_by_id') - @mock.patch.object(GraphHandler, 'get_graph_id_by_full_name', return_value='mock_graph_name') - @mock.patch.object(GraphHandler, 'get_node_name_by_full_name') - def test_send_watchpoint_hit(self, *args): - """Test SendWatchpointHits interface.""" - args[0].side_effect = [None, 'mock_full_name'] - watchpoint_hit = MockDataGenerator.get_watchpoint_hit() - res = self._server.SendWatchpointHits([watchpoint_hit, watchpoint_hit], MagicMock()) - assert res == get_ack_reply() diff --git a/tests/ut/debugger/test_debugger_offline_server.py b/tests/ut/debugger/test_debugger_offline_server.py deleted file mode 100644 index a96002a2..00000000 --- a/tests/ut/debugger/test_debugger_offline_server.py +++ /dev/null @@ -1,102 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -Function: - Test debugger offline server. -Usage: - pytest tests/ut/debugger/test_debugger_offline_server.py -""" - -import os -import shutil -import tempfile -import time - -from pathlib import Path -from unittest.mock import MagicMock -import pytest -import numpy as np - -from mindinsight.debugger.debugger_services import debugger_offline_server -from mindinsight.debugger.debugger_services.debugger_offline_server import DebuggerOfflineManager, convert_watchpointhit -from tests.ut.debugger.configurations import WatchpointHit - - -class DataLoader: - """The Mocked DataLoader object.""" - - def __init__(self, base_dir): - self._debugger_base_dir = Path(base_dir).absolute() - self._net_name = "Lenet" - - @property - def device_target(self): - """The property of device target.""" - return "Ascend" - - def get_dump_dir(self): - """Get graph_name directory of the data.""" - return str(self._debugger_base_dir) - - def get_net_name(self): - """Get net_name of the data.""" - return self._net_name - - @staticmethod - def get_sync_flag(): - """Get sync flag of the data.""" - return True - - -def init_offline_server(dbg_dir): - """Init the offline server.""" - cache_store = MagicMock() - server = DebuggerOfflineManager(cache_store, dbg_dir) - return server - - -class TestDebuggerServer: - """Test debugger server.""" - - @classmethod - def setup_class(cls): - """Initialize for test class.""" - debugger_offline_server.import_module = MagicMock() - debugger_offline_server.DataLoader = DataLoader - cls.debugger_tmp_dir = tempfile.mkdtemp(suffix='debugger_tmp') - cls.dump_files_dir = os.path.join(cls.debugger_tmp_dir, 'dump_dir') - cls.iteration_0 = os.path.join(cls.dump_files_dir, 'rank_0', 'Lenet', '0', '0') - os.makedirs(cls.iteration_0, exist_ok=True) - cls._server = init_offline_server(cls.dump_files_dir) - - @classmethod - def teardown_class(cls): - """Run after test this class.""" - if os.path.exists(cls.debugger_tmp_dir): - shutil.rmtree(cls.debugger_tmp_dir) - - @pytest.mark.parametrize('hit', [WatchpointHit('Default/Add-op3', 0, 0, 0, [], 0, 0, 0)]) - def test_find_timestamp(self, hit): - """Test find timestamp of the tensor file.""" - t = int(time.time()*1000000) - watchpointhit = convert_watchpointhit(hit) - node_name = watchpointhit['name'].split('/')[-1] - node_type = node_name.split('-')[0] - tmp_file_name = f'{node_type}.{node_name}.520.2.{t}.output.0.1×10.npy' - abs_file_name = os.path.join(self.iteration_0, tmp_file_name) - x = np.random.rand(1, 10) - np.save(abs_file_name, x) - res = self._server.find_timestamp(watchpointhit, 0) - assert res == t diff --git a/tests/ut/debugger/test_debugger_server.py b/tests/ut/debugger/test_debugger_server.py deleted file mode 100644 index fe678b53..00000000 --- a/tests/ut/debugger/test_debugger_server.py +++ /dev/null @@ -1,276 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -Function: - Test debugger server. -Usage: - pytest tests/ut/debugger/test_debugger_server.py -""" -import signal -from threading import Thread -from unittest import mock -from unittest.mock import MagicMock - -import grpc -import pytest - -from mindinsight.debugger.common.exceptions.exceptions import DebuggerParamValueError, \ - DebuggerCompareTensorError, DebuggerCreateWatchPointError, DebuggerDeleteWatchPointError -from mindinsight.debugger.common.utils import Streams, ServerStatus -from mindinsight.debugger.debugger_cache import DebuggerCache -from mindinsight.debugger.debugger_services.debugger_server_factory import DebuggerServerContext -from mindinsight.debugger.debugger_session import DebuggerSession as DebuggerServer -from mindinsight.debugger.stream_handler import GraphHandler, WatchpointHandler, MetadataHandler, \ - TensorHandler, MultiCardGraphHandler, MultiCardWatchpointHitHandler, WatchpointHitHandler -from mindinsight.debugger.stream_operator import watchpoint_operator -from tests.ut.debugger.configurations import compare_debugger_result_with_file, mock_tensor_history - - -class TestDebuggerServer: - """Test debugger server.""" - - @classmethod - def setup_class(cls): - """Initialize for test class.""" - cls._server = None - - def setup_method(self): - """Prepare debugger server object.""" - context = DebuggerServerContext(dbg_mode='online') - self._server = DebuggerServer(context) - - @mock.patch.object(signal, 'signal') - @mock.patch.object(Thread, 'join') - @mock.patch.object(Thread, 'start') - @mock.patch.object(grpc, 'server') - def test_stop_server(self, *args): - """Test stop debugger server.""" - mock_grpc_server_manager = MagicMock() - args[0].return_value = mock_grpc_server_manager - self._server.start() - self._server._stop_handler(MagicMock(), MagicMock()) - assert self._server.back_server is not None - - @mock.patch.object(DebuggerCache, 'get_data') - def test_poll_data(self, *args): - """Test poll data request.""" - mock_data = {'pos': 'mock_data'} - args[0].return_value = mock_data - res = self._server.poll_data('0') - assert res == mock_data - - def test_poll_data_with_exept(self): - """Test poll data with wrong input.""" - with pytest.raises(DebuggerParamValueError, match='Pos should be string.'): - self._server.poll_data(1) - - @mock.patch.object(GraphHandler, 'search_nodes') - def test_search(self, *args): - """Test search node.""" - graph_stream = self._server.cache_store.get_stream_handler(Streams.GRAPH) - setattr(graph_stream, '_graph_handlers', {0: GraphHandler()}) - mock_graph = {'nodes': ['mock_nodes']} - args[0].return_value = mock_graph - res = self._server.search({'name': 'mock_name'}) - assert res == mock_graph - - def test_tensor_comparision_with_wrong_status(self): - """Test tensor comparison with wrong status.""" - with pytest.raises( - DebuggerCompareTensorError, - match='Failed to compare tensors as the MindSpore is not in waiting state.'): - self._server.tensor_comparisons(name='mock_node_name:0', shape='[:, :]') - - @mock.patch.object(MultiCardGraphHandler, 'get_graph_handler_by_rank_id') - @mock.patch.object(MetadataHandler, 'state', 'waiting') - @mock.patch.object(GraphHandler, 'get_node_type') - @mock.patch.object(GraphHandler, 'get_graph_id_by_name') - @mock.patch.object(GraphHandler, 'validate_graph_name') - @mock.patch.object(GraphHandler, 'get_full_name', return_value='mock_node_name') - def test_tensor_comparision_with_wrong_type(self, *args): - """Test tensor comparison with wrong type.""" - args[1].return_value = 'name_scope' - with pytest.raises(DebuggerParamValueError, match='The node type must be parameter'): - self._server.tensor_comparisons(name='mock_node_name:0', shape='[:, :]') - - @mock.patch.object(MetadataHandler, 'state', 'waiting') - @mock.patch.object(GraphHandler, 'get_graph_id_by_name') - @mock.patch.object(GraphHandler, 'validate_graph_name') - @mock.patch.object(GraphHandler, 'get_node_type', return_value='Parameter') - @mock.patch.object(GraphHandler, 'get_full_name', return_value='mock_node_name') - @mock.patch.object(TensorHandler, 'get_tensors_diff') - def test_tensor_comparision(self, *args): - """Test tensor comparison""" - graph_stream = self._server.cache_store.get_stream_handler(Streams.GRAPH) - setattr(graph_stream, '_graph_handlers', {0: GraphHandler()}) - mock_diff_res = {'tensor_value': {}} - args[0].return_value = mock_diff_res - res = self._server.tensor_comparisons('mock_node_name:0', '[:, :]') - assert res == mock_diff_res - - def test_retrieve_with_pending(self): - """Test retrieve request in pending status.""" - res = self._server.retrieve(mode='all') - assert res.get('metadata', {}).get('state') == 'pending' - - @mock.patch.object(MetadataHandler, 'state', 'waiting') - def test_retrieve_all(self): - """Test retrieve request.""" - res = self._server.retrieve(mode='all') - compare_debugger_result_with_file(res, 'debugger_server/retrieve_all.json') - - def test_retrieve_with_invalid_mode(self): - """Test retrieve with invalid mode.""" - with pytest.raises(DebuggerParamValueError, match='Invalid mode.'): - self._server.retrieve(mode='invalid_mode') - - @mock.patch.object(GraphHandler, 'get') - @mock.patch.object(GraphHandler, 'get_node_type', return_value='name_scope') - @mock.patch.object(GraphHandler, 'get_full_name', return_value='mock_node_name') - def test_retrieve_node(self, *args): - """Test retrieve node information.""" - graph_stream = self._server.cache_store.get_stream_handler(Streams.GRAPH) - setattr(graph_stream, '_graph_handlers', {0: GraphHandler()}) - mock_graph = {'graph': {}} - args[2].return_value = mock_graph - res = self._server._retrieve_node({'name': 'mock_node_name'}) - assert res == mock_graph - - def test_retrieve_tensor_history_with_pending(self): - """Test retrieve request in pending status.""" - res = self._server.retrieve_tensor_history('mock_node_name') - assert res.get('metadata', {}).get('state') == 'pending' - - @mock.patch.object(MetadataHandler, 'state', 'waiting') - @mock.patch.object(GraphHandler, 'get_tensor_history') - @mock.patch.object(GraphHandler, 'get_node_type', return_value='Parameter') - def test_retrieve_tensor_history(self, *args): - """Test retrieve tensor history.""" - graph_stream = self._server.cache_store.get_stream_handler(Streams.GRAPH) - setattr(graph_stream, '_graph_handlers', {0: GraphHandler()}) - args[1].return_value = mock_tensor_history() - res = self._server.retrieve_tensor_history('mock_node_name') - compare_debugger_result_with_file(res, 'debugger_server/retrieve_tensor_history.json') - - @mock.patch.object(TensorHandler, 'get') - @mock.patch.object(DebuggerServer, '_get_tensor_name_and_type_by_ui_name') - def test_retrieve_tensor_value(self, *args): - """Test retrieve tensor value.""" - mock_tensor_value = {'tensor_value': {'name': 'mock_name:0'}} - args[0].return_value = ('Parameter', 'mock_node_name', 'mock_graph_name') - args[1].return_value = mock_tensor_value - res = self._server.retrieve_tensor_value('mock_name:0', 'data', '[:, :]') - assert res == mock_tensor_value - - @mock.patch.object(WatchpointHandler, 'get') - def test_retrieve_watchpoints(self, *args): - """Test retrieve watchpoints.""" - mock_watchpoint = {'watch_points': {}} - args[0].return_value = mock_watchpoint - res = self._server._retrieve_watchpoint({}) - assert res == mock_watchpoint - - @mock.patch.object(DebuggerServer, '_retrieve_node') - def test_retrieve_watchpoint(self, *args): - """Test retrieve single watchpoint.""" - mock_watchpoint = {'nodes': {}} - args[0].return_value = mock_watchpoint - res = self._server._retrieve_watchpoint({'watch_point_id': 1}) - assert res == mock_watchpoint - - def test_create_watchpoint_with_wrong_state(self): - """Test create watchpoint with wrong state.""" - with pytest.raises(DebuggerCreateWatchPointError, match='Failed to create watchpoint'): - self._server.create_watchpoint({'watch_condition': {'id': 'inf'}}) - - @mock.patch.object(MetadataHandler, 'state', 'waiting') - @mock.patch.object(GraphHandler, 'get_node_basic_info', return_value=MagicMock()) - @mock.patch.object(GraphHandler, 'get_node_type', return_value='aggregation_scope') - @mock.patch.object(watchpoint_operator, 'get_basic_node_info', return_value=MagicMock()) - @mock.patch.object(WatchpointHandler, 'create_watchpoint') - def test_create_watchpoint(self, *args): - """Test create watchpoint.""" - args[0].return_value = 1 - self._server.cache_store.get_stream_handler((Streams.METADATA)).backend = 'GPU' - res = self._server.create_watchpoint( - {'watch_condition': {'id': 'tensor_too_large', 'params': [{'name': 'max_gt', 'value': 1.0}]}, - 'watch_nodes': ['watch_node_name']}) - assert res == {'id': 1, 'metadata': {'enable_recheck': False, 'state': 'waiting'}} - - @mock.patch.object(MultiCardGraphHandler, 'get_graph_handler_by_rank_id') - @mock.patch.object(MetadataHandler, 'state', 'waiting') - @mock.patch.object(GraphHandler, 'validate_graph_name', return_value='kernel_graph_0') - @mock.patch.object(GraphHandler, 'get_node_basic_info') - @mock.patch.object(GraphHandler, 'search_nodes') - @mock.patch.object(WatchpointHandler, 'validate_watchpoint_id') - @mock.patch.object(WatchpointHandler, 'update_watchpoint') - def test_update_watchpoint(self, *args): - """Test update watchpoint.""" - args[2].return_value = {'nodes': [{'name': 'mock_name', 'nodes': []}]} - res = self._server.update_watchpoint( - {'watch_point_id': 1, - 'watch_nodes': ['search_name'], - 'mode': 1, - 'search_pattern': {'name': 'search_name'}, - 'graph_name': 'kernel_graph_0'}) - assert res == {'metadata': {'enable_recheck': False, 'state': 'waiting'}} - - def test_delete_watchpoint_with_wrong_state(self): - """Test delete watchpoint with wrong state.""" - with pytest.raises(DebuggerDeleteWatchPointError, match='Failed to delete watchpoint'): - self._server.delete_watchpoint(watch_point_id=1) - - @mock.patch.object(MetadataHandler, 'enable_recheck', True) - @mock.patch.object(WatchpointHandler, 'is_recheckable', return_value=True) - @mock.patch.object(WatchpointHandler, 'delete_watchpoint') - def test_delete_watchpoint(self, *args): - """Test delete watchpoint with wrong state.""" - self._server.cache_store.get_stream_handler(Streams.METADATA).state = 'waiting' - args[0].return_value = None - res = self._server.delete_watchpoint(1) - assert res == {'metadata': {'enable_recheck': True, 'state': 'waiting'}} - - @mock.patch.object(MetadataHandler, 'state', ServerStatus.WAITING.value) - @mock.patch.object(WatchpointHitHandler, 'group_by') - @mock.patch.object(MultiCardWatchpointHitHandler, 'get_hit_handler_by_rank_id') - @mock.patch.object(MultiCardWatchpointHitHandler, 'check_rank_id') - @mock.patch.object(MultiCardGraphHandler, 'validate_rank_id') - def test_search_watchpoint_hits(self, *args): - """Test retrieve single watchpoint.""" - args[0].return_value = True - args[1].return_value = True - args[2].return_value = WatchpointHitHandler() - args[3].return_value = {'watch_point_hits': 'mocked_watch_point_hits'} - res = self._server.search_watchpoint_hits({'rank_id': 0}) - assert res == {'watch_point_hits': 'mocked_watch_point_hits', 'outdated': False} - - @mock.patch.object(MetadataHandler, 'state', ServerStatus.WAITING.value) - @mock.patch.object(MultiCardGraphHandler, 'validate_rank_id') - def test_search_watchpoint_hits_error_rank_id(self, *args): - """Test retrieve single watchpoint.""" - args[0].return_value = False - rank_id = 1 - with pytest.raises(DebuggerParamValueError, match="Parameter {} is not valid.".format(rank_id)): - self._server.search_watchpoint_hits({'rank_id': rank_id}) - - @mock.patch.object(MetadataHandler, 'state', ServerStatus.WAITING.value) - @mock.patch.object(MultiCardWatchpointHitHandler, 'check_rank_id') - @mock.patch.object(MultiCardGraphHandler, 'validate_rank_id') - def test_search_watchpoint_hits_no_hits(self, *args): - """Test retrieve single watchpoint.""" - args[0].return_value = True - args[1].return_value = False - res = self._server.search_watchpoint_hits({'rank_id': 0}) - assert res == {'outdated': False} -- Gitee From 7fff4b09516167a93415b79c1a5d269560c00555 Mon Sep 17 00:00:00 2001 From: maning202007 Date: Mon, 26 Aug 2024 11:40:35 +0800 Subject: [PATCH 2/2] delete debugger_code --- mindinsight/backend/config/gunicorn_conf.py | 2 - mindinsight/backend/data_manager/__init__.py | 7 - mindinsight/backend/debugger/__init__.py | 26 - mindinsight/backend/debugger/debugger_api.py | 508 ------- mindinsight/debugger/__init__.py | 28 - mindinsight/debugger/common/__init__.py | 15 - .../debugger/common/exceptions/__init__.py | 15 - .../debugger/common/exceptions/error_code.py | 103 -- .../debugger/common/exceptions/exceptions.py | 346 ----- mindinsight/debugger/common/log.py | 20 - mindinsight/debugger/common/utils.py | 450 ------ mindinsight/debugger/conditionmgr/__init__.py | 15 - .../debugger/conditionmgr/common/__init__.py | 15 - .../debugger/conditionmgr/common/utils.py | 18 - .../debugger/conditionmgr/condition.py | 309 ----- .../debugger/conditionmgr/condition_list.py | 476 ------- .../debugger/conditionmgr/conditionmgr.py | 110 -- .../debugger/conditionmgr/recommender.py | 514 ------- mindinsight/debugger/debugger_cache.py | 156 --- .../debugger/debugger_folder_analyzer.py | 25 - .../debugger/debugger_services/__init__.py | 15 - .../debugger_services/debugger_grpc_server.py | 716 ---------- .../debugger_online_server.py | 58 - .../debugger_services/debugger_server_base.py | 58 - .../debugger_server_factory.py | 92 -- mindinsight/debugger/debugger_session.py | 854 ------------ mindinsight/debugger/dump/__init__.py | 19 - mindinsight/debugger/dump/convert.py | 551 -------- mindinsight/debugger/dump/parser.py | 157 --- mindinsight/debugger/proto/debug_grpc.proto | 174 --- mindinsight/debugger/proto/debug_grpc_pb2.py | 1204 ----------------- .../debugger/proto/debug_grpc_pb2_grpc.py | 331 ----- mindinsight/debugger/session_manager.py | 189 --- mindinsight/debugger/stream_cache/__init__.py | 15 - .../debugger/stream_cache/data_loader.py | 427 ------ .../debugger/stream_cache/debugger_graph.py | 311 ----- .../stream_cache/debugger_multigraph.py | 102 -- .../debugger/stream_cache/graph_history.py | 64 - .../stream_cache/node_type_identifier.py | 160 --- mindinsight/debugger/stream_cache/tensor.py | 462 ------- .../debugger/stream_cache/watchpoint.py | 371 ----- .../debugger/stream_handler/__init__.py | 24 - .../debugger/stream_handler/base_handler.py | 34 - .../debugger/stream_handler/device_handler.py | 192 --- .../debugger/stream_handler/event_handler.py | 161 --- .../debugger/stream_handler/graph_handler.py | 699 ---------- .../stream_handler/graph_history_handler.py | 143 -- .../debugger/stream_handler/source_handler.py | 151 --- .../debugger/stream_handler/tensor_handler.py | 739 ---------- .../stream_handler/watchpoint_handler.py | 875 ------------ .../debugger/stream_operator/__init__.py | 15 - .../stream_operator/graph_runs_operator.py | 131 -- .../stream_operator/tensor_detail_info.py | 164 --- .../training_control_operator.py | 313 ----- .../stream_operator/watchpoint_operator.py | 325 ----- mindinsight/parser/README.md | 81 -- mindinsight/parser/README_CN.md | 81 -- mindinsight/parser/__init__.py | 14 - mindinsight/parser/dump.py | 86 -- mindinsight/scripts/start.py | 37 - tests/ut/scripts/test_start.py | 55 - 61 files changed, 13808 deletions(-) delete mode 100644 mindinsight/backend/debugger/__init__.py delete mode 100644 mindinsight/backend/debugger/debugger_api.py delete mode 100644 mindinsight/debugger/__init__.py delete mode 100644 mindinsight/debugger/common/__init__.py delete mode 100644 mindinsight/debugger/common/exceptions/__init__.py delete mode 100644 mindinsight/debugger/common/exceptions/error_code.py delete mode 100644 mindinsight/debugger/common/exceptions/exceptions.py delete mode 100644 mindinsight/debugger/common/log.py delete mode 100644 mindinsight/debugger/common/utils.py delete mode 100644 mindinsight/debugger/conditionmgr/__init__.py delete mode 100644 mindinsight/debugger/conditionmgr/common/__init__.py delete mode 100644 mindinsight/debugger/conditionmgr/common/utils.py delete mode 100644 mindinsight/debugger/conditionmgr/condition.py delete mode 100644 mindinsight/debugger/conditionmgr/condition_list.py delete mode 100644 mindinsight/debugger/conditionmgr/conditionmgr.py delete mode 100644 mindinsight/debugger/conditionmgr/recommender.py delete mode 100644 mindinsight/debugger/debugger_cache.py delete mode 100644 mindinsight/debugger/debugger_folder_analyzer.py delete mode 100644 mindinsight/debugger/debugger_services/__init__.py delete mode 100644 mindinsight/debugger/debugger_services/debugger_grpc_server.py delete mode 100644 mindinsight/debugger/debugger_services/debugger_online_server.py delete mode 100644 mindinsight/debugger/debugger_services/debugger_server_base.py delete mode 100644 mindinsight/debugger/debugger_services/debugger_server_factory.py delete mode 100644 mindinsight/debugger/debugger_session.py delete mode 100644 mindinsight/debugger/dump/__init__.py delete mode 100644 mindinsight/debugger/dump/convert.py delete mode 100644 mindinsight/debugger/dump/parser.py delete mode 100644 mindinsight/debugger/proto/debug_grpc.proto delete mode 100644 mindinsight/debugger/proto/debug_grpc_pb2.py delete mode 100644 mindinsight/debugger/proto/debug_grpc_pb2_grpc.py delete mode 100644 mindinsight/debugger/session_manager.py delete mode 100644 mindinsight/debugger/stream_cache/__init__.py delete mode 100644 mindinsight/debugger/stream_cache/data_loader.py delete mode 100644 mindinsight/debugger/stream_cache/debugger_graph.py delete mode 100644 mindinsight/debugger/stream_cache/debugger_multigraph.py delete mode 100644 mindinsight/debugger/stream_cache/graph_history.py delete mode 100644 mindinsight/debugger/stream_cache/node_type_identifier.py delete mode 100644 mindinsight/debugger/stream_cache/tensor.py delete mode 100644 mindinsight/debugger/stream_cache/watchpoint.py delete mode 100644 mindinsight/debugger/stream_handler/__init__.py delete mode 100644 mindinsight/debugger/stream_handler/base_handler.py delete mode 100644 mindinsight/debugger/stream_handler/device_handler.py delete mode 100644 mindinsight/debugger/stream_handler/event_handler.py delete mode 100644 mindinsight/debugger/stream_handler/graph_handler.py delete mode 100644 mindinsight/debugger/stream_handler/graph_history_handler.py delete mode 100644 mindinsight/debugger/stream_handler/source_handler.py delete mode 100644 mindinsight/debugger/stream_handler/tensor_handler.py delete mode 100644 mindinsight/debugger/stream_handler/watchpoint_handler.py delete mode 100644 mindinsight/debugger/stream_operator/__init__.py delete mode 100644 mindinsight/debugger/stream_operator/graph_runs_operator.py delete mode 100644 mindinsight/debugger/stream_operator/tensor_detail_info.py delete mode 100644 mindinsight/debugger/stream_operator/training_control_operator.py delete mode 100644 mindinsight/debugger/stream_operator/watchpoint_operator.py delete mode 100644 mindinsight/parser/README.md delete mode 100644 mindinsight/parser/README_CN.md delete mode 100644 mindinsight/parser/__init__.py delete mode 100644 mindinsight/parser/dump.py delete mode 100644 tests/ut/scripts/test_start.py diff --git a/mindinsight/backend/config/gunicorn_conf.py b/mindinsight/backend/config/gunicorn_conf.py index 6a528e68..b80aea6c 100644 --- a/mindinsight/backend/config/gunicorn_conf.py +++ b/mindinsight/backend/config/gunicorn_conf.py @@ -26,7 +26,6 @@ import psutil import gunicorn from mindinsight.utils.computing_resource_mgr import terminate -from mindinsight.debugger.session_manager import SessionManager gunicorn.SERVER_SOFTWARE = 'unknown' @@ -112,5 +111,4 @@ def worker_int(worker): global LISTEN_PROCESS if LISTEN_PROCESS is not None: LISTEN_PROCESS.terminate() - SessionManager.get_instance().exit() worker.log.info("Worker int processed.") diff --git a/mindinsight/backend/data_manager/__init__.py b/mindinsight/backend/data_manager/__init__.py index a91574e2..a65d6d24 100644 --- a/mindinsight/backend/data_manager/__init__.py +++ b/mindinsight/backend/data_manager/__init__.py @@ -19,11 +19,6 @@ from mindinsight.conf import settings from mindinsight.datavisual.common.log import logger from mindinsight.datavisual.data_transform.data_manager import DATA_MANAGER from mindinsight.lineagemgr.cache_item_updater import LineageCacheItemUpdater -from mindinsight.debugger.debugger_folder_analyzer import DebuggerFolderAnalyzer - -ANALYZERS = { - "debugger_folder_analyzer": DebuggerFolderAnalyzer() -} def init_module(app): @@ -36,8 +31,6 @@ def init_module(app): """ # Just to suppress pylint warning about unused arg. logger.debug("App: %s", type(app)) - for analyzer in ANALYZERS.values(): - DATA_MANAGER.register_folder_analyzer(analyzer) DATA_MANAGER.register_brief_cache_item_updater(LineageCacheItemUpdater()) # Let gunicorn load other modules first. time.sleep(1) diff --git a/mindinsight/backend/debugger/__init__.py b/mindinsight/backend/debugger/__init__.py deleted file mode 100644 index 41064a87..00000000 --- a/mindinsight/backend/debugger/__init__.py +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Module init file.""" -from mindinsight.backend.debugger.debugger_api import init_module as init_query_module - - -def init_module(app): - """ - Init module entry. - - Args: - app (Flask): A Flask instance. - """ - init_query_module(app) diff --git a/mindinsight/backend/debugger/debugger_api.py b/mindinsight/backend/debugger/debugger_api.py deleted file mode 100644 index 7baae403..00000000 --- a/mindinsight/backend/debugger/debugger_api.py +++ /dev/null @@ -1,508 +0,0 @@ -# Copyright 2020-2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Debugger restful api.""" -import json -import weakref - -from flask import Blueprint, jsonify, request, Response - -from mindinsight.conf import settings -from mindinsight.debugger.session_manager import SessionManager -from mindinsight.utils.exceptions import ParamMissError, ParamValueError, ParamTypeError - -BLUEPRINT = Blueprint("debugger", __name__, - url_prefix=settings.URL_PATH_PREFIX + settings.API_PREFIX) - - -def _read_post_request(post_request): - """ - Extract the body of post request. - - Args: - post_request (object): The post request. - - Returns: - dict, the deserialized body of request. - """ - body = post_request.stream.read() - try: - body = json.loads(body if body else "{}") - except Exception: - raise ParamValueError("Json data parse failed.") - return body - - -def to_int(param, param_name): - """Transfer param to int type.""" - try: - param = int(param) - except ValueError: - raise ParamTypeError(param_name, 'Integer') - return param - - -def _wrap_reply(func, *args, **kwargs): - """Serialize reply.""" - reply = func(*args, **kwargs) - return jsonify(reply) - - -@BLUEPRINT.route("/debugger/sessions//poll-data", methods=["GET"]) -def poll_data(session_id): - """ - Wait for data to be updated on UI. - - Get data from server and display the change on UI. - - Returns: - str, the updated data. - - Examples: - >>> Get http://xxxx/v1/mindinsight/debugger/sessions/xxxx/poll-data?pos=xx - """ - pos = request.args.get('pos') - - reply = _wrap_reply(_session_manager.get_session(session_id).poll_data, pos) - - return reply - - -@BLUEPRINT.route("/debugger/sessions//search", methods=["GET"]) -def search(session_id): - """ - Search nodes in specified watchpoint. - - Returns: - str, the required data. - - Examples: - >>> Get http://xxxx/v1/mindinsight/debugger/sessions/xxxx/search?name=mock_name&watch_point_id=1 - """ - name = request.args.get('name') - graph_name = request.args.get('graph_name') - watch_point_id = to_int(request.args.get('watch_point_id', 0), 'watch_point_id') - node_category = request.args.get('node_category') - rank_id = to_int(request.args.get('rank_id', 0), 'rank_id') - stack_pattern = request.args.get('stack_info_key_word') - reply = _wrap_reply(_session_manager.get_session(session_id).search, - {'name': name, - 'graph_name': graph_name, - 'watch_point_id': watch_point_id, - 'node_category': node_category, - 'rank_id': rank_id, - 'stack_pattern': stack_pattern}) - - return reply - - -@BLUEPRINT.route("/debugger/sessions//tensor-comparisons", methods=["GET"]) -def tensor_comparisons(session_id): - """ - Get tensor comparisons. - - Returns: - str, the required data. - - Examples: - >>> Get http://xxxx/v1/mindinsight/debugger/sessions/xxxx/tensor-comparisons - """ - name = request.args.get('name') - detail = request.args.get('detail', 'data') - shape = request.args.get('shape') - graph_name = request.args.get('graph_name', '') - tolerance = request.args.get('tolerance', '0') - rank_id = to_int(request.args.get('rank_id', 0), 'rank_id') - reply = _wrap_reply(_session_manager.get_session(session_id).tensor_comparisons, name, shape, - detail, tolerance, rank_id, graph_name) - - return reply - - -@BLUEPRINT.route("/debugger/sessions//retrieve", methods=["POST"]) -def retrieve(session_id): - """ - Retrieve data according to mode and params. - - Returns: - str, the required data. - - Examples: - >>> POST http://xxxx/v1/mindinsight/debugger/sessions/xxxx/retrieve - """ - body = _read_post_request(request) - mode = body.get('mode') - params = body.get('params') - reply = _wrap_reply(_session_manager.get_session(session_id).retrieve, mode, params) - return reply - - -@BLUEPRINT.route("/debugger/sessions//tensor-history", methods=["POST"]) -def retrieve_tensor_history(session_id): - """ - Retrieve data according to mode and params. - - Returns: - str, the required data. - - Examples: - >>> POST http://xxxx/v1/mindinsight/debugger/sessions/xxxx/tensor-history - """ - body = _read_post_request(request) - name = body.get('name') - graph_name = body.get('graph_name') - rank_id = to_int(body.get('rank_id', 0), 'rank_id') - reply = _wrap_reply(_session_manager.get_session(session_id).retrieve_tensor_history, name, graph_name, - rank_id) - return reply - - -@BLUEPRINT.route("/debugger/sessions//tensors", methods=["GET"]) -def retrieve_tensor_value(session_id): - """ - Retrieve tensor value according to name and shape. - - Returns: - str, the required data. - - Examples: - >>> GET http://xxxx/v1/mindinsight/debugger/sessions/xxxx/tensors?name=tensor_name&detail=data&shape=[1,1,:,:] - """ - name = request.args.get('name') - detail = request.args.get('detail') - shape = request.args.get('shape') - graph_name = request.args.get('graph_name') - prev = bool(request.args.get('prev') == 'true') - rank_id = to_int(request.args.get('rank_id', 0), 'rank_id') - - reply = _wrap_reply(_session_manager.get_session(session_id).retrieve_tensor_value, name, detail, - shape, graph_name, prev, rank_id) - return reply - - -@BLUEPRINT.route("/debugger/sessions//create-watchpoint", methods=["POST"]) -def create_watchpoint(session_id): - """ - Create watchpoint. - - Returns: - str, watchpoint id. - - Raises: - MindInsightException: If method fails to be called. - - Examples: - >>> POST http://xxxx/v1/mindinsight/debugger/sessions/xxxx/create-watchpoint - """ - params = _read_post_request(request) - params['watch_condition'] = params.pop('condition', None) - reply = _wrap_reply(_session_manager.get_session(session_id).create_watchpoint, params) - return reply - - -@BLUEPRINT.route("/debugger/sessions//update-watchpoint", methods=["POST"]) -def update_watchpoint(session_id): - """ - Update watchpoint. - - Returns: - str, reply message. - - Raises: - MindInsightException: If method fails to be called. - - Examples: - >>> POST http://xxxx/v1/mindinsight/debugger/sessions/xxxx/update-watchpoint - """ - params = _read_post_request(request) - reply = _wrap_reply(_session_manager.get_session(session_id).update_watchpoint, params) - return reply - - -@BLUEPRINT.route("/debugger/sessions//delete-watchpoint", methods=["POST"]) -def delete_watchpoint(session_id): - """ - Delete watchpoint. - - Returns: - str, reply message. - - Raises: - MindInsightException: If method fails to be called. - - Examples: - >>> POST http://xxxx/v1/mindinsight/debugger/sessions/xxxx/delete-watchpoint - """ - body = _read_post_request(request) - - watch_point_id = body.get('watch_point_id') - - reply = _wrap_reply(_session_manager.get_session(session_id).delete_watchpoint, watch_point_id) - - return reply - - -@BLUEPRINT.route("/debugger/sessions//control", methods=["POST"]) -def control(session_id): - """ - Control request. - - Returns: - str, reply message. - - Raises: - MindInsightException: If method fails to be called. - - Examples: - >>> POST http://xxxx/v1/mindinsight/debugger/sessions/xxxx/control - """ - params = _read_post_request(request) - reply = _wrap_reply(_session_manager.get_session(session_id).control, params) - - return reply - - -@BLUEPRINT.route("/debugger/sessions//recheck", methods=["POST"]) -def recheck(session_id): - """ - Recheck request. - - Returns: - str, reply message. - - Raises: - MindInsightException: If method fails to be called. - - Examples: - >>> POST http://xxxx/v1/mindinsight/debugger/sessions/xxxx/recheck - """ - reply = _wrap_reply(_session_manager.get_session(session_id).recheck) - - return reply - - -@BLUEPRINT.route("/debugger/sessions//tensor-graphs", methods=["GET"]) -def retrieve_tensor_graph(session_id): - """ - Retrieve tensor value according to name and shape. - - Returns: - str, the required data. - - Examples: - >>> GET http://xxxx/v1/mindinsight/debugger/sessions/xxxx/tensor-graphs?tensor_name=xxx&graph_name=xxx - """ - tensor_name = request.args.get('tensor_name') - graph_name = request.args.get('graph_name') - rank_id = to_int(request.args.get('rank_id', 0), 'rank_id') - reply = _wrap_reply(_session_manager.get_session(session_id).retrieve_tensor_graph, tensor_name, - graph_name, rank_id) - return reply - - -@BLUEPRINT.route("/debugger/sessions//tensor-hits", methods=["GET"]) -def retrieve_tensor_hits(session_id): - """ - Retrieve tensor value according to name and shape. - - Returns: - str, the required data. - - Examples: - >>> GET http://xxxx/v1/mindinsight/debugger/sessions/xxxx/tensor-hits?tensor_name=xxx&graph_name=xxx - """ - tensor_name = request.args.get('tensor_name') - graph_name = request.args.get('graph_name') - rank_id = to_int(request.args.get('rank_id', 0), 'rank_id') - reply = _wrap_reply(_session_manager.get_session(session_id).retrieve_tensor_hits, tensor_name, - graph_name, rank_id) - return reply - - -@BLUEPRINT.route("/debugger/sessions//search-watchpoint-hits", methods=["POST"]) -def search_watchpoint_hits(session_id): - """ - Search watchpoint hits by group condition. - - Returns: - str, the required data. - - Examples: - >>> POST http://xxxx/v1/mindinsight/debugger/sessions/xxxx/search-watchpoint-hits - """ - body = _read_post_request(request) - group_condition = body.get('group_condition') - reply = _wrap_reply(_session_manager.get_session(session_id).search_watchpoint_hits, group_condition) - return reply - - -@BLUEPRINT.route("/debugger/sessions//condition-collections", methods=["GET"]) -def get_condition_collections(session_id): - """Get condition collections.""" - reply = _wrap_reply(_session_manager.get_session(session_id).get_condition_collections) - return reply - - -@BLUEPRINT.route("/debugger/sessions//set-recommended-watch-points", methods=["POST"]) -def set_recommended_watch_points(session_id): - """Set recommended watch points.""" - body = _read_post_request(request) - request_body = body.get('requestBody') - if request_body is None: - raise ParamMissError('requestBody') - - set_recommended = request_body.get('set_recommended') - reply = _wrap_reply(_session_manager.get_session(session_id).set_recommended_watch_points, set_recommended) - return reply - - -@BLUEPRINT.route("/debugger/sessions//tensor-files/load", methods=["POST"]) -def load(session_id): - """ - Retrieve tensor value according to name and shape. - - Returns: - str, the required data. - - Examples: - >>> GET http://xxx/v1/mindinsight/debugger/sessions/xxxx/tensor-files/load - """ - body = _read_post_request(request) - name = body.get('name') - graph_name = body.get('graph_name') - rank_id = to_int(body.get('rank_id', 0), 'rank_id') - prev = bool(body.get('prev') == 'true') - reply = _wrap_reply(_session_manager.get_session(session_id).load, name, prev, graph_name, rank_id) - return reply - - -@BLUEPRINT.route("/debugger/sessions//tensor-files/download", methods=["GET"]) -def download(session_id): - """ - Retrieve tensor value according to name and shape. - - Returns: - str, the required data. - - Examples: - >>> GET http://xxx/v1/mindinsight/debugger/sessions/xxx/tensor-files/download?name=name&graph_name=xxx&prev=xxx - """ - name = request.args.get('name') - graph_name = request.args.get('graph_name') - rank_id = to_int(request.args.get('rank_id', 0), 'rank_id') - prev = bool(request.args.get('prev') == 'true') - file_name, file_path, clean_func = _session_manager.get_session(session_id).download(name, prev, graph_name, - rank_id) - - def file_send(): - with open(file_path, 'rb') as fb: - while True: - data = fb.read(50 * 1024 * 1024) - if not data: - break - yield data - - response = Response(file_send(), content_type='application/octet-stream') - response.headers["Content-disposition"] = 'attachment; filename=%s' % file_name - weakref.finalize(response, clean_func,) - return response - - -@BLUEPRINT.route("/debugger/sessions", methods=["POST"]) -def create_session(): - """ - Get session id if session exist, else create a session. - - Returns: - str, session id. - - Examples: - >>> POST http://xxxx/v1/mindinsight/debugger/sessions - """ - body = _read_post_request(request) - summary_dir = body.get('dump_dir') - session_type = body.get('session_type') - reply = _wrap_reply(_session_manager.create_session, session_type, summary_dir) - return reply - - -@BLUEPRINT.route("/debugger/sessions", methods=["GET"]) -def get_train_jobs(): - """ - Check the current active sessions. - - Examples: - >>> GET http://xxxx/v1/mindinsight/debugger/sessions - """ - reply = _wrap_reply(_session_manager.get_train_jobs) - return reply - - -@BLUEPRINT.route("/debugger/sessions//delete", methods=["POST"]) -def delete_session(session_id): - """ - Delete session by session id. - - Examples: - >>> POST http://xxxx/v1/mindinsight/debugger/xxx/delete-session - """ - reply = _wrap_reply(_session_manager.delete_session, session_id) - return reply - - -@BLUEPRINT.route("/debugger/sessions//stacks", methods=["GET"]) -def get_stack_infos(session_id): - """ - Get stack infos. - - Examples: - >>> GET /v1/mindsight/debugger/sessions//stacks?key_word=xxx&offset=0 - """ - key_word = request.args.get('key_word') - limit = int(request.args.get('limit', 10)) - offset = int(request.args.get('offset', 0)) - filter_condition = { - 'pattern': key_word, - 'limit': limit, - 'offset': offset - } - reply = _wrap_reply(_session_manager.get_session(session_id).get_stack_infos, filter_condition) - return reply - - -@BLUEPRINT.route("/debugger/sessions//ranks//graph-runs", methods=["GET"]) -def get_graph_runs(session_id, rank_id): - """ - Get graph runs. - - Examples: - >>> GET /v1/mindsight/debugger/sessions//ranks//graph-runs - """ - session = _session_manager.get_session(session_id) - rank_id = to_int(rank_id, 'rank_id') - reply = _wrap_reply(session.get_graph_runs, rank_id) - return reply - - -_session_manager = SessionManager.get_instance() - - -def init_module(app): - """ - Init module entry. - - Args: - app (Flask): The application obj. - """ - app.register_blueprint(BLUEPRINT) diff --git a/mindinsight/debugger/__init__.py b/mindinsight/debugger/__init__.py deleted file mode 100644 index 47c025f1..00000000 --- a/mindinsight/debugger/__init__.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2020-2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -MindSpore Debugger is a debugging tool for training in Graph Mode. It can be applied to visualize -and analyze the intermediate computation results of the computational graph. -In Graph Mode training, the computation results of intermediate nodes in the computational graph can not be acquired -conveniently, which makes it difficult for users to do the debugging. - -By applying MindSpore Debugger, users can:Visualize the computational graph on the UI and analyze the output -of the graph node.Set watchpoints to monitor training exceptions (for example, tensor overflow) and trace error causes. -Visualize and analyze the change of parameters, such as weights.Visualize the nodes and code mapping relationship. - -Debugger API is a python API interface provided for offline debugger. You need to save dump data before using it. -For the method of saving dump data, `refer to Using Dump in the Graph Mode -`_ . -""" diff --git a/mindinsight/debugger/common/__init__.py b/mindinsight/debugger/common/__init__.py deleted file mode 100644 index 37d8debb..00000000 --- a/mindinsight/debugger/common/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Common function for debugger.""" diff --git a/mindinsight/debugger/common/exceptions/__init__.py b/mindinsight/debugger/common/exceptions/__init__.py deleted file mode 100644 index 123deffc..00000000 --- a/mindinsight/debugger/common/exceptions/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Common exceptions for debugger.""" diff --git a/mindinsight/debugger/common/exceptions/error_code.py b/mindinsight/debugger/common/exceptions/error_code.py deleted file mode 100644 index ae858383..00000000 --- a/mindinsight/debugger/common/exceptions/error_code.py +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright 2020-2022 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Debugger error code and messages.""" -from enum import Enum, unique -from mindinsight.utils.constant import DebuggerErrors as DebuggerErrorCodes - - -_PARAM_ERROR_MASK = 0b00001 << 7 -_DEBUGGER_GRAPH_ERROR = 0b00010 << 7 -_DEBUGGER_RUNNING_ERROR = 0b00011 << 7 -_DEBUGGER_SERVER_ERROR = 0b00100 << 7 -_DEBUGGER_SESSION_ERROR = 0b00101 << 7 -_DEBUGGER_HISTORY_ERROR = 0b00110 << 7 - - -@unique -class DebuggerErrors(DebuggerErrorCodes): - """Debugger error codes.""" - PARAM_TYPE_ERROR = 0 | _PARAM_ERROR_MASK - PARAM_VALUE_ERROR = 1 | _PARAM_ERROR_MASK - STEP_NUM_ERROR = 2 | _PARAM_ERROR_MASK - DEBUGGER_CONDITION_UNAVAILABLE_ERROR = 3 | _PARAM_ERROR_MASK - - NODE_NOT_IN_GRAPH_ERROR = 0 | _DEBUGGER_GRAPH_ERROR - GRAPH_NOT_EXIST_ERROR = 1 | _DEBUGGER_GRAPH_ERROR - NODE_TOO_LARGE_ERROR = 2 | _DEBUGGER_GRAPH_ERROR - - CREATE_WATCHPOINT_ERROR = 0 | _DEBUGGER_RUNNING_ERROR - UPDATE_WATCHPOINT_ERROR = 1 | _DEBUGGER_RUNNING_ERROR - DELETE_WATCHPOINT_ERROR = 2 | _DEBUGGER_RUNNING_ERROR - CONTINUE_ERROR = 3 | _DEBUGGER_RUNNING_ERROR - PAUSE_ERROR = 4 | _DEBUGGER_RUNNING_ERROR - COMPARE_TENSOR_ERROR = 5 | _DEBUGGER_RUNNING_ERROR - RECHECK_ERROR = 6 | _DEBUGGER_RUNNING_ERROR - TENSOR_GRAPH_ERROR = 7 | _DEBUGGER_RUNNING_ERROR - TENSOR_HIT_ERROR = 8 | _DEBUGGER_RUNNING_ERROR - SET_RECOMMEND_WATCHPOINT_ERROR = 9 | _DEBUGGER_RUNNING_ERROR - - DEBUGGER_SERVER_RUNNING_ERROR = 0 | _DEBUGGER_SERVER_ERROR - DEVICE_ID_UNREGISTERED = 1 | _DEBUGGER_SERVER_ERROR - MODULE_NOT_FOUND_ERROR = 2 | _DEBUGGER_SERVER_ERROR - TOOLKIT_NOT_FOUND_ERROR = 3 | _DEBUGGER_SERVER_ERROR - - DEBUGGER_SESSION_OVER_BOUND_ERROR = 0 | _DEBUGGER_SESSION_ERROR - DEBUGGER_SESSION_NOT_FOUND_ERROR = 1 | _DEBUGGER_SESSION_ERROR - DEBUGGER_ONLINE_SESSION_UNAVAILABLE = 2 | _DEBUGGER_SESSION_ERROR - DEBUGGER_DOWNLOAD_OVER_QUEUE = 3 | _DEBUGGER_SESSION_ERROR - DEBUGGER_DOWNLOAD_TENSOR_NOT_EXIST = 4 | _DEBUGGER_SESSION_ERROR - DEBUGGER_RANK_DIR_NOT_FOUND = 5 | _DEBUGGER_SESSION_ERROR - DEBUGGER_JSON_FILE_PARSE_ERROR = 6 | _DEBUGGER_SESSION_ERROR - - DEBUGGER_HISTORY_NOT_FOUND_ERROR = 0 | _DEBUGGER_HISTORY_ERROR - DEBUGGER_STEP_VALUE_ERROR = 1 | _DEBUGGER_HISTORY_ERROR - - -@unique -class DebuggerErrorMsg(Enum): - """Debugger error messages.""" - PARAM_TYPE_ERROR = "TypeError. {}" - PARAM_VALUE_ERROR = "ValueError. {}" - DEBUGGER_CONDITION_UNAVAILABLE_ERROR = "Condition is unavailable. {}" - - GRAPH_NOT_EXIST_ERROR = "The graph does not exist." - NODE_TOO_LARGE_ERROR = "The nodes in dump directory is too large to analyze. " \ - "Node limit: {}, current node num: {}." - - CREATE_WATCHPOINT_ERROR = "Create watchpoint failed. {}" - UPDATE_WATCHPOINT_ERROR = "Update watchpoint failed. {}" - DELETE_WATCHPOINT_ERROR = "Delete watchpoint failed. {}" - CONTINUE_ERROR = "Continue debugging failed. {}" - PAUSE_ERROR = "Pause debugging failed. {}" - RECHECK_ERROR = "Recheck failed. {}" - TENSOR_GRAPH_ERROR = "Get tensor graphs failed." - TENSOR_HIT_ERROR = "Get tensor hits failed." - SET_RECOMMEND_WATCHPOINT_ERROR = "Set Recommend Watchpoints failed." - - DEBUGGER_SERVER_RUNNING_ERROR = "Debugger server running error. {}" - DEVICE_ID_UNREGISTERED = "Device id unregistered. Device id: {}" - MODULE_NOT_FOUND_ERROR = "{} module not found." - TOOLKIT_NOT_FOUND_ERROR = "File not found. {}" - - DEBUGGER_SESSION_OVER_BOUND_ERROR = "The amount of sessions is over limitation." - DEBUGGER_SESSION_NOT_FOUND_ERROR = "Session {} not found." - DEBUGGER_ONLINE_SESSION_UNAVAILABLE = "Online session is unavailable." - DEBUGGER_DOWNLOAD_OVER_QUEUE = "There is already a tensor in download" - DEBUGGER_DOWNLOAD_TENSOR_NOT_EXIST = "No such tensor to download" - DEBUGGER_RANK_DIR_NOT_FOUND = "No rank directory found under {}." - DEBUGGER_JSON_FILE_PARSE_ERROR = "Failed to parse the json files. {}" - - DEBUGGER_HISTORY_NOT_FOUND_ERROR = "The history of graph id: {} is not found." - DEBUGGER_STEP_VALUE_ERROR = "The dumped step value of graph {} is not the subset of graph history." diff --git a/mindinsight/debugger/common/exceptions/exceptions.py b/mindinsight/debugger/common/exceptions/exceptions.py deleted file mode 100644 index 15fdfdf7..00000000 --- a/mindinsight/debugger/common/exceptions/exceptions.py +++ /dev/null @@ -1,346 +0,0 @@ -# Copyright 2020-2022 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Definition of error code and relative messages in debugger module.""" -from mindinsight.utils.exceptions import MindInsightException -from mindinsight.debugger.common.exceptions.error_code import DebuggerErrors, DebuggerErrorMsg - - -class DebuggerParamTypeError(MindInsightException): - """The parameter type error in debugger module.""" - - def __init__(self, msg): - super(DebuggerParamTypeError, self).__init__( - error=DebuggerErrors.PARAM_TYPE_ERROR, - message=DebuggerErrorMsg.PARAM_TYPE_ERROR.value.format(msg), - http_code=400 - ) - - -class DebuggerParamValueError(MindInsightException): - """The parameter value error in debugger module.""" - - def __init__(self, msg): - super(DebuggerParamValueError, self).__init__( - error=DebuggerErrors.PARAM_VALUE_ERROR, - message=DebuggerErrorMsg.PARAM_VALUE_ERROR.value.format(msg), - http_code=400 - ) - - -class DebuggerCreateWatchPointError(MindInsightException): - """The error about creating watch point.""" - - def __init__(self, msg): - super(DebuggerCreateWatchPointError, self).__init__( - error=DebuggerErrors.CREATE_WATCHPOINT_ERROR, - message=DebuggerErrorMsg.CREATE_WATCHPOINT_ERROR.value.format(msg), - http_code=400 - ) - - -class DebuggerUpdateWatchPointError(MindInsightException): - """The error about updating watch point.""" - - def __init__(self, msg): - super(DebuggerUpdateWatchPointError, self).__init__( - error=DebuggerErrors.UPDATE_WATCHPOINT_ERROR, - message=DebuggerErrorMsg.UPDATE_WATCHPOINT_ERROR.value.format(msg), - http_code=400 - ) - - -class DebuggerDeleteWatchPointError(MindInsightException): - """The error about deleting watch point.""" - - def __init__(self, msg): - super(DebuggerDeleteWatchPointError, self).__init__( - error=DebuggerErrors.DELETE_WATCHPOINT_ERROR, - message=DebuggerErrorMsg.DELETE_WATCHPOINT_ERROR.value.format(msg), - http_code=400 - ) - - -class DebuggerRecheckError(MindInsightException): - """The error about deleting watch point.""" - - def __init__(self, msg): - super(DebuggerRecheckError, self).__init__( - error=DebuggerErrors.RECHECK_ERROR, - message=DebuggerErrorMsg.RECHECK_ERROR.value.format(msg), - http_code=400 - ) - - -class DebuggerCompareTensorError(MindInsightException): - """The error about comparing tensors.""" - - def __init__(self, msg): - super(DebuggerCompareTensorError, self).__init__( - error=DebuggerErrors.COMPARE_TENSOR_ERROR, - message=msg, - http_code=400 - ) - - -class DebuggerContinueError(MindInsightException): - """The error about continuing debugging.""" - def __init__(self, msg): - super(DebuggerContinueError, self).__init__( - error=DebuggerErrors.CONTINUE_ERROR, - message=DebuggerErrorMsg.CONTINUE_ERROR.value.format(msg), - http_code=400 - ) - - -class DebuggerPauseError(MindInsightException): - """The error about pausing debugging.""" - def __init__(self, msg): - super(DebuggerPauseError, self).__init__( - error=DebuggerErrors.PAUSE_ERROR, - message=DebuggerErrorMsg.PAUSE_ERROR.value.format(msg), - http_code=400 - ) - - -class DebuggerNodeNotInGraphError(MindInsightException): - """The node is not in the graph.""" - def __init__(self, node_name, node_type=None): - if node_type is not None: - err_msg = f"Cannot find the node in graph by the given name. node name: {node_name}, type: {node_type}." - else: - err_msg = f"Cannot find the node in graph by the given name. node name: {node_name}." - super(DebuggerNodeNotInGraphError, self).__init__( - error=DebuggerErrors.NODE_NOT_IN_GRAPH_ERROR, - message=err_msg, - http_code=400 - ) - - -class DebuggerGraphNotExistError(MindInsightException): - """The graph does not exist.""" - def __init__(self): - super(DebuggerGraphNotExistError, self).__init__( - error=DebuggerErrors.GRAPH_NOT_EXIST_ERROR, - message=DebuggerErrorMsg.GRAPH_NOT_EXIST_ERROR.value, - http_code=400 - ) - - -class DebuggerStepNumError(MindInsightException): - """The graph does not exist.""" - def __init__(self): - super(DebuggerStepNumError, self).__init__( - error=DebuggerErrors.STEP_NUM_ERROR, - message="The type of step number should be int32.", - http_code=400 - ) - - -class DebuggerTensorGraphError(MindInsightException): - """The error about comparing tensors.""" - - def __init__(self): - super(DebuggerTensorGraphError, self).__init__( - error=DebuggerErrors.TENSOR_GRAPH_ERROR, - message=DebuggerErrorMsg.TENSOR_GRAPH_ERROR.value, - http_code=400 - ) - - -class DebuggerTensorHitError(MindInsightException): - """The error about comparing tensors.""" - - def __init__(self): - super(DebuggerTensorHitError, self).__init__( - error=DebuggerErrors.TENSOR_HIT_ERROR, - message=DebuggerErrorMsg.TENSOR_HIT_ERROR.value, - http_code=400 - ) - - -class DebuggerSetRecommendWatchpointsError(MindInsightException): - """The set recommend watchpoints error in debugger module.""" - - def __init__(self): - super(DebuggerSetRecommendWatchpointsError, self).__init__( - error=DebuggerErrors.SET_RECOMMEND_WATCHPOINT_ERROR, - message=DebuggerErrorMsg.SET_RECOMMEND_WATCHPOINT_ERROR.value, - http_code=400 - ) - - -class DebuggerConditionUnavailableError(MindInsightException): - """The condition unavailable error in debugger module.""" - - def __init__(self, msg): - super(DebuggerConditionUnavailableError, self).__init__( - error=DebuggerErrors.DEBUGGER_CONDITION_UNAVAILABLE_ERROR, - message=DebuggerErrorMsg.DEBUGGER_CONDITION_UNAVAILABLE_ERROR.value.format(msg), - http_code=400 - ) - - -class DebuggerServerRunningError(MindInsightException): - """The server running error in debugger module.""" - - def __init__(self, msg): - super(DebuggerServerRunningError, self).__init__( - error=DebuggerErrors.DEBUGGER_SERVER_RUNNING_ERROR, - message=DebuggerErrorMsg.DEBUGGER_SERVER_RUNNING_ERROR.value.format(msg), - http_code=500 - ) - - -class DeviceIdUnregistered(MindInsightException): - """The error of that the device id is unregister.""" - - def __init__(self, msg): - super(DeviceIdUnregistered, self).__init__( - error=DebuggerErrors.DEVICE_ID_UNREGISTERED, - message=DebuggerErrorMsg.DEVICE_ID_UNREGISTERED.value.format(msg), - http_code=400 - ) - - -class DebuggerModuleNotFoundError(MindInsightException): - """The error of that the module is not found.""" - - def __init__(self, msg): - super(DebuggerModuleNotFoundError, self).__init__( - error=DebuggerErrors.MODULE_NOT_FOUND_ERROR, - message=DebuggerErrorMsg.MODULE_NOT_FOUND_ERROR.value.format(msg), - http_code=500 - ) - - -class DebuggerSessionNumOverBoundError(MindInsightException): - """The error of that the session number is out of bound.""" - - def __init__(self): - super(DebuggerSessionNumOverBoundError, self).__init__( - error=DebuggerErrors.DEBUGGER_SESSION_OVER_BOUND_ERROR, - message=DebuggerErrorMsg.DEBUGGER_SESSION_OVER_BOUND_ERROR.value, - http_code=400 - ) - - -class DebuggerSessionNotFoundError(MindInsightException): - """The error of that the session is not found.""" - - def __init__(self, msg): - super(DebuggerSessionNotFoundError, self).__init__( - error=DebuggerErrors.DEBUGGER_SESSION_NOT_FOUND_ERROR, - message=DebuggerErrorMsg.DEBUGGER_SESSION_NOT_FOUND_ERROR.value.format(msg), - http_code=400 - ) - - -class DebuggerOnlineSessionUnavailable(MindInsightException): - """The error of that the online session is unavailable.""" - - def __init__(self): - super(DebuggerOnlineSessionUnavailable, self).__init__( - error=DebuggerErrors.DEBUGGER_ONLINE_SESSION_UNAVAILABLE, - message=DebuggerErrorMsg.DEBUGGER_ONLINE_SESSION_UNAVAILABLE.value, - http_code=400 - ) - - -class DebuggerDownloadOverQueue(MindInsightException): - """The error of that the download queue is oversize.""" - - def __init__(self): - super(DebuggerDownloadOverQueue, self).__init__( - error=DebuggerErrors.DEBUGGER_DOWNLOAD_OVER_QUEUE, - message=DebuggerErrorMsg.DEBUGGER_DOWNLOAD_OVER_QUEUE.value, - http_code=400 - ) - - -class DebuggerDownloadTensorNotExist(MindInsightException): - """The error of that the Tensor is not exist.""" - - def __init__(self): - super(DebuggerDownloadTensorNotExist, self).__init__( - error=DebuggerErrors.DEBUGGER_DOWNLOAD_TENSOR_NOT_EXIST, - message=DebuggerErrorMsg.DEBUGGER_DOWNLOAD_TENSOR_NOT_EXIST.value, - http_code=400 - ) - - -class RankDirNotFound(MindInsightException): - """The error of that the dumped rank directory is not found.""" - - def __init__(self, msg): - super(RankDirNotFound, self).__init__( - error=DebuggerErrors.DEBUGGER_RANK_DIR_NOT_FOUND, - message=DebuggerErrorMsg.DEBUGGER_RANK_DIR_NOT_FOUND.value.format(msg), - http_code=400 - ) - - -class DebuggerJsonFileParseError(MindInsightException): - """The error of that failed to parse the debugger json files.""" - - def __init__(self, msg): - super(DebuggerJsonFileParseError, self).__init__( - error=DebuggerErrors.DEBUGGER_JSON_FILE_PARSE_ERROR, - message=DebuggerErrorMsg.DEBUGGER_JSON_FILE_PARSE_ERROR.value.format(msg), - http_code=400 - ) - - -class DebuggerHistoryNotFoundError(MindInsightException): - """The graph history and graph file doesn't match.""" - - def __init__(self, msg): - super(DebuggerHistoryNotFoundError, self).__init__( - error=DebuggerErrors.DEBUGGER_HISTORY_NOT_FOUND_ERROR, - message=DebuggerErrorMsg.DEBUGGER_HISTORY_NOT_FOUND_ERROR.value.format(msg), - http_code=500 - ) - - -class DebuggerHistoryValueError(MindInsightException): - """The dumped step id is not belong to relative graph history.""" - - def __init__(self, graph_id): - super(DebuggerHistoryValueError, self).__init__( - error=DebuggerErrors.DEBUGGER_STEP_VALUE_ERROR, - message=DebuggerErrorMsg.DEBUGGER_STEP_VALUE_ERROR.value.format(graph_id), - http_code=500 - ) - - -class DebuggerToolkitNotFoundError(MindInsightException): - """The error of that the module is not found.""" - - def __init__(self, msg): - super(DebuggerToolkitNotFoundError, self).__init__( - error=DebuggerErrors.TOOLKIT_NOT_FOUND_ERROR, - message=DebuggerErrorMsg.TOOLKIT_NOT_FOUND_ERROR.value.format(msg), - http_code=500 - ) - - -class DebuggerNodeTooLarge(MindInsightException): - """The error of that the module is not found.""" - - def __init__(self, limit, actual_val): - super(DebuggerNodeTooLarge, self).__init__( - error=DebuggerErrors.NODE_TOO_LARGE_ERROR, - message=DebuggerErrorMsg.NODE_TOO_LARGE_ERROR.value.format(limit, actual_val), - http_code=500 - ) diff --git a/mindinsight/debugger/common/log.py b/mindinsight/debugger/common/log.py deleted file mode 100644 index 4285f8c8..00000000 --- a/mindinsight/debugger/common/log.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Import mindinsight unified log module.""" -from mindinsight.utils.log import setup_logger - -LOG_NAME = "debugger" -LOG_MODULE = "debugger" -LOGGER = setup_logger(sub_module=LOG_MODULE, log_name=LOG_NAME) diff --git a/mindinsight/debugger/common/utils.py b/mindinsight/debugger/common/utils.py deleted file mode 100644 index 462a9bb9..00000000 --- a/mindinsight/debugger/common/utils.py +++ /dev/null @@ -1,450 +0,0 @@ -# Copyright 2020-2022 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Define the utils.""" -import enum -import gc -import os -import stat -import re -import struct -import tempfile -import time -from functools import wraps - -import numpy as np - -from mindinsight.conf import settings -from mindinsight.debugger.common.exceptions.exceptions import DebuggerParamTypeError, DebuggerParamValueError -from mindinsight.debugger.common.log import LOGGER as log -from mindinsight.debugger.proto.debug_grpc_pb2 import EventReply -from mindinsight.domain.graph.base import NodeTypeEnum -from mindinsight.domain.graph.proto.ms_graph_pb2 import DataType -from mindinsight.utils.tensor import Statistics - -# translate the MindSpore type to numpy type. -NUMPY_TYPE_MAP = { - 'DT_BOOL': bool, - - 'DT_INT8': np.int8, - 'DT_INT16': np.int16, - 'DT_INT32': np.int32, - 'DT_INT64': np.int64, - - 'DT_UINT8': np.uint8, - 'DT_UINT16': np.uint16, - 'DT_UINT32': np.uint32, - 'DT_UINT64': np.uint64, - - 'DT_FLOAT16': np.float16, - 'DT_FLOAT32': np.float32, - 'DT_FLOAT64': np.float64, - - 'DT_STRING': np.str_, - 'DT_TYPE': np.str_ -} - -# The buffer is used for the MI side of the offline debugger, the unit is MB. -BUFFER_MS = 1024 -# The offline debugger need at least 2g memory space. -MAX_CACHE_SPACE_MB = max(((settings.OFFLINE_DEBUGGER_MEM_LIMIT - BUFFER_MS) // 3), 2 * 1024) -MAX_MS_CACHE_SPACE_MB = settings.OFFLINE_DEBUGGER_MEM_LIMIT - BUFFER_MS - MAX_CACHE_SPACE_MB -MAX_CACHE_SPACE_BYTES = MAX_CACHE_SPACE_MB * 1024 * 1024 -# The debugger need to cache 2 tensors. -MAX_SINGLE_TENSOR_CACHE_BYTES = 1024 * 1024 * 1024 - - -@enum.unique -class ReplyStates(enum.Enum): - """Define the status of reply.""" - SUCCESS = 0 - FAILED = -1 - - -@enum.unique -class ServerStatus(enum.Enum): - """The status of debugger server.""" - PENDING = 'pending' # no client session has been connected - RECEIVE_GRAPH = 'receive_graph' # the client session has sent the graph - WAITING = 'waiting' # the client session is ready - RUNNING = 'running' # the client session is running a script - MISMATCH = 'mismatch' # the version of MindSpore and MindInsight is not matched - SENDING = 'sending' # the request is in cache but not be sent to client - NODE_TOO_LARGE = 'node_too_large' # the nodes is too large to analyze - - @classmethod - def is_normal_state(cls, state): - """ - Check the server is in normal state. - - Args: - state (str): The value of ServerStatus. - - Returns: - bool, if current server is working successfully. - """ - normal_state = [cls.RECEIVE_GRAPH.value, - cls.WAITING.value, - cls.RUNNING.value, - cls.SENDING.value] - return state in normal_state - - -@enum.unique -class Streams(enum.Enum): - """Define the enable streams to be deal with.""" - - COMMAND = "command" - DATA = "data" - METADATA = "metadata" - GRAPH = 'node' - TENSOR = 'tensor' - WATCHPOINT = 'watchpoint' - WATCHPOINT_HIT = 'watchpoint_hit' - DEVICE = 'device' - GRAPH_HISTORY = 'graph_history' - - -class RunLevel(enum.Enum): - """ - Run Level enum, it depends on whether the program is executed node by node, - step by step, or in recheck phase. - """ - NODE = "node" - STEP = "step" - RECHECK = "recheck" - - -class ViewCommandLevelEnum(enum.Enum): - """Tensor status.""" - BASE = "base" - STATS = "stats" - VALUE = 'value' - - -def get_ack_reply(state=0): - """The the ack EventReply.""" - reply = EventReply() - state_mapping = { - 0: EventReply.Status.OK, - 1: EventReply.Status.FAILED, - 2: EventReply.Status.PENDING - } - reply.status = state_mapping.get(state, EventReply.Status.FAILED) - - return reply - - -def wrap_reply_response(error_code=None, error_message=None): - """ - Wrap reply response. - - Args: - error_code (str): Error code. Default: None. - error_message (str): Error message. Default: None. - - Returns: - str, serialized response. - """ - if error_code is None: - reply = {'state': ReplyStates.SUCCESS.value} - else: - reply = { - 'state': ReplyStates.FAILED.value, - 'error_code': error_code, - 'error_message': error_message - } - - return reply - - -def create_view_event_from_tensor_basic_info(tensors_info): - """ - Create view event reply according to tensor names. - - Args: - tensors_info (list[TensorBasicInfo]): The list of TensorBasicInfo. Each element has keys: - `full_name`, `node_type`, `iter`. - - Returns: - EventReply, the event reply with view cmd. - """ - view_event = get_ack_reply() - for tensor_info in tensors_info: - node_type = tensor_info.node_type - if node_type == NodeTypeEnum.CONST.value: - truncate_tag = node_type == NodeTypeEnum.CONST.value - else: - truncate_tag = node_type == NodeTypeEnum.PARAMETER.value - tensor_name = tensor_info.full_name - # create view command - ms_tensor = view_event.view_cmd.tensors.add() - ms_tensor.node_name, ms_tensor.slot = tensor_name.rsplit(':', 1) - ms_tensor.truncate = truncate_tag - ms_tensor.iter = tensor_info.iter - - return view_event - - -def is_scope_type(node_type): - """Judge whether the type is scope type.""" - return node_type.endswith('scope') - - -def is_cst_type(node_type): - """Judge whether the type is const type.""" - return node_type == NodeTypeEnum.CONST.value - - -@enum.unique -class DebuggerServerMode(enum.Enum): - """Debugger Server Mode.""" - ONLINE = 'online' - OFFLINE = 'offline' - - -class DumpSettings(enum.Enum): - """Dump settings.""" - E2E_DUMP_SETTINGS = 'e2e_dump_settings' - COMMON_DUMP_SETTINGS = 'common_dump_settings' - ASYNC_DUMP_SETTINGS = 'async_dump_settings' - - -def is_valid_rank_dir_name(name): - """Check if the name followed the rank directory format.""" - return bool(re.search(r'^rank_\d+$', name)) - - -def load_tensor(load_info, step, request_iterator, cache_store, rank_id): - """Load tensor to tmp file.""" - file_mode = 0o600 - dir_mode = 0o700 - if load_info.get('prev') == 'prev': - step -= 1 - tensor_stream = cache_store.get_stream_handler(Streams.TENSOR).get_tensor_handler_by_rank_id(rank_id) - temp_dir = tempfile.TemporaryDirectory(dir=tensor_stream.download_mgr.temp_base_dir) - os.chmod(temp_dir.name, dir_mode) - node_name, slot = load_info.get('tensor_name').rsplit(':', 1) - _, node_name = node_name.rsplit('/', 1) - # Carry 2 digit for timestamp to ensure remaining 12 digit after round method - file_name = get_download_file_name(load_info.get('node_type'), node_name, slot) - file_path = os.path.join(temp_dir.name, file_name) - tensor = next(request_iterator) - header = _generate_npy_header(tensor) - _write_tensor(file_path, header) - os.chmod(file_path, file_mode) - _write_tensor(file_path, tensor.tensor_content) - for tensor in request_iterator: - _write_tensor(file_path, tensor.tensor_content) - add_to_download_mgr(file_name, file_path, temp_dir, load_info, step, rank_id, cache_store) - - -def add_to_download_mgr(file_name, file_path, temp_dir, load_info, step, rank_id, cache_store): - """Add the tensor info to download manager""" - tensor_info = { - "tensor_name": load_info.get("tensor_name"), - "graph_name": load_info.get("graph_name"), - "step": step, - "rank_id": rank_id - } - tensor_stream = cache_store.get_stream_handler(Streams.TENSOR).get_tensor_handler_by_rank_id(rank_id) - tensor_stream.download_mgr.add(file_name, file_path, temp_dir, **tensor_info) - metadata = cache_store.get_stream_handler(Streams.METADATA).get(['step', 'state']) - ret = { - 'tensor_file': True, - 'node_name': load_info.get("node_name") - } - ret.update(metadata) - cache_store.put_data(ret) - - -def get_download_file_name(node_type, node_name, slot): - """Get file name.""" - timestamp_carry = 100 - file_name = "{}.{}.0.0.{}.output.{}.NONE.npy".format(node_type, node_name, round(time.time() * timestamp_carry), - slot) - return file_name - - -def _generate_npy_header(tensor_proto): - """Generate the header for npy file.""" - shape = tuple(tensor_proto.dims) - if shape == (0,): - shape = () - np_type = np.dtype(NUMPY_TYPE_MAP.get(DataType.Name(tensor_proto.data_type))) - array_info = "{" + "'descr': {}, 'fortran_order': False, 'shape': {}".format(repr(np_type.str), - repr(shape)) + "}" - array_info = array_info.encode('latin1') - header_length = len(array_info) + 1 - # the length of npy header need to be divided by 64 exactly, so fill by b' '. - padding_length = 64 - ((10 + header_length) % 64) - header = b'\x93NUMPY' + bytes([1, 0]) + struct.pack(' 0 else cur_step - if tensor_stats is None or tensor_stats.get("tensor_base", {}).get("data_size", 0) == 0: - has_update = tensor_stream.put_empty_tensor(name, step) - else: - has_update = tensor_stream.put_tensor_stats(name, step, tensor_stats.get("tensor_base"), - tensor_stats.get("tensor_stats")) - if has_update: - update_data_flag = True - return update_data_flag - - -def put_tensor_base_in_cache(tensor_base_list, tensor_protos, cur_step, tensor_stream): - """Put tensor base in cache.""" - update_data_flag = False - for tensor_base, tensor_proto in zip(tensor_base_list, tensor_protos): - name = ':'.join([tensor_proto.node_name, tensor_proto.slot]) - step = cur_step - 1 if tensor_proto.iter and cur_step > 0 else cur_step - if tensor_base is None: - has_update = tensor_stream.put_empty_tensor(name, step) - else: - has_update = tensor_stream.put_tensor_base(name, step, tensor_base) - if has_update: - update_data_flag = True - return update_data_flag - - -def get_tensor_value(tensor_proto, tensor_contents, node_info, cur_step, oversize, data_size): - """Get tensor value.""" - tensor_base = { - 'dtype': tensor_proto.data_type, - 'shape': tensor_proto.dims, - 'data_size': data_size - } - value = { - 'step': cur_step - 1 if tensor_proto.iter and cur_step > 0 else cur_step, - 'name': ':'.join([tensor_proto.node_name, tensor_proto.slot]), - 'tensor_base': tensor_base, - 'tensor_contents': tensor_contents if not oversize else [], - 'stats': bool(node_info and node_info.get('stats', False)), - 'oversize': oversize - } - return value - - -def validate_type(param, param_name, expect_type, expect_type_name=None): - """Validate type.""" - expect_types = expect_type - if isinstance(expect_types, list): - expect_types = tuple(expect_types) - if not isinstance(param, expect_types): - expect_type_name = expect_type_name if expect_type_name else expect_type - raise DebuggerParamTypeError(f"The type of {param_name} should be {expect_type_name}, but got {type(param)}.") - - -def parse_param_to_iterable_obj(param, param_name, expected_range=None, error_report=True): - """ - Get iterable int objects which should in expected range. - - Args: - param (Union[int, list[int], None], optional): The input param. - param_name (str): The name of the param. - expected_range (set[int]): The acceptable range of param value. Default None, - no check for value. - error_report (bool): Whether raise Exception if the value is not in expected_range. - - Returns: - list[int], list of param objects. - """ - if param is None: - return expected_range - if isinstance(param, set): - param = list(param) - if not isinstance(param, list): - param = [param] - # validate ranks - res = [] - for param_item in param: - validate_type(param_item, param_name, int, 'int, list[int] or None') - if expected_range and param_item not in expected_range: - if error_report: - raise DebuggerParamValueError(f"The value should be in {expected_range}") - continue - res.append(param_item) - return res - - -def validate_slots(slots): - """Validate slots is List[int] or None.""" - if slots is None: - return - if not isinstance(slots, list): - raise TypeError(f"The param `slots` only support list[int] or None, but got {type(slots)}") - for slot in slots: - validate_type(slot, 'slot', int, 'list[int] or None') - - -def gc_disable(func): - """Wrapper for disable gc.""" - - @wraps(func) - def disable(*args, **kwargs): - gc_threshold = gc.get_threshold() - # disable gc collection during parse graphs - gc.set_threshold(0) - try: - return func(*args, **kwargs) - finally: - gc.set_threshold(*gc_threshold) - - return disable - - -def enter_tag(func): - """Wrapper for add enter and exit log.""" - - @wraps(func) - def add_log(*args, **kwargs): - try: - log.debug("Enter func: %s", func.__name__) - return func(*args, **kwargs) - finally: - log.debug("Exit func: %s", func.__name__) - - return add_log diff --git a/mindinsight/debugger/conditionmgr/__init__.py b/mindinsight/debugger/conditionmgr/__init__.py deleted file mode 100644 index 63d3cf18..00000000 --- a/mindinsight/debugger/conditionmgr/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Provide condition manager function.""" diff --git a/mindinsight/debugger/conditionmgr/common/__init__.py b/mindinsight/debugger/conditionmgr/common/__init__.py deleted file mode 100644 index 540b0f83..00000000 --- a/mindinsight/debugger/conditionmgr/common/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Common module.""" diff --git a/mindinsight/debugger/conditionmgr/common/utils.py b/mindinsight/debugger/conditionmgr/common/utils.py deleted file mode 100644 index 4fc0be99..00000000 --- a/mindinsight/debugger/conditionmgr/common/utils.py +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Utils module.""" -from collections import namedtuple - -NodeBasicInfo = namedtuple('node_basic_info', ['name', 'full_name', 'type']) diff --git a/mindinsight/debugger/conditionmgr/condition.py b/mindinsight/debugger/conditionmgr/condition.py deleted file mode 100644 index c9ba8c2b..00000000 --- a/mindinsight/debugger/conditionmgr/condition.py +++ /dev/null @@ -1,309 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -Management of all conditions. - -This module is used to register all conditions, as well as their parameters. -This module also provide the available conditions to condition_collections api. -""" -from enum import Enum -from mindinsight.debugger.common.log import LOGGER as logger - - -class ParamNameEnum(Enum): - """Param names.""" - ABS_MEAN_GT = "abs_mean_gt" - ABS_MEAN_LT = "abs_mean_lt" - ABS_MEAN_UPDATE_RATIO_GT = "abs_mean_update_ratio_gt" - ABS_MEAN_UPDATE_RATIO_LT = "abs_mean_update_ratio_lt" - ATOL = "atol" - EQUAL_NAN = "equal_nan" - EPSILON = "epsilon" - MAX_GT = "max_gt" - MAX_LT = "max_lt" - MIN_GT = "min_gt" - MIN_LT = "min_lt" - MEAN_GT = "mean_gt" - MEAN_LT = "mean_lt" - MAX_MIN_GT = "max_min_gt" - MAX_MIN_LT = "max_min_lt" - PARAM = "param" - RANGE_START_INCLUSIVE = "range_start_inclusive" - RANGE_END_INCLUSIVE = "range_end_inclusive" - RANGE_PERCENTAGE_GT = "range_percentage_gt" - RANGE_PERCENTAGE_LT = "range_percentage_lt" - RTOL = "rtol" - ZERO_PERCENTAGE_GE = "zero_percentage_ge" - - -class ConditionIdEnum(Enum): - """Condition ids.""" - WEIGHT_INITIALIZATION = "weight_initialization" - WEIGHT_OVERFLOW = "weight_overflow" - WEIGHT_TOO_LARGE = "weight_too_large" - WEIGHT_TOO_SMALL = "weight_too_small" - GRADIENT_VANISHING = "gradient_vanishing" - GRADIENT_TOO_LARGE = "gradient_too_large" - GRADIENT_EXPLODING = "gradient_exploding" - TENSOR_OVERFLOW = "tensor_overflow" - OPERATOR_OVERFLOW = "operator_overflow" - TENSOR_TOO_LARGE = "tensor_too_large" - TENSOR_TOO_SMALL = "tensor_too_small" - TENSOR_ALL_ZERO = "tensor_all_zero" - WEIGHT_NOT_CHANGED = "weight_not_changed" - WEIGHT_CHANGE_TOO_LARGE = "weight_change_too_large" - WEIGHT_CHANGE_TOO_SMALL = "weight_change_too_small" - ACTIVATION_RANGE = "activation_range" - TENSOR_RANGE = "tensor_range" - - -class OptimizePhaseEnum(Enum): - """Optimize phases.""" - TENSOR_CHECK = 400 - OPERATOR_CHECK = 100 - LOSS_CHECK = 300 - INPUT_DATA_CHECK = 200 - - -class ValueTypeEnum(Enum): - """Value types.""" - FLOAT64 = 1 - INT64 = 2 - BOOL = 3 - - -class PlatformEnum(Enum): - """Platform types.""" - GPU = "GPU" - ASCEND = "Ascend" - - -class TargetTypeEnum(Enum): - """Target types.""" - TENSOR = 'tensor' - ACTIVATION = 'activation' - GRADIENT = 'gradient' - PARAMETER = 'parameter' - WEIGHT = 'weight' - - -class ParamTypeEnum(Enum): - """Param types.""" - CHECK_PARAM = "CHECK_PARAM" - SUPPORT_PARAM = "SUPPORT_PARAM" - - -class ActivationFuncEnum(Enum): - """Activation functions.""" - TANH = 'tanh' - SIGMOID = 'sigmoid' - RELU = 'relu' - RELUV2 = 'reluv2' - - -class ConditionContext: - """ - The class for condition context. - - Args: - backend (str): parameter name. - step (int): the type of value. - debugger_capability (tuple): whether the param support no assignment. - """ - def __init__(self, backend, step=0, debugger_capability=(1, 1)): - self._backend = backend - self._step = step - self._debugger_capability = debugger_capability - - @property - def backend(self): - """Get backend.""" - return self._backend - - @property - def step(self): - """Get _step.""" - return self._step - - @property - def debugger_capability(self): - """Get debugger_capability.""" - return self._debugger_capability - - -class ConditionParameter: - """ - The class for parameters of conditions. - - Args: - name (ParamNameEnum): parameter name. - value_type (ValueTypeEnum): the type of value. - valid_test_func (func): the function used to test whether the param is valid. - support_disable (bool): whether the param support no assignment. - default_value (float): default value. - visible_on_ui (bool): whether the param visible on ui. - param_type (ParamTypeEnum): parameters type. - required_params (list): the list of required parameters. - """ - - def __init__(self, name, value_type: ValueTypeEnum, valid_test_func=None, support_disable=True, default_value=None, - visible_on_ui=True, param_type=ParamTypeEnum.CHECK_PARAM, required_params=None): - self._name = name.value - self._type = value_type - self._valid_test_func = valid_test_func - self._support_disable = support_disable - self._default_value = default_value - self._visible_on_ui = visible_on_ui - self._param_type = param_type.value - self._required_params = required_params - - @property - def name(self): - """Get name of parameter.""" - return self._name - - @property - def type(self): - """Get type of parameter.""" - return self._type - - @property - def support_disable(self): - """Get support_disable of parameter.""" - return self._support_disable - - @property - def default_value(self): - """Get default_value of parameter.""" - return self._default_value - - @property - def visible_on_ui(self): - """Get visible_on_ui of parameter.""" - return self._visible_on_ui - - @property - def param_type(self): - """Get param_type of parameter.""" - return self._param_type - - @property - def required_params(self): - """Get required_param of parameter.""" - return self._required_params - - def is_valid(self, value): - """Check is the parameter valid.""" - if self._valid_test_func is None: - return True - return self._valid_test_func(value) - - -class Condition: - """ - The class for parameters of conditions. - - Args: - condition_id (ConditionIdEnum): condition id. - abbr (str): the abbreviation of condition id. - optimize_phase (OptimizePhaseEnum): optimize phase. - parameters (List[ConditionParameter]): parameters. - supported_target_type (TargetTypeEnum): the supported target type. - supported_platforms (tuple[PlatformEnum, PlatformEnum]): the supported platforms. - minimum_debugger_capability (tuple): the minimum debugger capability required. - availability_test_func (func): the function used to test whether the condition is available. - """ - def __init__(self, condition_id, abbr, optimize_phase, parameters, supported_target_type, supported_platforms, - minimum_debugger_capability, availability_test_func=None): - self.id = condition_id.value - self._abbr = abbr - self.optimize_phase = optimize_phase - self._parameters = { - parameter.name: parameter for parameter in parameters - } - self.ordered_parameter_names = [parameter.name for parameter in parameters] - self._supported_target_type = supported_target_type - self.supported_platforms = supported_platforms - self.minimum_debugger_capability = minimum_debugger_capability - self.availability_test_func = availability_test_func - - def get_parameter_definition(self, name): - """Return parameter definition by the name""" - return self._parameters[name] - - def is_available(self, condition_context): - """Check is the condition available.""" - backend = condition_context.backend - debugger_capability = condition_context.debugger_capability - if debugger_capability < self.minimum_debugger_capability: - logger.debug("The debugger capability is lower than the minimum debugger capability.") - return False - if backend not in [platform.value for platform in self.supported_platforms]: - logger.debug("The condition %s is not supported on the platform.", self.id) - return False - if self.availability_test_func is None: - return True - return self.availability_test_func(condition_context) - - @property - def abbr(self): - """The abbreviation of condition""" - return self._abbr - - @property - def names(self): - """The name of condition""" - return self._parameters.keys() - - @property - def parameters(self): - """The parameters of condition""" - return self._parameters.values() - - @property - def supported_target_type(self): - """The supported target type of condition""" - return self._supported_target_type - - -def check_initialization_available(condition_context): - """Check if initialization is available at this step""" - if condition_context.step == 0: - return True - return False - - -def check_percentage_param_range(value): - if 0 <= value <= 100: - return True - return False - - -def check_normal_param_range(value): - if float("-inf") < value < float("inf"): - return True - return False - - -def check_abs_param_range(value): - if 0 <= value < float("inf"): - return True - return False - - -def check_positive_param_range(value): - if 0 < value < float("inf"): - return True - return False diff --git a/mindinsight/debugger/conditionmgr/condition_list.py b/mindinsight/debugger/conditionmgr/condition_list.py deleted file mode 100644 index da60befd..00000000 --- a/mindinsight/debugger/conditionmgr/condition_list.py +++ /dev/null @@ -1,476 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -Condition list. - -This module provide the detail conditions list. -""" -from mindinsight.debugger.conditionmgr.condition import Condition -from mindinsight.debugger.conditionmgr.condition import OptimizePhaseEnum -from mindinsight.debugger.conditionmgr.condition import ConditionParameter -from mindinsight.debugger.conditionmgr.condition import ValueTypeEnum -from mindinsight.debugger.conditionmgr.condition import TargetTypeEnum -from mindinsight.debugger.conditionmgr.condition import PlatformEnum -from mindinsight.debugger.conditionmgr.condition import ParamTypeEnum -from mindinsight.debugger.conditionmgr.condition import ConditionIdEnum -from mindinsight.debugger.conditionmgr.condition import ParamNameEnum -from mindinsight.debugger.conditionmgr.condition import check_initialization_available -from mindinsight.debugger.conditionmgr.condition import check_normal_param_range -from mindinsight.debugger.conditionmgr.condition import check_percentage_param_range -from mindinsight.debugger.conditionmgr.condition import check_abs_param_range, check_positive_param_range - - -CONDITION_LIST = [ - Condition( - condition_id=ConditionIdEnum.WEIGHT_INITIALIZATION, - abbr="WI", - # Send this condition to MindSpore will use WatchCondition.Condition.tensor_initialization - optimize_phase=OptimizePhaseEnum.TENSOR_CHECK, - parameters=[ - ConditionParameter( - name=ParamNameEnum.ZERO_PERCENTAGE_GE, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_percentage_param_range, - default_value=100 - ), - ConditionParameter( - name=ParamNameEnum.MAX_GT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_normal_param_range - ), - ConditionParameter( - name=ParamNameEnum.MIN_LT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_normal_param_range - ) - ], - supported_target_type=TargetTypeEnum.WEIGHT, - supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU), - minimum_debugger_capability=(1, 1), - availability_test_func=check_initialization_available - ), - Condition( - condition_id=ConditionIdEnum.WEIGHT_OVERFLOW, - abbr="WO", - # Send this condition to MindSpore will use WatchCondition.Condition.tensor_general_overflow - optimize_phase=OptimizePhaseEnum.TENSOR_CHECK, - parameters=[], - supported_target_type=TargetTypeEnum.WEIGHT, - supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU), - minimum_debugger_capability=(1, 1) - ), - Condition( - condition_id=ConditionIdEnum.WEIGHT_TOO_LARGE, - abbr="WL", - # Send this condition to MindSpore will use WatchCondition.Condition.tensor_too_large - optimize_phase=OptimizePhaseEnum.TENSOR_CHECK, - parameters=[ - ConditionParameter( - name=ParamNameEnum.ABS_MEAN_GT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_abs_param_range - ), - ConditionParameter( - name=ParamNameEnum.MAX_GT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_normal_param_range - ), - ConditionParameter( - name=ParamNameEnum.MIN_GT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_normal_param_range - ), - ConditionParameter( - name=ParamNameEnum.MEAN_GT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_normal_param_range - ) - ], - supported_target_type=TargetTypeEnum.WEIGHT, - supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU), - minimum_debugger_capability=(1, 1) - ), - Condition( - condition_id=ConditionIdEnum.WEIGHT_TOO_SMALL, - abbr="WS", - # Send this condition to MindSpore will use WatchCondition.Condition.tensor_too_small - optimize_phase=OptimizePhaseEnum.TENSOR_CHECK, - parameters=[ - ConditionParameter( - name=ParamNameEnum.ABS_MEAN_LT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_abs_param_range - ), - ConditionParameter( - name=ParamNameEnum.MAX_LT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_normal_param_range - ), - ConditionParameter( - name=ParamNameEnum.MIN_LT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_normal_param_range - ), - ConditionParameter( - name=ParamNameEnum.MEAN_LT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_normal_param_range - ) - ], - supported_target_type=TargetTypeEnum.WEIGHT, - supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU), - minimum_debugger_capability=(1, 1) - ), - Condition( - condition_id=ConditionIdEnum.GRADIENT_VANISHING, - abbr="GV", - # Send this condition to MindSpore will use WatchCondition.Condition.tensor_too_small - optimize_phase=OptimizePhaseEnum.TENSOR_CHECK, - parameters=[ - ConditionParameter( - name=ParamNameEnum.ABS_MEAN_LT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_abs_param_range - ), - ConditionParameter( - name=ParamNameEnum.MAX_LT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_normal_param_range - ), - ConditionParameter( - name=ParamNameEnum.MIN_LT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_normal_param_range - ), - ConditionParameter( - name=ParamNameEnum.MEAN_LT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_normal_param_range - ) - ], - supported_target_type=TargetTypeEnum.GRADIENT, - supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU), - minimum_debugger_capability=(1, 1) - ), - Condition( - condition_id=ConditionIdEnum.GRADIENT_TOO_LARGE, - abbr="GL", - # Send this condition to MindSpore will use WatchCondition.Condition.tensor_too_large - optimize_phase=OptimizePhaseEnum.TENSOR_CHECK, - parameters=[ - ConditionParameter( - name=ParamNameEnum.ABS_MEAN_GT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_abs_param_range - ), - ConditionParameter( - name=ParamNameEnum.MAX_GT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_normal_param_range - ), - ConditionParameter( - name=ParamNameEnum.MIN_GT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_normal_param_range - ), - ConditionParameter( - name=ParamNameEnum.MEAN_GT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_normal_param_range - ) - ], - supported_target_type=TargetTypeEnum.GRADIENT, - supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU), - minimum_debugger_capability=(1, 1) - ), - Condition( - condition_id=ConditionIdEnum.GRADIENT_EXPLODING, - abbr="GE", - # Send this condition to MindSpore will use WatchCondition.Condition.tensor_general_overflow - optimize_phase=OptimizePhaseEnum.TENSOR_CHECK, - parameters=[], - supported_target_type=TargetTypeEnum.GRADIENT, - supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU), - minimum_debugger_capability=(1, 1) - ), - Condition( - condition_id=ConditionIdEnum.TENSOR_OVERFLOW, - abbr="TO", - # Send this condition to MindSpore will use WatchCondition.Condition.tensor_general_overflow - optimize_phase=OptimizePhaseEnum.TENSOR_CHECK, - parameters=[], - supported_target_type=TargetTypeEnum.TENSOR, - supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU), - minimum_debugger_capability=(1, 1) - ), - Condition( - condition_id=ConditionIdEnum.OPERATOR_OVERFLOW, - abbr="OO", - # Send this condition to MindSpore will use WatchCondition.Condition.overflow - optimize_phase=OptimizePhaseEnum.TENSOR_CHECK, - parameters=[], - supported_target_type=TargetTypeEnum.TENSOR, - supported_platforms=(PlatformEnum.ASCEND,), - minimum_debugger_capability=(1, 1) - ), - Condition( - condition_id=ConditionIdEnum.TENSOR_TOO_LARGE, - abbr="TL", - # Send this condition to MindSpore will use WatchCondition.Condition.tensor_too_large - optimize_phase=OptimizePhaseEnum.TENSOR_CHECK, - parameters=[ - ConditionParameter( - name=ParamNameEnum.ABS_MEAN_GT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_abs_param_range - ), - ConditionParameter( - name=ParamNameEnum.MAX_GT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_normal_param_range - ), - ConditionParameter( - name=ParamNameEnum.MIN_GT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_normal_param_range - ), - ConditionParameter( - name=ParamNameEnum.MEAN_GT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_normal_param_range - ) - ], - supported_target_type=TargetTypeEnum.TENSOR, - supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU), - minimum_debugger_capability=(1, 1) - ), - Condition( - condition_id=ConditionIdEnum.TENSOR_TOO_SMALL, - abbr="TS", - # Send this condition to MindSpore will use WatchCondition.Condition.tensor_too_small - optimize_phase=OptimizePhaseEnum.TENSOR_CHECK, - parameters=[ - ConditionParameter( - name=ParamNameEnum.ABS_MEAN_LT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_abs_param_range - ), - ConditionParameter( - name=ParamNameEnum.MAX_LT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_normal_param_range - ), - ConditionParameter( - name=ParamNameEnum.MIN_LT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_normal_param_range - ), - ConditionParameter( - name=ParamNameEnum.MEAN_LT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_normal_param_range - ) - ], - supported_target_type=TargetTypeEnum.TENSOR, - supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU), - minimum_debugger_capability=(1, 1) - ), - Condition( - condition_id=ConditionIdEnum.TENSOR_ALL_ZERO, - abbr="TZ", - # Send this condition to MindSpore will use WatchCondition.Condition.tensor_all_zero - optimize_phase=OptimizePhaseEnum.TENSOR_CHECK, - parameters=[ - ConditionParameter( - name=ParamNameEnum.ZERO_PERCENTAGE_GE, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_percentage_param_range, - default_value=100 - ) - ], - supported_target_type=TargetTypeEnum.TENSOR, - supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU), - minimum_debugger_capability=(1, 1) - ), - Condition( - condition_id=ConditionIdEnum.WEIGHT_NOT_CHANGED, - abbr="WNC", - # Send this condition to MindSpore will use WatchCondition.Condition.tensor_not_changed - optimize_phase=OptimizePhaseEnum.TENSOR_CHECK, - parameters=[ - ConditionParameter( - name=ParamNameEnum.RTOL, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_abs_param_range, - default_value=1e-5 - ), - ConditionParameter( - name=ParamNameEnum.ATOL, - value_type=ValueTypeEnum.FLOAT64, - support_disable=False, - default_value=1e-8, - visible_on_ui=False - ), - ConditionParameter( - name=ParamNameEnum.EQUAL_NAN, - value_type=ValueTypeEnum.BOOL, - support_disable=False, - default_value=False, - visible_on_ui=False - ) - ], - supported_target_type=TargetTypeEnum.WEIGHT, - supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU), - minimum_debugger_capability=(1, 1) - ), - Condition( - condition_id=ConditionIdEnum.WEIGHT_CHANGE_TOO_LARGE, - abbr="WCL", - # Send this condition to MindSpore will use WatchCondition.Condition.tensor_change_too_large - optimize_phase=OptimizePhaseEnum.TENSOR_CHECK, - parameters=[ - ConditionParameter( - name=ParamNameEnum.ABS_MEAN_UPDATE_RATIO_GT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_abs_param_range, - default_value=1e-1 - ), - ConditionParameter( - name=ParamNameEnum.EPSILON, - value_type=ValueTypeEnum.FLOAT64, - support_disable=False, - default_value=1e-9, - visible_on_ui=False - ) - ], - supported_target_type=TargetTypeEnum.WEIGHT, - supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU), - minimum_debugger_capability=(1, 1) - ), - Condition( - condition_id=ConditionIdEnum.WEIGHT_CHANGE_TOO_SMALL, - abbr="WCS", - # Send this condition to MindSpore will use WatchCondition.Condition.tensor_change_too_small - optimize_phase=OptimizePhaseEnum.TENSOR_CHECK, - parameters=[ - ConditionParameter( - name=ParamNameEnum.ABS_MEAN_UPDATE_RATIO_LT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_abs_param_range, - default_value=1e-4 - ), - ConditionParameter( - name=ParamNameEnum.EPSILON, - value_type=ValueTypeEnum.FLOAT64, - support_disable=False, - default_value=1e-9, - visible_on_ui=False - ) - ], - supported_target_type=TargetTypeEnum.WEIGHT, - supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU), - minimum_debugger_capability=(1, 1) - ), - Condition( - condition_id=ConditionIdEnum.ACTIVATION_RANGE, - abbr="AR", - # Send this condition to MindSpore will use WatchCondition.Condition.activation_range - optimize_phase=OptimizePhaseEnum.TENSOR_CHECK, - parameters=[ - ConditionParameter( - name=ParamNameEnum.RANGE_START_INCLUSIVE, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_normal_param_range, - param_type=ParamTypeEnum.SUPPORT_PARAM - ), - ConditionParameter( - name=ParamNameEnum.RANGE_END_INCLUSIVE, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_normal_param_range, - param_type=ParamTypeEnum.SUPPORT_PARAM - ), - ConditionParameter( - name=ParamNameEnum.RANGE_PERCENTAGE_LT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_percentage_param_range, - required_params=[ParamNameEnum.RANGE_START_INCLUSIVE.value, ParamNameEnum.RANGE_END_INCLUSIVE.value] - ), - ConditionParameter( - name=ParamNameEnum.RANGE_PERCENTAGE_GT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_percentage_param_range, - required_params=[ParamNameEnum.RANGE_START_INCLUSIVE.value, ParamNameEnum.RANGE_END_INCLUSIVE.value] - ), - ConditionParameter( - name=ParamNameEnum.MAX_MIN_LT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_positive_param_range - ), - ConditionParameter( - name=ParamNameEnum.MAX_MIN_GT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_abs_param_range - ) - ], - supported_target_type=TargetTypeEnum.ACTIVATION, - supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU), - minimum_debugger_capability=(1, 1) - ), - Condition( - condition_id=ConditionIdEnum.TENSOR_RANGE, - abbr="TR", - # Send this condition to MindSpore will use WatchCondition.Condition.tensor_range - optimize_phase=OptimizePhaseEnum.TENSOR_CHECK, - parameters=[ - ConditionParameter( - name=ParamNameEnum.RANGE_START_INCLUSIVE, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_normal_param_range, - param_type=ParamTypeEnum.SUPPORT_PARAM - ), - ConditionParameter( - name=ParamNameEnum.RANGE_END_INCLUSIVE, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_normal_param_range, - param_type=ParamTypeEnum.SUPPORT_PARAM - ), - ConditionParameter( - name=ParamNameEnum.RANGE_PERCENTAGE_LT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_percentage_param_range, - required_params=[ParamNameEnum.RANGE_START_INCLUSIVE.value, ParamNameEnum.RANGE_END_INCLUSIVE.value] - ), - ConditionParameter( - name=ParamNameEnum.RANGE_PERCENTAGE_GT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_percentage_param_range, - required_params=[ParamNameEnum.RANGE_START_INCLUSIVE.value, ParamNameEnum.RANGE_END_INCLUSIVE.value] - ), - ConditionParameter( - name=ParamNameEnum.MAX_MIN_LT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_positive_param_range - ), - ConditionParameter( - name=ParamNameEnum.MAX_MIN_GT, - value_type=ValueTypeEnum.FLOAT64, - valid_test_func=check_abs_param_range - ) - ], - supported_target_type=TargetTypeEnum.TENSOR, - supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU), - minimum_debugger_capability=(1, 1) - ) -] diff --git a/mindinsight/debugger/conditionmgr/conditionmgr.py b/mindinsight/debugger/conditionmgr/conditionmgr.py deleted file mode 100644 index 0031fee2..00000000 --- a/mindinsight/debugger/conditionmgr/conditionmgr.py +++ /dev/null @@ -1,110 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -Condition manager.. - -This module provide condition manager function. -""" -from mindinsight.debugger.conditionmgr.condition import Condition -from mindinsight.debugger.conditionmgr.condition import TargetTypeEnum -from mindinsight.debugger.conditionmgr.condition_list import CONDITION_LIST -from mindinsight.debugger.common.log import LOGGER as logger - - -class ConditionMgr: - """Condition manager.""" - - def __init__(self): - self.conditions = {} - self.no_parameter_conditions = [] - self._register_default_conditions() - - def _register_default_conditions(self): - """Register default condition definitions""" - self.register_conditions(CONDITION_LIST) - - def register_condition(self, condition): - """Register conditions into dict""" - if not condition.parameters: - self.no_parameter_conditions.append(condition.id) - self.conditions[condition.id] = condition - - def register_conditions(self, conditions): - """Register conditions""" - for condition in conditions: - self.register_condition(condition) - - def get_condition(self, condition_id) -> Condition: - """Get condition by condition id""" - return self.conditions[condition_id] - - def has_condition(self, condition_id, condition_context) -> bool: - """Return if the condition exist and avilible""" - if condition_id in self.conditions: - condition = self.get_condition(condition_id) - return condition.is_available(condition_context) - logger.warning("Condition id %s not found.", condition_id) - return False - - def get_no_param_condition(self) -> list: - """Return the list of condition without parameters""" - return self.no_parameter_conditions - - @staticmethod - def check_and_sort(collections, target_type, reply): - """Check the collection and sort conditions""" - collection = collections.get(target_type) - if collection: - collection = sorted(collection, key=lambda x: x.get('id')) - reply.append({"id": target_type + "_condition_collection", "conditions": collection}) - else: - logger.warning("Condition collection for %s is None.", target_type) - - def get_all_collections(self, condition_context): - """Get all register conditions.""" - - collections = { - TargetTypeEnum.WEIGHT.value: [], TargetTypeEnum.TENSOR.value: [], TargetTypeEnum.GRADIENT.value: [], - TargetTypeEnum.ACTIVATION.value: [] - } - for condition in self.conditions.values(): - parameters = [] - if not condition.is_available(condition_context): - continue - for param in condition.parameters: - if not param.visible_on_ui: - continue - parameters.append({ - "name": param.name, - "type": param.type.name, - "support_disable": param.support_disable, - "default_value": param.default_value, - "param_type": param.param_type, - "required_params": param.required_params - }) - collections[condition.supported_target_type.value].append({ - "id": condition.id, - "parameters": parameters, - "supported_target_type": condition.supported_target_type.name, - "abbr": condition.abbr - }) - - reply = [] - self.check_and_sort(collections, TargetTypeEnum.TENSOR.value, reply) - self.check_and_sort(collections, TargetTypeEnum.WEIGHT.value, reply) - self.check_and_sort(collections, TargetTypeEnum.ACTIVATION.value, reply) - self.check_and_sort(collections, TargetTypeEnum.GRADIENT.value, reply) - - return reply diff --git a/mindinsight/debugger/conditionmgr/recommender.py b/mindinsight/debugger/conditionmgr/recommender.py deleted file mode 100644 index 51520b51..00000000 --- a/mindinsight/debugger/conditionmgr/recommender.py +++ /dev/null @@ -1,514 +0,0 @@ -# Copyright 2020-2022 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -Predefined watchpoints. - -This module predefine recommend watchpoints. -""" -import math -import queue as Queue - -from mindinsight.debugger.conditionmgr.conditionmgr import ConditionMgr -from mindinsight.debugger.conditionmgr.condition import TargetTypeEnum -from mindinsight.debugger.conditionmgr.condition import ConditionIdEnum -from mindinsight.debugger.conditionmgr.condition import ActivationFuncEnum -from mindinsight.debugger.conditionmgr.common.utils import NodeBasicInfo -from mindinsight.debugger.common.log import LOGGER as logger -from mindinsight.conf import settings -from mindinsight.debugger.stream_cache.node_type_identifier import is_gradient_node -from mindinsight.debugger.stream_cache.watchpoint import WatchNodeTree - - -class _WatchPointData: - """ - WatchPoint data container - - Args: - watch_condition (dict): The dict of watch conditions. - watch_nodes (list[NodeBasicInfo]): The list of node basic info. - name (str): The name of watchpoint. - """ - def __init__(self, watch_condition, watch_nodes, name): - self.watch_condition = watch_condition - self.watch_nodes = watch_nodes - self.name = name - - def get_watch_condition_dict(self): - return { - "id": self.watch_condition.get("condition"), - "params": [{ - "name": param.get_parameter_name(), - "value": param.value - } for param in self.watch_condition.get("params")] - } - - -class _ConditionParameterValue: - """Condition parameter data container""" - def __init__(self, parameter, value): - self.parameter = parameter - self.value = value - - def get_parameter_name(self): - return self.parameter.name - - -def recommend_watchpoints(condition_mgr: ConditionMgr, multi_card_graph_stream, condition_context): - """ - Recommend watchpoints. - - Args: - condition_mgr (ConditionMgr): Condition manager instance. - multi_card_graph_stream (GraphHandler): Multi card graph handler instance. - condition_context (ConditionContext): Context for condition. - - Returns: - list[WatchPointData], watch points to be created. - """ - watch_points = [] - - if not multi_card_graph_stream.has_graph(): - logger.warning("Given graph is None.") - return watch_points - - if not settings.ENABLE_RECOMMENDED_WATCHPOINTS: - return watch_points - - # add weight watch points - merged_info = get_basic_node_info(TargetTypeEnum.WEIGHT.value, multi_card_graph_stream) - _recommend_weight_initialization(merged_info, condition_mgr, watch_points, condition_context) - _recommend_weight_change_too_large(merged_info, condition_mgr, watch_points, condition_context) - - # Because we cannot identify trainable weights currently, weight_no_change and weight_change_too_small will not be - # recommended. - trainable_weight_nodes = [] - _recommend_weight_not_changed(condition_mgr, trainable_weight_nodes, watch_points, condition_context) - _recommend_weight_change_too_small(condition_mgr, trainable_weight_nodes, watch_points, condition_context) - - # add gradient watch points - merged_info = get_basic_node_info(TargetTypeEnum.GRADIENT.value, multi_card_graph_stream) - _recommend_gradient_vanishing(merged_info, condition_mgr, watch_points, condition_context) - - # add tensor watch points - merged_info = get_basic_node_info(TargetTypeEnum.TENSOR.value, multi_card_graph_stream) - _recommend_operator_overflow(merged_info, condition_mgr, watch_points, condition_context) - _recommend_tensor_overflow(merged_info, condition_mgr, watch_points, condition_context) - _recommend_tensor_all_zero(merged_info, condition_mgr, watch_points, condition_context) - - # add activation watch points - merged_info = get_basic_node_info(TargetTypeEnum.ACTIVATION.value, multi_card_graph_stream, - ActivationFuncEnum.TANH.value) - _recommend_activation_range(merged_info, condition_mgr, watch_points, condition_context, - ActivationFuncEnum.TANH.value) - - merged_info = get_basic_node_info(TargetTypeEnum.ACTIVATION.value, multi_card_graph_stream, - ActivationFuncEnum.SIGMOID.value) - _recommend_activation_range(merged_info, condition_mgr, watch_points, condition_context, - ActivationFuncEnum.SIGMOID.value) - - merged_info = get_basic_node_info(TargetTypeEnum.ACTIVATION.value, multi_card_graph_stream, - [ActivationFuncEnum.RELU.value, ActivationFuncEnum.RELUV2.value]) - _recommend_activation_range(merged_info, condition_mgr, watch_points, condition_context, - ActivationFuncEnum.RELU.value) - return watch_points - - -def _recommend_tensor_all_zero(basic_info_nodes, condition_mgr, watch_points, condition_context): - """Recommend tensor all zero watchpoint.""" - if not basic_info_nodes: - return - if not condition_mgr.has_condition(ConditionIdEnum.TENSOR_ALL_ZERO.value, condition_context): - return - condition = condition_mgr.get_condition(condition_id=ConditionIdEnum.TENSOR_ALL_ZERO.value) - tensor_all_zero_watchpoint = _WatchPointData( - watch_condition={ - "condition": condition.id, - "params": [_ConditionParameterValue( - parameter=condition.get_parameter_definition("zero_percentage_ge"), - value=100 # set default value to 100 - )] - }, - watch_nodes=basic_info_nodes.copy(), - name='recommend_tensor_all_zero_watchpoint' - ) - watch_points.append(tensor_all_zero_watchpoint) - - -def _recommend_tensor_overflow(basic_info_nodes, condition_mgr, watch_points, condition_context): - """Recommend tensor general overflow watchpoint.""" - if not basic_info_nodes: - return - if not condition_mgr.has_condition(ConditionIdEnum.TENSOR_OVERFLOW.value, condition_context): - return - - condition = condition_mgr.get_condition(condition_id=ConditionIdEnum.TENSOR_OVERFLOW.value) - overflow_watchpoint = _WatchPointData( - watch_condition={ - "condition": condition.id, - "params": [] - }, - watch_nodes=basic_info_nodes.copy(), - name='recommend_tensor_overflow_watchpoint' - ) - watch_points.append(overflow_watchpoint) - - -def _recommend_operator_overflow(basic_info_nodes, condition_mgr, watch_points, condition_context): - """Recommend tensor overflow watchpoint.""" - if not basic_info_nodes: - return - if not condition_mgr.has_condition(ConditionIdEnum.OPERATOR_OVERFLOW.value, condition_context): - return - - condition = condition_mgr.get_condition(condition_id=ConditionIdEnum.OPERATOR_OVERFLOW.value) - overflow_d_watchpoint = _WatchPointData( - watch_condition={ - "condition": condition.id, - "params": [] - }, - watch_nodes=basic_info_nodes.copy(), - name='recommend_operator_overflow_watchpoint' - ) - watch_points.append(overflow_d_watchpoint) - - -def _recommend_gradient_vanishing(basic_info_nodes, condition_mgr, watch_points, condition_context): - """Recommend gradient vanishing watchpoint.""" - if not basic_info_nodes: - return - if not condition_mgr.has_condition(ConditionIdEnum.GRADIENT_VANISHING.value, condition_context): - return - - condition = condition_mgr.get_condition(condition_id=ConditionIdEnum.GRADIENT_VANISHING.value) - gradient_vanishing_watchpoint = _WatchPointData( - watch_condition={ - "condition": condition.id, - "params": [_ConditionParameterValue( - parameter=condition.get_parameter_definition("abs_mean_lt"), - value=1e-9 # set default value to 1e-9 - )] - }, - watch_nodes=basic_info_nodes.copy(), - name='recommend_gradient_vanishing_watchpoint' - ) - watch_points.append(gradient_vanishing_watchpoint) - - -def _recommend_weight_change_too_small(condition_mgr, trainable_weight_nodes, watch_points, condition_context): - """Recommend weight change too small watchpoint.""" - if not trainable_weight_nodes: - return - if not condition_mgr.has_condition(ConditionIdEnum.WEIGHT_CHANGE_TOO_SMALL.value, condition_context): - return - - condition = condition_mgr.get_condition(condition_id=ConditionIdEnum.WEIGHT_CHANGE_TOO_SMALL.value) - weight_change_too_small_watchpoint = _WatchPointData( - watch_condition={ - "condition": condition.id, - "params": [ - _ConditionParameterValue( - parameter=condition.get_parameter_definition("abs_mean_update_ratio_lt"), - value=1.0e-4 # set default value to 1.0e-4 - ), - ] - }, - watch_nodes=trainable_weight_nodes, - name='recommend_weight_change_too_small_watchpoint' - ) - watch_points.append(weight_change_too_small_watchpoint) - - -def _recommend_weight_not_changed(condition_mgr, trainable_weight_nodes, watch_points, condition_context): - """Recommend weight not changed watchpoint.""" - if not trainable_weight_nodes: - return - if not condition_mgr.has_condition(ConditionIdEnum.WEIGHT_NOT_CHANGED.value, condition_context): - return - - condition = condition_mgr.get_condition(condition_id=ConditionIdEnum.WEIGHT_NOT_CHANGED.value) - weight_no_change_watchpoint = _WatchPointData( - watch_condition={ - "condition": condition.id, - "params": [ - _ConditionParameterValue( - parameter=condition.get_parameter_definition("rtol"), - value=1.0e-5 # set default value to 1.0e-5 - ), - _ConditionParameterValue( - parameter=condition.get_parameter_definition("atol"), - value=1.0e-8 # set default value to 1.0e-8 - ), - ] - }, - watch_nodes=trainable_weight_nodes, - name='recommend_weight_not_changed_watchpoint' - ) - watch_points.append(weight_no_change_watchpoint) - - -def _recommend_weight_change_too_large(basic_info_nodes, condition_mgr, watch_points, condition_context): - """Recommend weight change too large watchpoint.""" - if not basic_info_nodes: - return - if not condition_mgr.has_condition(ConditionIdEnum.WEIGHT_CHANGE_TOO_LARGE.value, condition_context): - return - - condition = condition_mgr.get_condition(condition_id=ConditionIdEnum.WEIGHT_CHANGE_TOO_LARGE.value) - weight_initialization_watchpoint = _WatchPointData( - watch_condition={ - "condition": condition.id, - "params": [_ConditionParameterValue( - parameter=condition.get_parameter_definition("abs_mean_update_ratio_gt"), - value=1 # set default value to 1 - )] - }, - watch_nodes=basic_info_nodes.copy(), - name='recommend_weight_change_too_large_watchpoint' - ) - watch_points.append(weight_initialization_watchpoint) - - -def _recommend_weight_initialization(basic_info_nodes, condition_mgr, watch_points, condition_context): - """Recommend weight initialization watchpoint.""" - if not basic_info_nodes: - return - if not condition_mgr.has_condition(ConditionIdEnum.WEIGHT_INITIALIZATION.value, condition_context): - return - - condition = condition_mgr.get_condition(condition_id=ConditionIdEnum.WEIGHT_INITIALIZATION.value) - weight_initialization_watchpoint = _WatchPointData( - watch_condition={ - "condition": condition.id, - "params": [_ConditionParameterValue( - parameter=condition.get_parameter_definition("zero_percentage_ge"), - value=100 # set default value to 100 - )] - }, - watch_nodes=basic_info_nodes.copy(), - name='recommend_weight_initialization_watchpoint' - ) - watch_points.append(weight_initialization_watchpoint) - - -def _recommend_activation_range(basic_info_nodes, condition_mgr, watch_points, condition_context, activation_func): - """Recommend activation range watchpoint.""" - if not basic_info_nodes: - return - if not condition_mgr.has_condition(ConditionIdEnum.ACTIVATION_RANGE.value, condition_context): - return - condition = condition_mgr.get_condition(condition_id=ConditionIdEnum.ACTIVATION_RANGE.value) - params = _get_recommend_activation_params(condition, activation_func) - activation_range_watchpoint = _WatchPointData( - watch_condition={ - "condition": condition.id, - "params": params - }, - watch_nodes=basic_info_nodes.copy(), - name='recommend_{}_activation_range_watchpoint'.format(activation_func.lower()) - ) - watch_points.append(activation_range_watchpoint) - - -def get_basic_node_info(node_category, multi_card_graph_stream, activation_func=None): - """Get node merged info.""" - if node_category in [TargetTypeEnum.TENSOR.value, TargetTypeEnum.GRADIENT.value]: - return _get_top_nodes(node_category, multi_card_graph_stream) - nodes_for_devices = {} - has_node = False - for rank_id, graph_stream in multi_card_graph_stream.graph_handlers.items(): - basic_info_nodes = _get_basic_node_info_by_node_category(node_category, graph_stream, activation_func) - merged_info = _merge_nodes(basic_info_nodes, graph_stream.whole_graph) - merged_info = _add_graph_name(merged_info, graph_stream) - nodes_for_devices[rank_id] = merged_info - has_node = has_node or merged_info - - if has_node: - return nodes_for_devices - - return {} - - -def _get_top_nodes(node_category, multi_card_graph_stream): - """Get top scope nodes, only for tensor and gradient nodes.""" - nodes_for_devices = {} - for rank_id, graph_stream in multi_card_graph_stream.graph_handlers.items(): - nodes_info = [] - nodes = [] - if node_category == TargetTypeEnum.TENSOR.value: - graph = graph_stream.get() - if graph is not None: - nodes = graph.get('graph', {}).get('nodes', []) - for node in nodes: - node_basic_info = NodeBasicInfo(name=node.get('name', ''), full_name=node.get('full_name', ''), - type=node.get('type', '')) - nodes_info.append(node_basic_info) - else: - pattern = {'name': TargetTypeEnum.GRADIENT.value} - nodes = graph_stream.search_in_graph(pattern) - for node in nodes: - if not is_gradient_node(node): - continue - node_basic_info = NodeBasicInfo(name=node.name, full_name=node.full_name, type=node.type) - nodes_info.append(node_basic_info) - if nodes_for_devices.get(rank_id) is None: - nodes_for_devices[rank_id] = [] - nodes_for_devices[rank_id].extend(_add_graph_name(nodes_info, graph_stream)) - return nodes_for_devices - - -def _get_basic_node_info_by_node_category(node_category, graph_stream, activation_func=None): - """Get node basic info by node category.""" - pattern = {'node_category': node_category} - if activation_func: - pattern['condition'] = {'activation_func': activation_func} - all_graph_nodes = graph_stream.search_in_graph(pattern) - return all_graph_nodes - - -def _convert_tree_to_node_list(node_tree, node_list): - """Convert WatchNodeTree to Node list.""" - if node_tree.watch_status in [WatchNodeTree.NOT_WATCH, WatchNodeTree.INVALID]: - logger.debug("The watch_status of node: %s is not_watch or invalid.", node_tree.node_name) - return - if node_tree.watch_status == WatchNodeTree.TOTAL_WATCH: - node_basic_info = NodeBasicInfo(name=node_tree.node_name, full_name=node_tree.full_name, - type=node_tree.node_type) - node_list.append(node_basic_info) - return - if node_tree.watch_status == WatchNodeTree.PARTIAL_WATCH: - for _, sub_tree in node_tree.get_children(): - _convert_tree_to_node_list(sub_tree, node_list) - - -def _update_watch_status(node_tree, graph): - """Update the watch_status, if all sub_nodes of a WatchNodeTree are total_watch, - then the WatchNodeTree is changed to total_watch status.""" - tmp_node_queue = Queue.Queue() - tmp_node_queue.put(node_tree) - - # watch node list in layer order - watch_tree_list = [] - while not tmp_node_queue.empty(): - cur_tree = tmp_node_queue.get() - watch_tree_list.append(cur_tree) - for _, sub_tree in cur_tree.get_children(): - tmp_node_queue.put(sub_tree) - - # update the watch_status from bottom to top - while watch_tree_list: - cur_tree = watch_tree_list.pop() - node_name = cur_tree.node_name - logger.debug("Update status of node: %s.", node_name) - - # if node_name is "", it is the root node, which is not in normal_node_map - if not node_name: - continue - sub_count = graph.normal_node_map.get(node_name).subnode_count - - # if the children_count of WatchNodeTree is less than the responding subnode_count in the graph, - # its watch_status must be partial_watch - if cur_tree.get_children_count() < sub_count: - continue - is_all_chosen = True - for _, sub_tree in cur_tree.get_children(): - if sub_tree.watch_status != WatchNodeTree.TOTAL_WATCH: - is_all_chosen = False - break - - if is_all_chosen: - cur_tree.watch_status = WatchNodeTree.TOTAL_WATCH - - -def _merge_nodes(leaf_nodes, graph): - """Merge nodes in one graph.""" - watch_node_tree = WatchNodeTree() - for node in leaf_nodes: - watch_node_tree.add_node(node.name, node.type, node.full_name) - _update_watch_status(watch_node_tree, graph) - out_nodes = [] - _convert_tree_to_node_list(watch_node_tree, out_nodes) - logger.debug("out_nodes: %s", out_nodes) - return out_nodes - - -def _add_graph_name(nodes, graph_stream): - """Add graph_name in node.name.""" - if len(graph_stream.graph_names) > 1: - return nodes - graph_name = graph_stream.graph_names[0] - output_nodes = [] - for node in nodes: - node_basic_info = graph_stream.construct_node_basic_info( - full_name=node.full_name, graph_name=graph_name, node_name=node.name, node_type=node.type) - output_nodes.append(node_basic_info) - return output_nodes - - -def _sigmoid(value): - """Calculate the sigmoid of value.""" - return 1.0 / (1.0 + math.exp(-value)) - - -def _get_recommend_activation_params(condition, activation_func): - """Get recommend params for tanh, sigmoid and relu activation function.""" - params = [] - if activation_func == ActivationFuncEnum.TANH.value: - # The recommend params for Tanh: The percentage of value in range (tanh(-8.8), tanh(8.8)) is lower than 0.1% - params = [ - _ConditionParameterValue( - parameter=condition.get_parameter_definition("range_percentage_lt"), - value=0.1 - ), - _ConditionParameterValue( - parameter=condition.get_parameter_definition("range_start_inclusive"), - value=math.tanh(-8.8) - ), - _ConditionParameterValue( - parameter=condition.get_parameter_definition("range_end_inclusive"), - value=math.tanh(8.8) - )] - if activation_func == ActivationFuncEnum.SIGMOID.value: - # The recommend params for Sigmoid: - # The percentage of value in range (sigmoid(-16.2)), sigmoid(16.2)) is lower than 0.1% - params = [ - _ConditionParameterValue( - parameter=condition.get_parameter_definition("range_percentage_lt"), - value=0.1 - ), - _ConditionParameterValue( - parameter=condition.get_parameter_definition("range_start_inclusive"), - value=_sigmoid(-16.2) - ), - _ConditionParameterValue( - parameter=condition.get_parameter_definition("range_end_inclusive"), - value=_sigmoid(16.2) - )] - if activation_func == ActivationFuncEnum.RELU.value: - # The recommend params for ReLU: - # The percentage of value in range (-1, 0) is greater than 99.9% - params = [ - _ConditionParameterValue( - parameter=condition.get_parameter_definition("range_percentage_gt"), - value=99.9 - ), - _ConditionParameterValue( - parameter=condition.get_parameter_definition("range_start_inclusive"), - value=-1 - ), - _ConditionParameterValue( - parameter=condition.get_parameter_definition("range_end_inclusive"), - value=0 - )] - return params diff --git a/mindinsight/debugger/debugger_cache.py b/mindinsight/debugger/debugger_cache.py deleted file mode 100644 index c03922aa..00000000 --- a/mindinsight/debugger/debugger_cache.py +++ /dev/null @@ -1,156 +0,0 @@ -# Copyright 2020-2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Implement the debugger data cache manager.""" -import sys - -from mindinsight.debugger.common.log import LOGGER as log -from mindinsight.debugger.common.utils import Streams -from mindinsight.debugger.stream_handler import EventHandler, MetadataHandler, MultiCardGraphHandler, \ - MultiCardTensorHandler, WatchpointHandler, MultiCardWatchpointHitHandler -from mindinsight.debugger.stream_handler.device_handler import DeviceHandler -from mindinsight.debugger.stream_handler.graph_history_handler import GraphHistoryHandler - -STREAM_HANDLER_MAP = { - Streams.COMMAND.value: EventHandler, - Streams.DATA.value: EventHandler, - Streams.METADATA.value: MetadataHandler, - Streams.GRAPH.value: MultiCardGraphHandler, - Streams.TENSOR.value: MultiCardTensorHandler, - Streams.WATCHPOINT.value: WatchpointHandler, - Streams.WATCHPOINT_HIT.value: MultiCardWatchpointHitHandler, - Streams.DEVICE.value: DeviceHandler, - Streams.GRAPH_HISTORY.value: GraphHistoryHandler -} - - -class DebuggerCache: - """The debugger data cache manager.""" - - def __init__(self): - self._stream_handler = {} - - def initialize(self): - """Initialize the stream handlers.""" - self._stream_handler = {} - for mode, stream_class in STREAM_HANDLER_MAP.items(): - self._stream_handler[mode] = stream_class() - - def clean(self): - """Clean cache for all stream.""" - for _, stream_handler in self._stream_handler.items(): - stream_handler.clean() - - def get_stream_handler(self, mode): - """ - Get the stream handler object. - - Args: - mode (Streams): The type of stream handler. - - Returns: - StreamHandlerBase, the stream handler object. - """ - return self._stream_handler.get(mode.value) - - def _get(self, mode, pos): - """ - Get updated data or command from cache. - - Args: - mode (Streams): The type of info. `Streams.DATA` or `Streams.COMMAND`. - pos (int): The index of info. - - Returns: - object, the pos-th message about `mode` type of info. - """ - stream_handler = self.get_stream_handler(mode) - - return stream_handler.get(pos) - - def _put(self, mode, value): - """ - Set updated data or command from cache. - - Args: - mode (Streams): The type of info. `Streams.DATA` or `Streams.COMMAND`. - value (object): The info to be record in cache. - """ - stream_handler = self.get_stream_handler(mode) - - return stream_handler.put(value) - - def get_command(self, pos): - """ - Get the pos-th command in command stream. - - Args: - pos (int): The index of command. - - Returns: - int, the position of next message. - EventReply, the command object. - """ - content = self._get(Streams.COMMAND, pos) - next_pos = content.get('metadata').get('pos') - reply = content.get('cmd') - return next_pos, reply - - def put_command(self, cmd): - """ - Set command to command stream. - - Args: - cmd (EventReply): The command EventReply. - """ - log.debug("Set command %s", cmd) - return self._put(Streams.COMMAND, {'cmd': cmd}) - - def has_command(self, pos): - """Judge if the number of command is no less than `pos`.""" - event = self.get_stream_handler(Streams.COMMAND).has_pos(pos) - - return event - - def clean_command(self): - """Clean command queue.""" - self.get_stream_handler(Streams.COMMAND).clean() - log.debug("Clean command.") - - def clean_data(self): - """Clean command queue.""" - self.get_stream_handler(Streams.DATA).clean() - log.debug("Clean data queue.") - - def get_data(self, pos): - """ - Get updated data from data stream. - - Args: - pos (int): The index of data. - - Returns: - object, updated data_value. - """ - return self._get(Streams.DATA, pos) - - def put_data(self, value): - """ - Set updated data to data stream. - - Args: - value (dict): The updated data. - """ - log.debug("Set <%d> bytes data", sys.getsizeof(value)) - return self._put(Streams.DATA, value) diff --git a/mindinsight/debugger/debugger_folder_analyzer.py b/mindinsight/debugger/debugger_folder_analyzer.py deleted file mode 100644 index c78c9bec..00000000 --- a/mindinsight/debugger/debugger_folder_analyzer.py +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Debugger train job register.""" -from mindinsight.utils.folder_analyzer import FolderAnalyzer - - -class DebuggerFolderAnalyzer(FolderAnalyzer): - """Debugger train job register.""" - def analyze(self, entry, summary_base_dir, relative_path): - """Check dir by debugger register.""" - update_info = {} - # Delete debugger since mindspore2.4. - return update_info diff --git a/mindinsight/debugger/debugger_services/__init__.py b/mindinsight/debugger/debugger_services/__init__.py deleted file mode 100644 index fecf22f8..00000000 --- a/mindinsight/debugger/debugger_services/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Debugger server module.""" diff --git a/mindinsight/debugger/debugger_services/debugger_grpc_server.py b/mindinsight/debugger/debugger_services/debugger_grpc_server.py deleted file mode 100644 index fa764414..00000000 --- a/mindinsight/debugger/debugger_services/debugger_grpc_server.py +++ /dev/null @@ -1,716 +0,0 @@ -# Copyright 2020-2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Implement the debugger grpc server.""" -import copy -import threading -from functools import wraps -from queue import Queue, Full, Empty - -import mindinsight -from mindinsight.common.util import version_match -from mindinsight.debugger.common.log import LOGGER as log -from mindinsight.debugger.common.utils import MAX_SINGLE_TENSOR_CACHE_BYTES, get_ack_reply, ServerStatus, \ - Streams, RunLevel, load_tensor, convert_tensor_stats, \ - put_tensor_stats_in_cache, put_tensor_base_in_cache, get_tensor_value -from mindinsight.debugger.conditionmgr.condition import TargetTypeEnum, ParamNameEnum -from mindinsight.debugger.debugger_services.debugger_server_base import debugger_server_wrap -from mindinsight.debugger.proto import debug_grpc_pb2_grpc as grpc_server_base -from mindinsight.debugger.proto.debug_grpc_pb2 import ViewCMD -from mindinsight.debugger.stream_operator.watchpoint_operator import WatchpointOperator -from mindinsight.domain.graph.proto.ms_graph_pb2 import GraphProto - - -def debugger_wrap(func): - """Wrapper for catch exception.""" - - @wraps(func) - def record_log(*args, **kwargs): - try: - return func(*args, **kwargs) - except Exception as err: - log.exception(err) - raise err - - return record_log - - -class DebuggerGrpcServer(grpc_server_base.EventListenerServicer): - """The grpc server used to interactive with grpc client.""" - - def __init__(self, cache_store): - """ - Initialize. - - Args: - cache_store (DebuggerCache): Debugger cache store. - """ - cache_store.initialize() - self._cache_store = cache_store - # the next position of command queue to be queried - self._pos = None - # the status of grpc server, the value is in ServerStatus - self._status = None - # the run command cache, used to deal with left continue steps or nodes - self._old_run_cmd = None - # the view command cache, used to update tensor history through data queue - self._received_view_cmd = None - # the flag of receiving watch point hit - self._received_hit = None - self._heartbeat = None - self.init() - - def init(self): - """Init debugger grpc server.""" - self._pos = '0' - self._status = ServerStatus.PENDING - self._old_run_cmd = {} - self._received_view_cmd = {} - self._received_hit = [] - if self._heartbeat is not None: - self._heartbeat.stop() - self._heartbeat = None - self._cache_store.clean() - - @debugger_wrap - def WaitCMD(self, request, context): - """Wait for a command in DebuggerCache.""" - # check if graph have already received. - log.info("Received WaitCMD at %s-th step.", request.cur_step) - if self._status == ServerStatus.PENDING: - log.warning("No graph received before WaitCMD.") - reply = get_ack_reply(1) - return reply - - # send graph if it has not been sent before - self._pre_process(request) - # deal with old command - reply = self._deal_with_old_command() - # wait for next command - if reply is None: - reply = self._wait_for_next_command() - # check the reply - if reply is None: - reply = get_ack_reply(1) - log.warning("Failed to get command event.") - else: - log.debug("Reply to WaitCMD: %s", reply) - return reply - - def _pre_process(self, request): - """Pre-process before dealing with command.""" - - # check if version is mismatch, if mismatch, send mismatch info to UI - if self._status == ServerStatus.MISMATCH: - log.warning("Version of MindSpore and MindInsight are unmatched," - "waiting for user to terminate the script.") - metadata_stream = self._cache_store.get_stream_handler(Streams.METADATA) - # put metadata into data queue - metadata = metadata_stream.get(['state', 'debugger_version']) - self._cache_store.put_data(metadata) - return - - metadata_stream = self._cache_store.get_stream_handler(Streams.METADATA) - is_new_step = metadata_stream.step < request.cur_step - is_new_node = metadata_stream.full_name != request.cur_node - # clean cache data at the beginning of new step or node has been changed. - if is_new_step or is_new_node: - self._cache_store.clean_data() - self._cache_store.get_stream_handler(Streams.TENSOR).get_tensor_handler_by_rank_id(0).clean_tensors( - request.cur_step) - if is_new_step: - self._cache_store.get_stream_handler(Streams.WATCHPOINT_HIT).get_hit_handler_by_rank_id(0).clean() - # receive graph at the beginning of the training - if self._status == ServerStatus.RECEIVE_GRAPH: - self._send_graph_flag(metadata_stream) - # receive new metadata - if is_new_step or is_new_node: - self._update_metadata(metadata_stream, request) - self._send_received_tensor_tag() - self._send_watchpoint_hit_flag() - - def _send_graph_flag(self, metadata_stream): - """ - Send graph and metadata to UI. - - Args: - metadata_stream (MetadataHandler): Metadata handler stream. - """ - self._cache_store.clean_command() - # receive graph in the beginning of the training - self._status = ServerStatus.WAITING - metadata_stream.state = ServerStatus.WAITING.value - metadata = metadata_stream.get() - res = self._cache_store.get_stream_handler(Streams.GRAPH).get_graph_handler_by_rank_id(0).get() - res.update(metadata) - self._cache_store.put_data(res) - log.debug("Put graph into data queue.") - - def _update_metadata(self, metadata_stream, metadata_proto): - """ - Update metadata. - - Args: - metadata_stream (MetadataHandler): Metadata handler stream. - metadata_proto (MetadataProto): Metadata proto send by client. - """ - # put new metadata into cache - metadata_stream.put(metadata_proto) - # update current node name and graph name - graph_stream = self._cache_store.get_stream_handler(Streams.GRAPH).get_graph_handler_by_rank_id(0) - full_name = metadata_proto.cur_node - graph_name = graph_stream.get_graph_id_by_full_name( - full_name) if full_name else metadata_stream.graph_name - cur_node = graph_stream.get_node_name_by_full_name(full_name, graph_name) - metadata_stream.node_name = cur_node - metadata_stream.graph_name = graph_name - metadata = metadata_stream.get() - self._cache_store.put_data(metadata) - log.debug("Put new metadata into data queue.") - - def _send_received_tensor_tag(self): - """Send received_finish_tag.""" - node_info = self._received_view_cmd.get('node_info') - if not node_info or self._received_view_cmd.get('wait_for_tensor'): - return - metadata = self._cache_store.get_stream_handler(Streams.METADATA).get(['step', 'state']) - ret = {'receive_tensor': node_info.copy()} - ret.update(metadata) - self._cache_store.put_data(ret) - self._received_view_cmd.clear() - log.debug("Send receive tensor flag for %s", node_info) - - def _send_watchpoint_hit_flag(self): - """Send Watchpoint hit flag.""" - watchpoint_hit_stream = self._cache_store.get_stream_handler(Streams.WATCHPOINT_HIT).get_hit_handler_by_rank_id( - 0) - if not self._received_hit: - return - watchpoint_hits = self._received_hit - self._received_hit = [] - for watchpoint_hit in watchpoint_hits: - watchpoint_hit_stream.put(watchpoint_hit) - watchpoint_hits_info = {'receive_watchpoint_hits': True} - self._cache_store.put_data(watchpoint_hits_info) - log.debug("Send the watchpoint hits to DataQueue.\nSend the reply.") - - def _deal_with_old_command(self): - """Deal with old command.""" - event = None - while self._cache_store.has_command(self._pos) and event is None: - event = self._get_next_command() - log.debug("Deal with old %s-th command:\n%s.", self._pos, event) - # deal with continue run command - if event is None and self._old_run_cmd: - left_step_count = self._old_run_cmd.get('left_step_count') - node_name = self._old_run_cmd.get('node_name') - # node_name and left_step_count should not set at the same time - if not (left_step_count or node_name) or (left_step_count and node_name): - log.warning("Invalid old run command. %s", self._old_run_cmd) - self._old_run_cmd.clear() - return None - if left_step_count: - event = self._deal_with_left_continue_step(left_step_count) - else: - event = self._deal_with_left_continue_node(node_name) - log.debug("Send old RunCMD.") - return event - - def _deal_with_left_continue_step(self, left_step_count): - """ - Construct run command with left continue step count. - - Args: - left_step_count (int): The count of left steps to be executed. - - Returns: - Event, the run command event. - """ - event = get_ack_reply() - event.run_cmd.run_steps = 1 - event.run_cmd.run_level = 'step' - left_step_count = left_step_count - 1 if left_step_count > 0 else -1 - if not left_step_count: - self._old_run_cmd.clear() - else: - self._old_run_cmd['left_step_count'] = left_step_count - log.debug("Send old step RunCMD. Left step count: %s", left_step_count) - return event - - def _deal_with_left_continue_node(self, node_name): - """ - Construct run command with left continue nodes. - - Args: - node_name (str): The target node name. - - Returns: - Union[None, Event], the run command event. - """ - cur_full_name = self._cache_store.get_stream_handler(Streams.METADATA).full_name - if cur_full_name == node_name: - log.info("Execute to target node: %s", node_name) - self._old_run_cmd.clear() - return None - event = get_ack_reply() - event.run_cmd.run_level = 'node' - event.run_cmd.node_name = '' - log.debug("Send old node RunCMD, cur node: %s, target node: %s", cur_full_name, node_name) - return event - - def _wait_for_next_command(self): - """ - Wait for next command. - - Returns: - EventReply, the command event. - """ - log.info("Start to wait for command.") - if self._status != ServerStatus.MISMATCH: - metadata_stream = self._cache_store.get_stream_handler(Streams.METADATA) - metadata_stream.state = ServerStatus.WAITING.value - self._cache_store.put_data(metadata_stream.get()) - event = None - while event is None and self._status not in [ServerStatus.RUNNING, ServerStatus.PENDING]: - log.debug("Wait for %s-th command", self._pos) - event = self._get_next_command() - return event - - def _get_next_command(self): - """Get next command.""" - self._pos, event = self._cache_store.get_command(self._pos) - if event is None: - return event - # deal with command - metadata_stream = self._cache_store.get_stream_handler(Streams.METADATA) - if isinstance(event, dict): - event = self._deal_with_view_cmd(event) - elif event.HasField('run_cmd'): - event = self._deal_with_run_cmd(event) - self._cache_store.put_data(metadata_stream.get()) - elif event.HasField('exit'): - self._cache_store.clean() - self._cache_store.put_data(metadata_stream.get()) - log.debug("Clean cache for exit cmd.") - else: - event = self._deal_with_set_cmd(event) - log.debug("get set cmd.") - - return event - - def _deal_with_view_cmd(self, event): - """ - Deal with view cmd. - - Args: - event (dict): View command params. - - - view_cmd (EventReply): EventReply with view command. - - node_name (str): The center node name for view command. - - tensor_name (str): The center tensor name for view command. - - graph_name (str): The graph name of center node. - - Returns: - EventReply, view command to be sent to client. - """ - view_cmd = event.pop('view_cmd', None) - log.debug("Receive view cmd for node: %s.", event) - if not (view_cmd and event): - log.debug("Invalid view command. Ignore it.") - return None - self._received_view_cmd['node_info'] = event - self._received_view_cmd['wait_for_tensor'] = True - self._received_view_cmd['view_cmd'] = view_cmd - level_dict = { - 'stats': ViewCMD.Level.statistics, - 'base': ViewCMD.Level.base - } - if event.get('level'): - view_cmd.view_cmd.level = level_dict.get(event.get('level')) - return view_cmd - - def _deal_with_run_cmd(self, event): - """Deal with run cmd.""" - metadata_stream = self._cache_store.get_stream_handler(Streams.METADATA) - run_cmd = event.run_cmd - # receive step command - if run_cmd.run_level == RunLevel.STEP.value: - # receive pause cmd - if not run_cmd.run_steps: - log.debug("Pause training and wait for next command.") - self._old_run_cmd.clear() - # update metadata state from sending to waiting - metadata_stream.state = ServerStatus.WAITING.value - return None - # receive step cmd - left_steps = run_cmd.run_steps - 1 - event.run_cmd.run_steps = 1 - if left_steps: - self._old_run_cmd['left_step_count'] = left_steps if left_steps > 0 else -1 - elif run_cmd.node_name: - self._old_run_cmd['node_name'] = run_cmd.node_name - run_cmd.node_name = '' - # clean watchpoint hit cache - if run_cmd.run_level == RunLevel.RECHECK.value: - self._cache_store.get_stream_handler(Streams.WATCHPOINT_HIT).get_hit_handler_by_rank_id(0).clean() - log.debug("Receive RunCMD. Clean watchpoint hit cache.") - # update metadata state from sending to running - metadata_stream.state = ServerStatus.RUNNING.value - return event - - def _deal_with_set_cmd(self, event): - """ - Deal with set cmd. - - Args: - event (EventReply): EventReply with set command. - - Returns: - EventReply, set command to be sent to client. - """ - set_cmd = event.set_cmd - watchpoint_stream = self._cache_store.get_stream_handler(Streams.WATCHPOINT) - watchpoint_stream.clean_cache_set_cmd(set_cmd) - if set_cmd.delete: - return event - # add watch node and condition info into set_cmd - multi_card_graph_stream = self._cache_store.get_stream_handler(Streams.GRAPH) - WatchpointOperator.add_set_cmd_detail(set_cmd, watchpoint_stream, multi_card_graph_stream) - return event - - @debugger_wrap - def SendMetadata(self, request, context): - """Send metadata into DebuggerCache.""" - log.info("Received Metadata.") - if self._status != ServerStatus.PENDING: - log.info("Re-initialize cache store when new session comes.") - self.init() - - client_ip = context.peer().split(':', 1)[-1] - metadata_stream = self._cache_store.get_stream_handler(Streams.METADATA) - reply = get_ack_reply() - if request.training_done: - log.info("The training from %s has finished.", client_ip) - else: - ms_version = request.ms_version - version_match_stat = version_match(ms_version, mindinsight.__version__) - if version_match_stat > 1: - log.warning("Version is mismatched, MindSpore is: %s, MindInsight is: %s", - ms_version, mindinsight.__version__) - self._status = ServerStatus.MISMATCH - reply.version_matched = False - metadata_stream.state = ServerStatus.MISMATCH.value - elif version_match_stat > 0: - log.warning("Version is not completely matched, MindSpore is: %s, MindInsight is: %s", - ms_version, mindinsight.__version__) - reply.version_matched = True - else: - log.info("version is matched.") - reply.version_matched = True - - metadata_stream.debugger_version = {'ms': ms_version, 'mi': mindinsight.__version__} - log.debug("Put ms_version from %s into cache.", client_ip) - - metadata_stream.put(request) - metadata_stream.client_ip = client_ip - log.debug("Put new metadata from %s into cache.", client_ip) - # put metadata into data queue - metadata = metadata_stream.get() - self._cache_store.put_data(metadata) - log.debug("Send the reply to %s.", client_ip) - return reply - - @debugger_wrap - def SendGraph(self, request_iterator, context): - """Send graph into DebuggerCache.""" - log.info("Received graph.") - if self._old_run_cmd: - log.info("Clear old run command. %s", self._old_run_cmd) - self._old_run_cmd.clear() - reply = get_ack_reply() - if self._status == ServerStatus.MISMATCH: - log.info("MindSpore and MindInsight is unmatched, waiting for user to terminate the service.") - return reply - serial_graph = b"" - for chunk in request_iterator: - serial_graph += chunk.buffer - graph = GraphProto.FromString(serial_graph) - log.debug("Deserialize the graph %s. Receive %s nodes", graph.name, len(graph.node)) - graph_dict = {graph.name: graph} - self._cache_store.get_stream_handler(Streams.GRAPH).put({0: graph_dict}) - self._cache_store.get_stream_handler(Streams.GRAPH).parse_stack_infos() - self._cache_store.get_stream_handler(Streams.TENSOR).get_tensor_handler_by_rank_id(0).put_const_vals( - graph.const_vals) - self._cache_store.get_stream_handler(Streams.METADATA).graph_name = graph.name - self._record_parameter_names() - self._status = ServerStatus.RECEIVE_GRAPH - log.debug("Send the reply for graph.") - return reply - - @debugger_wrap - def SendMultiGraphs(self, request_iterator, context): - """Send graph into DebuggerCache.""" - log.info("Received multi_graphs.") - if self._old_run_cmd: - log.info("Clear old run command. %s", self._old_run_cmd) - self._old_run_cmd.clear() - reply = get_ack_reply() - if self._status == ServerStatus.MISMATCH: - log.info("MindSpore and MindInsight is unmatched, waiting for user to terminate the service.") - return reply - serial_graph = b"" - graph_dict = {} - for chunk in request_iterator: - serial_graph += chunk.buffer - if chunk.finished: - sub_graph = GraphProto.FromString(serial_graph) - graph_dict[sub_graph.name] = sub_graph - log.debug("Deserialize the graph %s. Receive %s nodes", sub_graph.name, - len(sub_graph.node)) - serial_graph = b"" - self._cache_store.get_stream_handler(Streams.TENSOR).get_tensor_handler_by_rank_id(0).put_const_vals( - sub_graph.const_vals) - - self._cache_store.get_stream_handler(Streams.GRAPH).put({0: graph_dict}) - self._cache_store.get_stream_handler(Streams.GRAPH).parse_stack_infos() - self._record_parameter_names() - self._status = ServerStatus.RECEIVE_GRAPH - log.debug("Send the reply for graph.") - return reply - - def _record_parameter_names(self): - """Record parameter full names in tensor handler.""" - parameter_nodes = self._cache_store.get_stream_handler(Streams.GRAPH).get_graph_handler_by_rank_id(0) \ - .search_in_graph(pattern={'node_category': TargetTypeEnum.PARAMETER.value}) - tensor_stream = self._cache_store.get_stream_handler(Streams.TENSOR).get_tensor_handler_by_rank_id(0) - for node in parameter_nodes: - tensor_name = [node.full_name + ':0'] - tensor_stream.record_parameter_names(tensor_name) - - @debugger_wrap - def SendTensors(self, request_iterator, context): - """Send tensors into DebuggerCache.""" - log.info("Received tensor.") - tensor_contents = [] - data_size = 0 - metadata_stream = self._cache_store.get_stream_handler(Streams.METADATA) - tensor_stream = self._cache_store.get_stream_handler(Streams.TENSOR).get_tensor_handler_by_rank_id(0) - step = metadata_stream.step - oversize = False - node_info = self._received_view_cmd.get('node_info') - if node_info and node_info.get('load'): - load_info = node_info.get('load') - load_info['graph_name'] = node_info.get('graph_name') - load_info['node_name'] = node_info.get('node_name') - # The rank_id of online debugger is 0 - load_tensor(load_info=load_info, step=step, request_iterator=request_iterator, - cache_store=self._cache_store, rank_id=0) - else: - for tensor_proto in request_iterator: - tensor_contents.append(tensor_proto.tensor_content) - data_size += len(tensor_proto.tensor_content) - if data_size >= MAX_SINGLE_TENSOR_CACHE_BYTES or oversize: - oversize = True - tensor_contents = [] - if tensor_proto.finished: - value = get_tensor_value(tensor_proto, tensor_contents, node_info, step, oversize, data_size) - update_flag = tensor_stream.put(value) - self._update_state(update_flag) - tensor_contents = [] - data_size = 0 - oversize = False - reply = get_ack_reply() - return reply - - @debugger_wrap - def SendTensorBase(self, request_iterator, context): - """Send tensor base into DebuggerCache.""" - log.info("Received tensor base.") - metadata_stream = self._cache_store.get_stream_handler(Streams.METADATA) - cur_step = metadata_stream.step - tensor_stream = self._cache_store.get_stream_handler(Streams.TENSOR).get_tensor_handler_by_rank_id(0) - tensor_protos = self._received_view_cmd.get('view_cmd').view_cmd.tensors - tensor_stats_list = [] - for tensor_base in request_iterator: - tensor_stats_list.append(_convert_tensor_base(tensor_base)) - update_data_flag = put_tensor_base_in_cache(tensor_stats_list, tensor_protos, cur_step, tensor_stream) - self._update_state(update_data_flag) - reply = get_ack_reply() - return reply - - @debugger_wrap - def SendTensorStats(self, request_iterator, context): - """Send tensor stats into DebuggerCache.""" - log.info("Received tensor statistic.") - metadata_stream = self._cache_store.get_stream_handler(Streams.METADATA) - cur_step = metadata_stream.step - tensor_stream = self._cache_store.get_stream_handler(Streams.TENSOR).get_tensor_handler_by_rank_id(0) - tensor_protos = self._received_view_cmd.get('view_cmd').view_cmd.tensors - tensor_stats_list = [] - for tensor_summary in request_iterator: - tensor_stats_list.append({ - 'tensor_base': _convert_tensor_base(tensor_summary.tensor_base), - 'tensor_stats': convert_tensor_stats(tensor_summary.statistics) - }) - update_data_flag = put_tensor_stats_in_cache(tensor_stats_list, tensor_protos, cur_step, tensor_stream) - self._update_state(update_data_flag) - reply = get_ack_reply() - return reply - - def _update_state(self, update_flag): - """Update wait_for_tensor state.""" - if self._received_view_cmd.get('wait_for_tensor') and update_flag: - # update_flag is used to avoid querying empty tensors again - self._received_view_cmd['wait_for_tensor'] = False - log.debug("Set wait for tensor flag to False.") - - @debugger_wrap - def SendWatchpointHits(self, request_iterator, context): - """Send watchpoint hits info DebuggerCache.""" - log.info("Received WatchpointHits. Left run cmd %s change to empty.", self._old_run_cmd) - self._old_run_cmd.clear() - if self._cache_store.get_stream_handler(Streams.METADATA).state == ServerStatus.RUNNING.value: - # if the client session is running a script, all the cached command should be cleared - # when received watchpoint_hits. - self._cache_store.clean_command() - - # save the watchpoint_hits data - watchpoint_hits = [] - watchpoint_stream = self._cache_store.get_stream_handler(Streams.WATCHPOINT) - graph_stream = self._cache_store.get_stream_handler(Streams.GRAPH).get_graph_handler_by_rank_id(0) - for watchpoint_hit_proto in request_iterator: - node_full_name = watchpoint_hit_proto.tensor.node_name - graph_name = graph_stream.get_graph_id_by_full_name(node_full_name) - if not graph_name: - log.warning("Cannot find node %s in graph. Skip it.", node_full_name) - continue - ui_node_name = graph_stream.get_node_name_by_full_name(node_full_name, graph_name) - log.debug("Receive watch point hit: %s", watchpoint_hit_proto) - if not ui_node_name: - log.info("Not support to show %s on graph.", node_full_name) - continue - watchpoint_hit = { - 'tensor_proto': watchpoint_hit_proto.tensor, - 'watchpoint': copy.deepcopy(watchpoint_stream.get_watchpoint_by_id(watchpoint_hit_proto.id)), - 'node_name': ui_node_name, - 'graph_name': graph_name - } - hit_params = {} - for param in watchpoint_hit_proto.watch_condition.params: - if param.name not in (ParamNameEnum.RTOL.value, ParamNameEnum.RANGE_START_INCLUSIVE.value, - ParamNameEnum.RANGE_END_INCLUSIVE.value) \ - and watchpoint_hit_proto.error_code == 0: - hit_params[param.name] = param.actual_value - watchpoint = watchpoint_hit.get('watchpoint', None) - if not watchpoint: - return get_ack_reply() - params = watchpoint.condition.get('params', []) - for i, param in enumerate(params): - name = param['name'] - if name in hit_params.keys(): - watchpoint_hit['watchpoint'].condition['params'][i]['actual_value'] = hit_params[name] - else: - watchpoint_hit['watchpoint'].condition['params'][i]['actual_value'] = None - watchpoint_hit['error_code'] = watchpoint_hit_proto.error_code - watchpoint_hits.append(watchpoint_hit) - self._received_hit = watchpoint_hits - reply = get_ack_reply() - return reply - - def SendHeartbeat(self, request, context): - """Deal with heartbeat sent from training client.""" - # only support single card training now - if self._heartbeat is None or not self._heartbeat.is_alive(): - period = request.period - min_period_seconds = 5 - max_period_seconds = 3600 - if not min_period_seconds <= period <= max_period_seconds: - log.error("Invalid period time which should be in [5, 3600].") - return get_ack_reply(-1) - self._heartbeat = HeartbeatListener(self._cache_store, request.period) - self._heartbeat.start() - self._heartbeat.send() - return get_ack_reply() - - -class HeartbeatListener(threading.Thread): - """Heartbeat listener.""" - _MAX_TRY_EXCEPT_COUNT = 3 - - def __init__(self, cache_store, period=None): - """ - Initialize Heartbeat listener object. - - Args: - cache_store (DebuggerCacheStore): Cache store for debugger server. - period (int): The max waiting seconds for each period. - """ - super(HeartbeatListener, self).__init__() - self._heartbeat_queue = Queue(maxsize=1) - self._cache_store = cache_store - # the waiting period time for next heartbeat, default waiting for 15 seconds - time_delay = 0.5 - self._period = period + time_delay if period else 15 - self._running = threading.Event() - self._running.clear() - - @debugger_server_wrap - def run(self): - """Function that should be called when thread started.""" - self._running.set() - log.info("Start listening for heartbeat.") - try_count = 0 - while self._running.is_set(): - try: - self._heartbeat_queue.get(timeout=self._period) - # reset try count if received heartbeat - try_count = 0 - except Empty: - try_count += 1 - if try_count >= self._MAX_TRY_EXCEPT_COUNT: - break - log.info("Missing heartbeat. Try again.") - - log.warning("Missing heartbeat. Reset online session.") - self._cache_store.clean() - metadata_stream = self._cache_store.get_stream_handler(Streams.METADATA) - # put metadata into data queue - metadata = metadata_stream.get() - self._cache_store.put_data(metadata) - - def send(self): - """Send heartbeat signal.""" - try: - self._heartbeat_queue.put(True, block=False) - except Full: - log.debug("Too many heartbeat received.") - - @debugger_server_wrap - def stop(self): - """Stop debugger server.""" - self._running.wait() - log.info("Start to stop offline debugger server.") - self._running.clear() - self.send() - self.join() - - -def _convert_tensor_base(tensor_data): - """Convert tensor object to dict.""" - tensor_data_dict = { - 'dtype': tensor_data.data_type, - 'shape': tensor_data.shape, - 'data_size': tensor_data.data_size - } - return tensor_data_dict diff --git a/mindinsight/debugger/debugger_services/debugger_online_server.py b/mindinsight/debugger/debugger_services/debugger_online_server.py deleted file mode 100644 index ab4313d6..00000000 --- a/mindinsight/debugger/debugger_services/debugger_online_server.py +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Debugger Online server.""" -from concurrent import futures - -import grpc -from mindinsight.debugger.common.log import LOGGER as log -from mindinsight.conf import settings -from mindinsight.debugger.debugger_services.debugger_grpc_server import DebuggerGrpcServer -from mindinsight.debugger.debugger_services.debugger_server_base import DebuggerServerBase -from mindinsight.debugger.proto import debug_grpc_pb2_grpc as grpc_server_base - - -def get_debugger_hostname(): - """Get hostname for online debugger server.""" - grpc_port = settings.DEBUGGER_PORT if hasattr(settings, 'DEBUGGER_PORT') else 50051 - host = settings.HOST if hasattr(settings, 'HOST') else '[::]' - hostname = "{}:{}".format(host, grpc_port) - return hostname - - -class DebuggerOnlineServer(DebuggerServerBase): - """Debugger Online Server.""" - - def __init__(self, cache_store, context): - super(DebuggerOnlineServer, self).__init__(cache_store, context) - self._grpc_server_manager = self.get_grpc_server_manager() - - def run(self): - self._grpc_server_manager.start() - log.info("Start grpc server %s", self._context.hostname) - self._grpc_server_manager.wait_for_termination() - - def get_grpc_server_manager(self): - """Get grpc server instance according to hostname.""" - if self._context.hostname is None: - self._context.hostname = get_debugger_hostname() - grpc_server = DebuggerGrpcServer(self._cache_store) - grpc_server_manager = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) - grpc_server_base.add_EventListenerServicer_to_server(grpc_server, grpc_server_manager) - grpc_server_manager.add_insecure_port(self._context.hostname) - return grpc_server_manager - - def stop(self): - self._grpc_server_manager.stop(grace=None) - self.join() diff --git a/mindinsight/debugger/debugger_services/debugger_server_base.py b/mindinsight/debugger/debugger_services/debugger_server_base.py deleted file mode 100644 index cfe17c7b..00000000 --- a/mindinsight/debugger/debugger_services/debugger_server_base.py +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""DebuggerServerBase.""" -import threading -from abc import abstractmethod -from functools import wraps - -from mindinsight.debugger.common.exceptions.exceptions import DebuggerServerRunningError -from mindinsight.debugger.common.log import LOGGER as log - - -def debugger_server_wrap(func): - """Wrapper for catch exception.""" - @wraps(func) - def record_log(*args, **kwargs): - try: - return func(*args, **kwargs) - except Exception as err: - log.exception(err) - raise DebuggerServerRunningError(str(err)) - return record_log - - -class DebuggerServerBase(threading.Thread): - """ - Debugger Server Base. - - Args: - cache_store (DebuggerCacheStore): Cache store for debugger server. - context (DebuggerServerContext): Context for initialize debugger server. - """ - - def __init__(self, cache_store, context): - super(DebuggerServerBase, self).__init__() - self._cache_store = cache_store - self._context = context - - @abstractmethod - @debugger_server_wrap - def run(self): - """Function that should be called when thread started.""" - - @abstractmethod - @debugger_server_wrap - def stop(self): - """Stop debugger server.""" diff --git a/mindinsight/debugger/debugger_services/debugger_server_factory.py b/mindinsight/debugger/debugger_services/debugger_server_factory.py deleted file mode 100644 index ce805523..00000000 --- a/mindinsight/debugger/debugger_services/debugger_server_factory.py +++ /dev/null @@ -1,92 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Debugger server factory.""" -import threading - -from mindinsight.debugger.common.utils import DebuggerServerMode -from mindinsight.debugger.debugger_services.debugger_offline_server import DebuggerOfflineServer -from mindinsight.debugger.debugger_services.debugger_online_server import DebuggerOnlineServer - - -class DebuggerServerFactory: - """Create debugger server according to debugger mode.""" - - _lock = threading.Lock() - _instance = None - - def __init__(self): - self._server_map = { - DebuggerServerMode.ONLINE.value: DebuggerOnlineServer, - DebuggerServerMode.OFFLINE.value: DebuggerOfflineServer - } - - def __new__(cls, *args, **kwargs): - if cls._instance is None: - with cls._lock: - if cls._instance is None: - cls._instance = super().__new__(cls, *args, **kwargs) - return cls._instance - - def get_debugger_server(self, cache_store, context): - """ - Get debugger server according to debugger_context and cache_store. - - Args: - cache_store (DebuggerCacheStore): Cache store for debugger server. - context (DebuggerServerContext): Context for initialize debugger server. - - Returns: - DebuggerServerBase, Debugger server object. - """ - dbg_server = None - dbg_server_class = self._server_map.get(context.dbg_mode) - if dbg_server_class: - dbg_server = dbg_server_class(cache_store, context) - return dbg_server - - -class DebuggerServerContext: - """ - Debugger server context. - - Args: - dbg_mode (str): The debugger mode. Optional: `online` or `offline`. - train_job (str): The relative directory of debugger dump data for one training. - Used only when dbg_mode is `offline.` - dbg_dir (str): The base directory of debugger dump data for one training. - Used only when dbg_mode is `offline.` - hostname (str): The hostname used for online debugger server. - Used only when dbg_mode is `online.` - """ - def __init__(self, dbg_mode, train_job=None, dbg_dir=None, hostname=None): - self._dbg_mode = dbg_mode - self._train_job = train_job - self._dbg_dir = dbg_dir - self.hostname = hostname - - @property - def dbg_mode(self): - """Property of debugger mode.""" - return self._dbg_mode - - @property - def dbg_dir(self): - """Property of debugger mode.""" - return self._dbg_dir - - @property - def train_job(self): - """The property of train job.""" - return self._train_job diff --git a/mindinsight/debugger/debugger_session.py b/mindinsight/debugger/debugger_session.py deleted file mode 100644 index ad52af8f..00000000 --- a/mindinsight/debugger/debugger_session.py +++ /dev/null @@ -1,854 +0,0 @@ -# Copyright 2020-2022 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Implement the debugger server.""" -from functools import wraps - -from mindinsight.domain.graph.base import NodeTypeEnum -from mindinsight.datavisual.utils.tools import to_float -from mindinsight.debugger.common.exceptions.exceptions import DebuggerParamValueError, \ - DebuggerParamTypeError, DebuggerCompareTensorError, DebuggerTensorGraphError, \ - DebuggerTensorHitError, DebuggerSetRecommendWatchpointsError, MindInsightException -from mindinsight.debugger.common.log import LOGGER as log -from mindinsight.debugger.common.utils import ServerStatus, \ - create_view_event_from_tensor_basic_info, Streams, ViewCommandLevelEnum -from mindinsight.debugger.conditionmgr.condition import ConditionContext -from mindinsight.debugger.conditionmgr.conditionmgr import ConditionMgr -from mindinsight.debugger.conditionmgr.recommender import recommend_watchpoints -from mindinsight.debugger.debugger_cache import DebuggerCache -from mindinsight.debugger.debugger_services.debugger_server_factory import DebuggerServerFactory -from mindinsight.debugger.stream_operator.graph_runs_operator import GraphRunsOperator -from mindinsight.debugger.stream_operator.tensor_detail_info import TensorDetailInfo -from mindinsight.debugger.stream_operator.training_control_operator import TrainingControlOperator -from mindinsight.debugger.stream_operator.watchpoint_operator import WatchpointOperator -from mindinsight.utils.tensor import TensorUtils, MAX_DIMENSIONS_FOR_TENSOR -from mindinsight.conf import settings - - -def try_except(func): - """Send latest metadata when catch exception.""" - - @wraps(func) - def send_latest_metadata(self, *args, **kwargs): - try: - return func(self, *args, **kwargs) - except MindInsightException as err: - metadata = self.cache_store.get_stream_handler(Streams.METADATA).get() - self.cache_store.put_data(metadata) - log.info("Put latest metadata into data-queue.") - raise err - - return send_latest_metadata - - -class DebuggerSession: - """The server manager of debugger.""" - - def __init__(self, context): - self.condition_mgr = ConditionMgr() - self.cache_store = DebuggerCache() - self.context = context - self.back_server = DebuggerServerFactory().get_debugger_server(self.cache_store, context) - self.watch_point_nodes_cache = {} - - @property - def train_job(self): - """The property of train job.""" - return self.context.train_job - - def get_condition_collections(self, train_id=""): - """Get default condition_collections""" - metadata_stream = self.cache_store.get_stream_handler(Streams.METADATA) - condition_context = ConditionContext(metadata_stream.backend, metadata_stream.step) - log.debug("Train_id: %s, backend: %s", train_id, condition_context.backend) - return self.condition_mgr.get_all_collections(condition_context) - - def set_recommended_watch_points(self, set_recommended, train_id=""): - """Set recommended watch points.""" - if not isinstance(set_recommended, bool): - log.error("Bool param should be given for set_recommended") - raise DebuggerParamValueError("Bool param should be given.") - - metadata_stream = self.cache_store.get_stream_handler(Streams.METADATA) - if metadata_stream.recommendation_confirmed: - log.error("User has confirmed setting recommended watchpoints") - raise DebuggerSetRecommendWatchpointsError() - - metadata_stream.recommendation_confirmed = True - condition_context = ConditionContext(metadata_stream.backend, metadata_stream.step) - log.debug("Train_id: %s, backend: %s", train_id, condition_context.backend) - res = metadata_stream.get(['state', 'enable_recheck']) - if set_recommended: - res['id'] = self._add_recommended_watchpoints(condition_context) - - return res - - def _add_recommended_watchpoints(self, condition_context): - """Add predefined watchpoints.""" - log.debug("Add predefined watchpoints.") - multi_card_graph_stream = self.cache_store.get_stream_handler(Streams.GRAPH) - watchpoints = recommend_watchpoints(self.condition_mgr, multi_card_graph_stream, condition_context) - watch_point_stream_handler = self.cache_store.get_stream_handler(Streams.WATCHPOINT) - device_stream = self.cache_store.get_stream_handler(Streams.DEVICE) - watch_points_ids = [] - for watchpoint in watchpoints: - watch_points_id = watch_point_stream_handler.create_watchpoint( - watch_condition=watchpoint.get_watch_condition_dict(), - watch_nodes=watchpoint.watch_nodes, - name=watchpoint.name, - condition_mgr=self.condition_mgr, - device_amount=device_stream.device_amount - ) - watch_points_ids.append(watch_points_id) - return watch_points_ids - - def start(self): - """Start server.""" - self.back_server.start() - log.info("Start debugger backend server.") - - def _stop_handler(self, signum, frame): - """Register stop server handler.""" - self.stop() - log.debug("Deal with stop signal: %s, %s", signum, frame) - - def stop(self): - """Stop debugger server.""" - log.info("Send terminate info to client.") - self.control({'mode': 'terminate'}) - self.back_server.stop() - log.info("Stop debugger server.") - - def poll_data(self, pos): - """ - Get the pos-th data from DebuggerCache. - - Args: - pos (int): The index of data. - - Returns: - dict, the data to be updated. - """ - if not isinstance(pos, str): - log.error("Pos should be string. Received: %s", pos) - raise DebuggerParamValueError("Pos should be string.") - - reply = self.cache_store.get_data(pos) - - return reply - - def search(self, filter_condition): - """ - Search for single node in graph. - - Args: - filter_condition (dict): Filter condition. - - - name (str): The name pattern. - - graph_name (str): The graph name. - - watch_point_id (int): The id of watchpoint. Default: 0. - - node_category (str): The node_category. Default: None - - rank_id (int): The id of rank. Default: 0. - - stack_pattern (str): The pattern of stack info. Default: None. - - Returns: - dict, the searched nodes. - """ - log.info("receive search request with filter_condition: %s", filter_condition) - # validate watchpoint id - watch_point_id = filter_condition.pop('watch_point_id', 0) - rank_id = filter_condition.pop('rank_id', 0) - watchpoint_stream = self.cache_store.get_stream_handler(Streams.WATCHPOINT) - watchpoint_stream.validate_watchpoint_id(watch_point_id) - # validate and update graph name - graph_stream = self.cache_store.get_stream_handler(Streams.GRAPH).get_graph_handler_by_rank_id(rank_id) - graph_name = graph_stream.validate_graph_name(filter_condition.get('graph_name')) - filter_condition['graph_name'] = graph_name - # get searched graph - graph = graph_stream.search_nodes(filter_condition) - # add watched label to graph - watchpoint_stream.set_watch_nodes(graph, graph_stream, watch_point_id, graph_name, rank_id) - return graph - - def tensor_comparisons(self, name, shape, detail='data', tolerance='0', rank_id=0, graph_name=None): - """ - Get tensor comparisons data for given name, detail, shape and tolerance. - - Args: - name (str): The name of tensor for ui. - shape (str): Specify concrete dimensions of shape. - detail (str): Specify which data to query. Current available value is 'data' which means - concrete tensor data. Histogram or unique count can be supported in the future. - rank_id (int): The id of rank. Default: 0. - tolerance (str): Specify tolerance of difference between current step tensor and previous - step tensor. Default value is 0. - graph_name (str): The graph name. Default: None. - - Returns: - dict, the retrieved data. - """ - if self.cache_store.get_stream_handler( - Streams.METADATA).state != ServerStatus.WAITING.value: - log.error("Failed to compare tensors as the MindSpore is not in waiting state.") - raise DebuggerCompareTensorError( - "Failed to compare tensors as the MindSpore is not in waiting state." - ) - self.validate_tensor_param(name, detail) - # Limit to query max two dimensions for tensor in table view. - parsed_shape = TensorUtils.parse_shape(shape, limit=MAX_DIMENSIONS_FOR_TENSOR) - node_type, tensor_name, graph_name = self._get_tensor_name_and_type_by_ui_name(name, graph_name, rank_id) - tolerance = to_float(tolerance, 'tolerance') - tensor_stream = self.cache_store.get_stream_handler(Streams.TENSOR).get_tensor_handler_by_rank_id(rank_id) - cur_step = self.cache_store.get_stream_handler(Streams.METADATA).step - if node_type == NodeTypeEnum.PARAMETER.value: - reply = tensor_stream.get_tensors_diff(tensor_name, parsed_shape, tolerance, cur_step) - else: - raise DebuggerParamValueError( - "The node type must be parameter, but got {}.".format(node_type)) - if reply.pop('view_cmd', False): - self._send_view_cmd(name, graph_name, rank_id, tensor_name, node_type) - return reply - - def retrieve(self, mode, filter_condition=None): - """ - Retrieve data according to mode and params. - - Args: - mode (str): The type of info message. - filter_condition (dict): The filter condition. - - Returns: - dict, the retrieved data. - """ - log.info("receive retrieve request for mode:%s\n, filter_condition: %s", mode, - filter_condition) - mode_mapping = { - 'all': self._retrieve_all, - 'node': self._retrieve_node, - 'watchpoint': self._retrieve_watchpoint, - } - # validate param - if mode not in mode_mapping.keys(): - log.error("Invalid param . should be in ['all', 'node', 'watchpoint', " - "'watchpoint_hit'], but got %s.", mode_mapping) - raise DebuggerParamValueError("Invalid mode.") - # validate backend status - metadata_stream = self.cache_store.get_stream_handler(Streams.METADATA) - if metadata_stream.state == ServerStatus.PENDING.value: - log.info("The backend is in pending status.") - return metadata_stream.get() - - filter_condition = {} if filter_condition is None else filter_condition - reply = mode_mapping[mode](filter_condition) - - return reply - - def _retrieve_all(self, filter_condition=None): - """Retrieve metadata, root graph and watchpoint list.""" - if filter_condition: - log.error("No filter condition required for retrieve all request.") - raise DebuggerParamTypeError("filter_condition should be empty.") - self.cache_store.clean_data() - log.info("Clean data queue cache when retrieve all request.") - result = {} - for stream in [Streams.METADATA, Streams.GRAPH, Streams.DEVICE]: - sub_res = self.cache_store.get_stream_handler(stream).get() - result.update(sub_res) - - devices = result['devices'] - if not devices: - graph = result.get('graph') - metadata = result['metadata'] - device = {'rank_id': 0, 'server_ip': metadata.get('ip', 'localhost'), - 'device_id': metadata.get('device_name', ''), - 'graph_names': graph.get('graph_names', [])} - devices.append(device) - if result.get('metadata')["state"] == ServerStatus.NODE_TOO_LARGE.value: - result.get('metadata')["max_graph_node_size"] = settings.MAX_GRAPH_NODE_SIZE - sub_res = self._hide_parameters_for_ui() - result.update(sub_res) - - return result - - def _retrieve_node(self, filter_condition): - """ - Retrieve node info. - - Args: - filter_condition (dict): Filter condition. - - - name (str): The name of single node. - - graph_name (str): The relative graph_name of the node. - - single_node (bool): If False, return the sub-layer of single node. If True, return - the node list from root node to single node. - - watch_point_id (int): The id of watchpoint. - - Returns: - dict, reply with graph. - """ - log.debug("Retrieve node %s.", filter_condition) - # validate node name - node_name = filter_condition.get('name') - rank_id = filter_condition.get('rank_id', 0) - graph_stream = self.cache_store.get_stream_handler(Streams.GRAPH).get_graph_handler_by_rank_id(rank_id) - graph_name = graph_stream.validate_graph_name(filter_condition.get('graph_name')) - if node_name: - # validate node name - graph_stream.get_node_type(node_name, graph_name) - filter_condition['single_node'] = bool(filter_condition.get('single_node')) - filter_condition['graph_name'] = graph_name - reply = self._get_nodes_info(filter_condition) - return reply - - def _get_nodes_info(self, filter_condition): - """ - Get nodes info. - - Args: - filter_condition (dict): The filter condition. - - - name (str): The node name. - - graph_name (str): The relative graph_name of the node. - - single_node (bool): If False, return the sub-layer of single node. If True, return - the node list from root node to single node. - - watch_point_id (int): The id of watchpoint. - - Returns: - dict, reply with graph. - """ - # validate watch_point_id - rank_id = filter_condition.get('rank_id', 0) - watch_point_id = filter_condition.get('watch_point_id', 0) - watchpoint_stream = self.cache_store.get_stream_handler(Streams.WATCHPOINT) - watchpoint_stream.validate_watchpoint_id(watch_point_id) - # get graph - graph_stream = self.cache_store.get_stream_handler(Streams.GRAPH).get_graph_handler_by_rank_id(rank_id) - reply = graph_stream.get(filter_condition) - if watch_point_id <= 0: - return reply - graph = reply.get('graph') - # add watched label to graph - watchpoint_stream.set_watch_nodes(graph, graph_stream, watch_point_id, filter_condition.get('graph_name'), - rank_id) - - self.watch_point_nodes_cache[watch_point_id] = self.watch_point_nodes_cache.get(watch_point_id, {}) - for node in graph.get('nodes', []): - name = node.get('name') - disable = node.get('disable', True) - if name not in self.watch_point_nodes_cache.get(watch_point_id).keys(): - self.watch_point_nodes_cache.get(watch_point_id)[name] = disable - else: - node['disable'] = self.watch_point_nodes_cache.get(watch_point_id).get(name) - reply['graph'] = graph - log.info("self.watch_point_node_list: %s", self.watch_point_nodes_cache) - return reply - - def retrieve_tensor_history(self, node_name, graph_name=None, rank_id=0): - """ - Retrieve tensor history for leaf node. - - Args: - node_name (str): The name of leaf node. - graph_name (str): The graph name. Default: None. - rank_id (int): The id of rank. Default: 0. - - Returns: - dict, the tensor history and metadata. - """ - log.info("Retrieve tensor history for node: %s.", node_name) - metadata_stream = self.cache_store.get_stream_handler(Streams.METADATA) - if metadata_stream.state == ServerStatus.PENDING.value: - log.info("The backend is in pending status.") - return metadata_stream.get(['state', 'step']) - res = self._get_tensor_history(node_name, graph_name, rank_id) - return res - - def _get_tensor_history(self, node_name, graph_name=None, rank_id=0): - """ - Get tensor history for single node. - - Args: - node_name (str): The name of leaf node. - graph_name (str): The graph name. Default: None. - rank_id (int): The id of rank. Default: 0. - - Returns: - dict, the tensor history and metadata. - """ - # get basic tensor history - graph_stream = self.cache_store.get_stream_handler(Streams.GRAPH).get_graph_handler_by_rank_id(rank_id) - tensor_history = graph_stream.get_tensor_history(node_name, graph_name) - # add tensor value for tensor history - self._add_tensor_value_for_tensor_history(tensor_history, node_name, graph_name, rank_id) - # add hit label for tensor history - self.cache_store.get_stream_handler(Streams.WATCHPOINT_HIT).update_tensor_history(tensor_history, rank_id) - # add metadata - metadata = self.cache_store.get_stream_handler(Streams.METADATA).get(['step']) - tensor_history.update(metadata) - return tensor_history - - def _add_tensor_value_for_tensor_history(self, tensor_history, node_name, graph_name, rank_id): - """ - Add tensor value for_tensor_history and send ViewCMD if tensor value missed. - - Args: - tensor_history (list[dict]): A list of tensor info, including name and type. - node_name (str): The UI node name. - graph_name (str): The graph name. Default: None. - rank_id (int): The id of rank. Default: 0. - - Returns: - dict, the tensor info. - """ - tensor_stream = self.cache_store.get_stream_handler(Streams.TENSOR).get_tensor_handler_by_rank_id(rank_id) - cur_step = self.cache_store.get_stream_handler(Streams.METADATA).step - missed_tensors = tensor_stream.update_tensor_history(tensor_history, cur_step) - if missed_tensors: - view_cmd = create_view_event_from_tensor_basic_info(missed_tensors) - self.cache_store.put_command( - {'view_cmd': view_cmd, 'node_name': node_name, 'graph_name': graph_name, 'rank_id': rank_id, - 'stats': True, "level": ViewCommandLevelEnum.BASE.value}) - log.debug("Send view cmd.") - - def retrieve_tensor_value(self, name, detail, shape, graph_name=None, prev=False, rank_id=0): - """Retrieve the tensor value.""" - log.info("Retrieve tensor value: name: %s, detail: %s, shape: %s", name, detail, shape) - self.validate_tensor_param(name, detail) - # Limit to query max two dimensions for tensor in table view. - parsed_shape = TensorUtils.parse_shape(shape, limit=MAX_DIMENSIONS_FOR_TENSOR) - node_type, tensor_name, graph_name = self._get_tensor_name_and_type_by_ui_name(name, graph_name, rank_id) - reply = self.cache_store.get_stream_handler(Streams.TENSOR).get( - {'name': tensor_name, - 'node_type': node_type, - 'shape': parsed_shape, - 'prev': prev}, - rank_id - ) - reply['tensor_value']['name'] = name - if reply.pop('view_cmd', False): - self._send_view_cmd(name, graph_name, rank_id, tensor_name, node_type) - return reply - - def _send_view_cmd(self, name, graph_name, rank_id, tensor_name, node_type): - """Send view command.""" - tensor_basic_info = self.cache_store.get_stream_handler(Streams.TENSOR).get_tensor_handler_by_rank_id( - rank_id).get_missing_tensor_info(tensor_name, node_type) - if tensor_basic_info: - view_cmd = create_view_event_from_tensor_basic_info(tensor_basic_info) - self.cache_store.put_command( - {'view_cmd': view_cmd, 'tensor_name': name, 'graph_name': graph_name, 'rank_id': rank_id}) - log.debug("Send view cmd.") - - def load(self, name, prev, graph_name=None, rank_id=0): - """ - Load the tensor value. - - Args: - name (str): Node name shown in UI. - prev (bool): The previous step or current step. - graph_name (Union[str, None]): The graph name, default is: None. - rank_id (int): The id of rank. Default: 0. - """ - if not isinstance(name, str) or ':' not in name: - log.error("Invalid tensor name. Received: %s", name) - raise DebuggerParamValueError("Invalid tensor name.") - node_type, tensor_name, graph_name = self._get_tensor_name_and_type_by_ui_name(name, graph_name, rank_id) - log.info("Load the tensor value: name: %s", tensor_name) - reply = self.cache_store.get_stream_handler(Streams.TENSOR).get_tensor_handler_by_rank_id( - rank_id).load(tensor_name=tensor_name, graph_name=graph_name, prev=prev, node_type=node_type) - if not reply.get('in_memory'): - prev_step = 'prev' if prev else '' - tensor_basic_info = self.cache_store.get_stream_handler(Streams.TENSOR).\ - tensor_basic_info(tensor_name, node_type, prev_step) - view_cmd = create_view_event_from_tensor_basic_info([tensor_basic_info]) - self.cache_store.put_command( - {'view_cmd': view_cmd, - 'node_name': name, - 'graph_name': graph_name, - 'rank_id': rank_id, - 'load': { - 'tensor_name': tensor_name, - 'prev': prev, - 'node_type': node_type - }}) - log.debug("Send view cmd.") - else: - metadata = self.cache_store.get_stream_handler(Streams.METADATA).get(['step', 'state']) - ret = { - 'tensor_file': True, - 'node_name': name - } - ret.update(metadata) - self.cache_store.put_data(ret) - reply = {'node_name': name} - return reply - - def download(self, name, prev, graph_name=None, rank_id=0): - """ - Download the tensor value. - - Args: - name (str): Node name shown in UI. - prev (bool): The previous step or current step. - graph_name (Union[str, None]): The graph name, default is: None. - rank_id (int): The id of rank. Default: 0. - - Returns: - str, the file path. - str, the file name. - """ - if not isinstance(name, str) or ':' not in name: - log.error("Invalid tensor name. Received: %s", name) - raise DebuggerParamValueError("Invalid tensor name.") - _, tensor_name, graph_name = self._get_tensor_name_and_type_by_ui_name(name, graph_name, rank_id) - log.info("Download the tensor value: name: %s", tensor_name) - tensor_stream = self.cache_store.get_stream_handler(Streams.TENSOR).get_tensor_handler_by_rank_id(rank_id) - step = tensor_stream.cur_step - if prev: - step -= 1 - tensor_info = { - "tensor_name": tensor_name, - "graph_name": graph_name, - "step": step, - "rank_id": rank_id - } - return tensor_stream.download_mgr.get(**tensor_info) - - def _get_tensor_name_and_type_by_ui_name(self, name, graph_name=None, rank_id=0): - """ - Get inner tensor name and type by UI name. - - Args: - name (str): Node name shown in UI. - graph_name (Union[str, None]): The graph name, default is: None. - rank_id (int): The id of rank. Default: 0. - - Returns: - str, full name of tensor. - str, node type of tensor. - """ - node_name, slot = name.rsplit(':', 1) - graph_stream = self.cache_store.get_stream_handler(Streams.GRAPH).get_graph_handler_by_rank_id(rank_id) - graph_name = graph_name if graph_name else graph_stream.get_graph_id_by_name(node_name) - graph_name = graph_stream.validate_graph_name(graph_name) - node_type = graph_stream.get_node_type(node_name, graph_name) - full_name = graph_stream.get_full_name(node_name, graph_name) - tensor_name = full_name + ':' + slot - return node_type, tensor_name, graph_name - - @staticmethod - def validate_tensor_param(name, detail): - """Validate params for retrieve tensor request.""" - # validate name - if not isinstance(name, str) or ':' not in name: - log.error("Invalid tensor name. Received: %s", name) - raise DebuggerParamValueError("Invalid tensor name.") - # validate data - if detail != 'data': - log.error("Invalid detail value. Received: %s", detail) - raise DebuggerParamValueError("Invalid detail value.") - - def _retrieve_watchpoint(self, filter_condition): - """ - Retrieve watchpoint. - - Args: - filter_condition (dict): Filter condition. - - - watch_point_id (int): The id of watchpoint. If not given, return all watchpoints. - - name (str): The name of single node. - - single_node (bool): If False, return the sub-layer of single node. If True, return - the node list from root node to single node. - - Returns: - dict, watch point list or relative graph. - """ - watchpoint_id = filter_condition.get('watch_point_id', 0) - if not watchpoint_id: - reply = self._hide_parameters_for_ui() - log.debug("Get condition of watchpoints.") - else: - reply = self._retrieve_node(filter_condition) - log.debug("Get graph of %d-th watchpoint.", watchpoint_id) - - return reply - - def search_watchpoint_hits(self, group_condition): - """ - Retrieve watchpoint hit. - - Args: - group_condition (dict): Filter condition. - - - limit (int): The limit of each page. - - offset (int): The offset of current page. - - focused_node (dict): The focused node. - If the specified node is hit, return the page where the node is located. - - - node_name (str): The retrieved node name. - - graph_name (str): The retrieved graph name. - - rank_id (int): The rank id. - - graph_id (int): The graph id. - - watchpoint_id (int): The watchpoint id. - - Returns: - dict, watch point list or relative graph. - """ - if not isinstance(group_condition, dict): - log.error("Group condition for watchpoint-hits request should be a dict") - raise DebuggerParamTypeError("Group condition for watchpoint-hits request should be a dict") - - metadata_stream = self.cache_store.get_stream_handler(Streams.METADATA) - if metadata_stream.state == ServerStatus.PENDING.value: - log.info("The backend is in pending status.") - return metadata_stream.get() - - rank_id = group_condition.pop('rank_id', 0) - if not isinstance(rank_id, int): - log.error("Parameter should be an integer, but got %s.", rank_id) - raise DebuggerParamTypeError("Parameter should be an integer, but got {}.".format(rank_id)) - multicard_graph_stream = self.cache_store.get_stream_handler(Streams.GRAPH) - if not multicard_graph_stream.validate_rank_id(rank_id): - log.error("Parameter %s is not valid.", rank_id) - raise DebuggerParamValueError("Parameter {} is not valid.".format(rank_id)) - reply = {} - multi_watchpoint_hit_stream = self.cache_store.get_stream_handler(Streams.WATCHPOINT_HIT) - if multi_watchpoint_hit_stream.check_rank_id(rank_id): - watchpoint_hit_stream = multi_watchpoint_hit_stream.get_hit_handler_by_rank_id(rank_id) - reply = watchpoint_hit_stream.group_by(group_condition) - - reply['outdated'] = self.cache_store.get_stream_handler(Streams.WATCHPOINT).is_recheckable() - return reply - - def create_watchpoint(self, params): - """ - Create watchpoint. - - Args: - params (dict): Params for create watchpoint. - - - watch_condition (dict): The watch condition. The format is like: - - .. code-block:: - - { - "id": "tensor_too_large", - "params": [ - { - "name": "abs_mean_gt", - "value": 1.1 - } - "id": "tensor_too_large", - "params": [ - { - "name": "abs_mean_gt", - "value": 1.1 - } - ] - { - "id": "tensor_too_large", - "params": [ - { - "name": "abs_mean_gt", - "value": 1.1 - } - ] - } - - - id (str): Id of condition. - - params (list[dict]): The list of param for this condition. - - watch_nodes (list[str]): The list of node names. - - watch_point_id (int): The id of watchpoint. - - search_pattern (dict): The search pattern. - - graph_name (str): The relative graph_name of the watched node. - - Returns: - dict, the id of new watchpoint and metadata info. - """ - watchpoint_opt = WatchpointOperator(self.cache_store, self.condition_mgr) - return watchpoint_opt.create_watchpoint(params) - - def update_watchpoint(self, params): - """ - Update watchpoint. - - Args: - params (dict): Params for update watchpoint. - - - watch_point_id (int): The id of watchpoint. - - watch_nodes (list[str]): The list of node names. - - mode (int): The update operator on nodes. 0 for remove nodes from watch nodes. - 1 for add nodes to watch nodes. - - search_pattern (dict): The search pattern. - - graph_name (str): The relative graph_name of the watched node. - - Returns: - dict, the metadata info. - """ - watchpoint_opt = WatchpointOperator(self.cache_store, self.condition_mgr) - return watchpoint_opt.update_watchpoint(params) - - def delete_watchpoint(self, watch_point_id=None): - """ - Delete watchpoint. - - Args: - watch_point_id (Union[None, int]): The id of watchpoint. - If None, delete all watchpoints. Default: None. - - Returns: - dict, the metadata info. - """ - watchpoint_opt = WatchpointOperator(self.cache_store, self.condition_mgr) - return watchpoint_opt.delete_watchpoint(watch_point_id=watch_point_id) - - @try_except - def control(self, params=None): - """ - Control the training process. - - Args: - params (dict): The control params. - - - mode (str): Acceptable control command, including `continue`, - `pause` and `terminate`. - - level (str): The control granularity, `node` level or `step` level. - Default: `step`. - - steps (int): Specify the steps that training should run. - Used when `level` is `step`. - - name (str): Specify the name of the node. Used when `level` is `node`. - - graph_name (str): The graph name. - - Returns: - dict, the response. - """ - log.info("Receive control request: %s.", params) - mode = params.pop('mode', None) if params else None - training_controller = TrainingControlOperator(self.cache_store) - training_controller.validate_mode(mode) - return training_controller.control(mode, params) - - @try_except - def recheck(self): - """ - Recheck all watchpoints. - - Returns: - dict, metadata info. - """ - return TrainingControlOperator(self.cache_store).recheck() - - def retrieve_tensor_graph(self, tensor_name, graph_name, rank_id=0): - """ - Retrieve tensor graph. - - Args: - tensor_name (str): The tensor name from UI. - graph_name (str): The graph name. - rank_id (int): The id of rank. Default: 0. - - Returns: - dict, tensor graph object. - """ - if self.cache_store.get_stream_handler(Streams.METADATA).state != ServerStatus.WAITING.value: - log.error("Failed to get tensor graph the MindSpore is not in waiting state.") - raise DebuggerTensorGraphError - log.info("Retrieve tensor graph for %s from %s", tensor_name, graph_name) - tensor_graph_ops = TensorDetailInfo(self.cache_store).get_tensor_graph(tensor_name, graph_name, rank_id) - return tensor_graph_ops - - def retrieve_tensor_hits(self, tensor_name, graph_name, rank_id=0): - """ - Retrieve tensor hit information. - - Args: - tensor_name (str): The tensor name from UI. - graph_name (str): The graph name. - rank_id (int): The id of rank. Default: 0. - - Returns: - dict, tensor hit info. - """ - if self.cache_store.get_stream_handler(Streams.METADATA).state != ServerStatus.WAITING.value: - log.error("Failed to get tensor hits as the MindSpore is not in waiting state.") - raise DebuggerTensorHitError - log.info("Retrieve tensor hits for %s from %s", tensor_name, graph_name) - watch_points = TensorDetailInfo(self.cache_store).get_tensor_watch_points(tensor_name, graph_name, rank_id) - return {'watch_points': watch_points} - - def _hide_parameters_for_ui(self): - """ - Hide some parameters on ui. - - Returns: - dict, watch point list. - """ - reply = self.cache_store.get_stream_handler(Streams.WATCHPOINT).get() - watch_points = reply.get('watch_points') - for i, watch_point in enumerate(watch_points): - watch_condition = watch_point.get('watch_condition') - parameters = watch_condition.get('params') - watch_condition_id = watch_condition.get('id') - mgr_condition = self.condition_mgr.get_condition(watch_condition_id) - ui_watch_condition = [] - for param in parameters: - parameter_definition = mgr_condition.get_parameter_definition(param['name']) - if not parameter_definition.visible_on_ui: - continue - ui_watch_condition.append(param) - reply['watch_points'][i]['watch_condition']['params'] = ui_watch_condition - return reply - - def get_stack_infos(self, filter_condition): - """ - Get stack infos. - - Args: - filter_condition (dict): The filter condition to query stack infos. - - - pattern (str): The pattern of stack infos. - - limit (int): The size of each page. - - offset (int): The index of the page. Valid only when `limit` is not 0. - - Returns: - dict, the stack info object. - """ - source_handler = self.cache_store.get_stream_handler(Streams.GRAPH).source_handler - res = source_handler.get_stack_info_by_offset( - pattern=filter_condition.get('pattern'), - limit=filter_condition.get('limit', 0), - offset=filter_condition.get('offset', 0)) - return res - - def get_graph_runs(self, rank_id): - """ - Get graph runs info of specified rank. - - Args: - rank_id (int): The rank id. - - Returns: - dict, the graph runs. The format is like {'graph_runs': List[GraphRun]} - The GraphRun object = { - "count": int, - "graph_name": str, - "has_data": bool, - "sub_graph_names": List[str] - } - """ - state = self.cache_store.get_stream_handler(Streams.METADATA).state - if not ServerStatus.is_normal_state(state): - log.error("Failed to get graph runs as the MindSpore is not in %s state.", state) - return {} - return GraphRunsOperator(self.cache_store).get_graph_runs(rank_id) diff --git a/mindinsight/debugger/dump/__init__.py b/mindinsight/debugger/dump/__init__.py deleted file mode 100644 index 504bed3b..00000000 --- a/mindinsight/debugger/dump/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -Dump Module Introduction. - -This module provides Python APIs to parse dump data directory. -""" diff --git a/mindinsight/debugger/dump/convert.py b/mindinsight/debugger/dump/convert.py deleted file mode 100644 index 2b50a0ca..00000000 --- a/mindinsight/debugger/dump/convert.py +++ /dev/null @@ -1,551 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Parse tensor files from async dump structure.""" -import csv -import os -import stat -import sys -from collections import namedtuple -from importlib import import_module -from pathlib import Path - -import numpy as np - -from mindinsight.debugger.common.exceptions.exceptions import DebuggerParamValueError - -PARSE_ARGS_FIELDS = ['dump_path', 'format', 'output_path', 'output_file_type', - 'input', 'output', 'shape', - 'custom_script_path', 'dump_version'] -CannTool = namedtuple("CannTool", ['utils', 'common', 'log', 'format_conversion', - 'compare_error', 'compare_exception']) - - -class ArgsParser(namedtuple("ArgsParser", PARSE_ARGS_FIELDS)): - """Args Parser object.""" - - __slots__ = () - - def __new__(cls, **kwargs): - new_kwargs = {field: kwargs.get(field) for field in PARSE_ARGS_FIELDS} - new_kwargs['dump_version'] = kwargs.get('dump_version', '2.0') - return super().__new__(cls, **new_kwargs) - - -def load_cann_tools(msaccucmp_path=None): - """ - Load CANN tools. - - Args: - msaccucmp_path (Path): The path object of msaccucmp.py path. - - Returns: - tuple, the tuple of utils, common, shape_conversion module in toolkit package. - """ - msaccucmp_path = get_msaccucmp_path(msaccucmp_path) - cann_tool_path = msaccucmp_path.parent - if str(cann_tool_path) not in sys.path: - sys.path.insert(0, str(cann_tool_path)) - try: - cann_utils = import_module('utils') - cann_common = import_module('common') - cann_format_conversion = import_module('shape_conversion').FormatConversionMain - cann_log = import_module('log') - except ModuleNotFoundError: - raise ModuleNotFoundError(f'Failed to load CANN tools under {cann_tool_path}') - if not hasattr(cann_log, 'print_error_log'): - cann_log = cann_utils - try: - compare_error = import_module('compare_error') - cann_compare_error = compare_error.CompareError.MSACCUCMP_NONE_ERROR - cann_compare_exception = compare_error.CompareError - except ModuleNotFoundError: - cann_compare_error = cann_utils.VECTOR_COMPARISON_NONE_ERROR - cann_compare_exception = cann_utils.CompareError - return CannTool(cann_utils, cann_common, cann_log, cann_format_conversion, - cann_compare_error, cann_compare_exception) - - -def get_msaccucmp_path(msaccucmp_path=None): - """ - Get the Path of CANN msaccucmp file. - - Args: - msaccucmp_path (str): The path of `msaccucmp.py` or `msaccucmp.pyc`. Default: None. - - Returns: - Path, the msaccucmp.py file path object. - """ - if msaccucmp_path is not None: - msaccucmp_path = Path(msaccucmp_path).resolve() - if not msaccucmp_path.exists(): - raise FileNotFoundError(f"File {msaccucmp_path} doesn't exists. Please check the input value.") - return msaccucmp_path - # search msaccucmp file under $ASCEND_AICPU_PATH - ascend_toolkit_path = os.environ.get('ASCEND_TOOLKIT_PATH', '/usr/local/Ascend/') - ascend_toolkit_path = Path(ascend_toolkit_path).resolve() - msaccucmp_files = list(ascend_toolkit_path.rglob('msaccucmp.py*')) - if not msaccucmp_files: - # the tools might be soft-link path - ascend_tool_path = (ascend_toolkit_path / "tools").resolve() - msaccucmp_files = list(ascend_tool_path.rglob('msaccucmp.py*')) - if not msaccucmp_files: - raise FileNotFoundError(f"Failed to find msaccucmp.py or msaccucmp.pyc file under {ascend_toolkit_path}. " - f"Please make sure you have installed toolkit package and set " - f"`ASCEND_TOOLKIT_PATH` in the environment correctly.") - return msaccucmp_files[0] - - -class DumpRootDirConverter: - """Convert the async dump data under dump root directory into host format.""" - - def __init__(self, data_loader, msaccucmp_path=None): - self.data_loader = data_loader - self.dump_data_dir = Path(data_loader.get_dump_dir()) - self.failed_summary_file = self.dump_data_dir.joinpath('convert_failed_files_summary.txt') - self._cann_tools = load_cann_tools(msaccucmp_path) - self.check_async_dir() - - def check_async_dir(self): - """Check if this directory is dumped asynchronously on Ascend.""" - is_sync = self.data_loader.get_sync_flag() - if is_sync: - raise ValueError(f"The data under {str(self.dump_data_dir)} is not dumped asynchronously.") - - def convert(self): - """Convert dump data under root dump data directory from device format to host format.""" - source_iterations = self.data_loader.get_step_iter() - failed_lines = [] - if self.failed_summary_file.is_file(): - self.failed_summary_file.unlink() - for iter_path in source_iterations: - dump_path = str(iter_path) - res = DirConvert(dump_path=dump_path, output_path=dump_path, cann_tools=self._cann_tools).convert() - failed_lines.extend(res) - # add tensor format in file name - - if failed_lines: - self.save_failed_fines(failed_lines) - return failed_lines - - def save_failed_fines(self, failed_lines): - """Save failed fines to file.""" - with self.failed_summary_file.open('w') as handler: - for line in failed_lines: - handler.write(line + '\n') - self.failed_summary_file.chmod(stat.S_IRUSR) - self._cann_tools.log.print_info_log(f"Failed summary has saved to {str(self.failed_summary_file)}") - - -class DirConvert: - """Convert the async dump data under one directory into host format.""" - MAPPING_FILE_NAME = 'mapping.csv' - OP_DEBUG_TYPE = 'Opdebug' - - def __init__(self, dump_path, output_path, target_format='NCHW', output_file_type='npy', cann_tools=None): - self.args_parser = ArgsParser(dump_path=dump_path, - format=target_format, - output_path=output_path, - output_file_type=output_file_type) - self.output_path = Path(output_path).absolute() - self.failed_file_path = self.output_path.joinpath('convert_failed_file_list.txt') - self.cann_tools = load_cann_tools() if cann_tools is None else cann_tools - self.node_map = self._load_mapping_info() - - def _is_npy_target(self): - """Check if the output_file type is npy.""" - return self.args_parser.output_file_type == 'npy' - - def clean_old_files(self): - """Clean old files.""" - # clean failed file record - if self.failed_file_path.is_file(): - self.failed_file_path.unlink() - # clean old converted data. - old_data_files = self.output_path.glob(f'*.{self.args_parser.output_file_type}') - for file in old_data_files: - file.unlink() - - def convert(self): - """Convert async dump data of src_dir to target_format and saved in output_dir.""" - conversion = self.cann_tools.format_conversion(self.args_parser) - self.clean_old_files() - failed_lines = [] - ret = conversion.convert_format() - self.rename_generated_npy_file() - if ret != self.cann_tools.compare_error: - self.cann_tools.log.print_info_log( - f"Begin to convert failed operator in {str(self.failed_file_path)} one by one.") - failed_lines = self.convert_failed_tensors() - else: - self.cann_tools.log.print_info_log( - f"All tensor under {self.args_parser.dump_path} have been converted to {self.output_path} " - f"successfully.") - return failed_lines - - def rename_generated_npy_file(self): - """Rename the npy file generated by CANN tool to MS file name format.""" - # before change - # file is {op_type}.{op_name_with_scope}.{task_id}.{stream_id}.{timestamp}.{tensor_type}.{slot}.{shape}.npy - # or - # {uuid}.{tensor_type}.{slot}.{shape}.npy - # after change - # file is {op_type}.{op_name}.{task_id}.{stream_id}.{timestamp}.{tensor_type}.{slot}.{format}.npy - if not self._is_npy_target(): - return - self.cann_tools.log.print_info_log( - f"Start to rename npy files under {self.output_path}") - target_format = self.args_parser.format - old_data_files = self.output_path.glob('*.npy') - for file in old_data_files: - name_splits = file.name.split('.') - node_type = name_splits[0] - if node_type == DirConvert.OP_DEBUG_TYPE: - continue - if node_type.isdigit() and self.node_map.get(node_type) is not None: - real_name_splits = self.node_map[node_type].split('.') - real_name_splits[1] = real_name_splits[1].split('_')[-1] - real_name_splits.extend(name_splits[1:]) - name_splits = real_name_splits - else: - name_splits[1] = name_splits[1].split('_')[-1] - name_splits[-2] = target_format - new_file_name = '.'.join(name_splits) - file.chmod(stat.S_IRUSR) - file.rename(file.with_name(new_file_name)) - - def _load_mapping_info(self): - """Load node name mapping information.""" - mapping_path = self.output_path / DirConvert.MAPPING_FILE_NAME - node_map = {} - if mapping_path.is_file(): - with mapping_path.open('r') as handler: - csv_reader = csv.reader(handler, delimiter=',') - for row in csv_reader: - node_map[row[0]] = row[1] - return node_map - - def convert_failed_tensors(self): - """Convert failed tensors from failed txt.""" - failed_lines = [] - if not self.failed_file_path.is_file(): - return failed_lines - os.chmod(self.failed_file_path, stat.S_IRUSR) - with self.failed_file_path.open() as handler: - failed_line = handler.readline().strip('\n') - while failed_line: - try: - self.convert_operator_by_failed_line(failed_line) - except (ValueError, OSError, AttributeError) as err: - self.cann_tools.log.print_error_log(f'Failed to convert {failed_line} to Host ' - f'format. \n {str(err)}') - failed_lines.append(failed_line) - except self.cann_tools.compare_exception as err: - self.cann_tools.log.print_error_log(f'Failed to convert {failed_line} to Host ' - f'format. \n {str(err)}') - failed_lines.append(failed_line) - failed_line = handler.readline().strip('\n') - if failed_lines: - self.cann_tools.log.print_error_log(f"Failed to convert: {failed_lines}") - self.cann_tools.log.print_info_log("Finish convert failed operators to host format.") - return failed_lines - - def convert_operator_by_failed_line(self, failed_line): - """Convert operator by failed line.""" - fields = failed_line.split(',') - if len(fields) > 1: - op_file = fields[0] - if os.path.basename(op_file).startswith(DirConvert.OP_DEBUG_TYPE): - return - op_data = self.cann_tools.utils.parse_dump_file(op_file, self.args_parser.dump_version) - missing_tensors = fields[1:] - for missing_tensor in missing_tensors: - tensor_type, idx = missing_tensor.split(':') - idx = int(idx) - tensor = getattr(op_data, tensor_type)[idx] - dump_data_array = self.get_tensor_numpy_value(tensor) - self.save_tensor_file(op_file, tensor_type, idx, tensor, dump_data_array) - - def get_tensor_numpy_value(self, tensor): - """Convert tensor from device format to host format.""" - dump_data_array = self.cann_tools.utils.deserialize_dump_data_to_array(tensor) - array = dump_data_array.reshape(tensor.shape.dim) - return array - - def save_tensor_file(self, op_file, tensor_type, idx, tensor, dump_data_array): - """ - Save tensor file. - - Args: - op_file (str): Source operator file path. - tensor_type (str): The tensor type of the operator, `input` or `output`. - idx (int): Tensor slot index. - tensor (TensorProto): Tensor data in proto format. - dump_data_array (numpy.array): Tensor data in numpy format. - """ - op_name = os.path.basename(op_file) - # shorten the op_name to meet the linux file name len limit. - op_name = self._remove_scope_in_op_name(op_name) - if self._is_npy_target(): - self._save_tensor_in_npy(op_name, tensor_type, idx, tensor, dump_data_array) - else: - self._save_tensor_in_bin(op_name, tensor_type, idx, tensor, dump_data_array) - - def _remove_scope_in_op_name(self, op_name): - """Remove scope in operation name.""" - name_splits = op_name.split('.') - node_type = name_splits[0] - if node_type.isdigit() and self.node_map.get(node_type) is not None: - name_splits = self.node_map[node_type].split('.') - name_splits[1] = name_splits[1].split('_')[-1] - return '.'.join(name_splits) - - def _save_tensor_in_npy(self, op_name, tensor_type, idx, tensor, dump_data_array): - """ - Save tensor file in `npy` format. - - Args: - op_name (str): Operator name without scope. - tensor_type (str): The tensor type of the operator, `input` or `output`. - idx (int): Tensor slot index. - tensor (TensorProto): Tensor data in proto format. - dump_data_array (numpy.array): Tensor data in numpy format. - """ - out_file_name = "%s.%s.%d.%s.npy" % ( - op_name, - tensor_type, - idx, - self.cann_tools.common.get_format_string(tensor.format) - ) - out_path = os.path.join(self.args_parser.output_path, out_file_name) - np.save(out_path, dump_data_array) - os.chmod(out_path, stat.S_IRUSR) - - def _save_tensor_in_bin(self, op_name, tensor_type, idx, tensor, dump_data_array): - """ - Save tensor file in `bin` format. - - Args: - op_name (str): Operator name without scope. - tensor_type (str): The tensor type of the operator, `input` or `output`. - idx (int): Tensor slot index. - tensor (TensorProto): Tensor data in proto format. - dump_data_array (numpy.array): Tensor data in numpy format. - - Returns: - str, output tensor file name. - """ - out_file_name = "%s.%s.%d.%s.%s.bin" % ( - op_name, - tensor_type, - idx, - self.cann_tools.utils.get_string_from_list(dump_data_array.shape, 'x'), - self.cann_tools.common.get_format_string(tensor.format), - ) - out_path = os.path.join(self.args_parser.output_path, out_file_name) - dump_data_array.tofile(out_path) - os.chmod(out_path, stat.S_IRUSR) - - -class FileMapping: - """Mapping op pattern to files.""" - - def __init__(self, data_loader): - self.data_loader = data_loader - self.output_path = Path(data_loader.get_dump_dir()).absolute() - - def find_tensor_file(self, pattern, rank_ids=None, iterations=None): - """ - Find tensor files. - - Args: - pattern (str): File name pattern. - rank_ids (Union[None, list[int]]): Filter condition of rank id. Default: None. - iterations (Union[None, list[int]]): Filter condition of iteration id. Default: None. - - Returns: - OpPathManager, operator path object. - """ - op_path = OpPathManager(pattern) - if rank_ids is None: - rank_dirs = self.data_loader.rank_dirs - else: - rank_dirs = [] - for rank_id in rank_ids: - if not isinstance(rank_id, int): - raise DebuggerParamValueError("rank_ids should be list of int.") - rank_dirs.append(self.data_loader.get_rank_dir(rank_id)) - - for rank_dir in rank_dirs: - op_device_obj = self.find_tensor_file_per_device(pattern, rank_dir.rank_id, iterations) - op_path.add(op_device_obj) - return op_path - - def find_tensor_file_per_device(self, pattern, rank_id, iterations): - """ - Find tensor files per device directory. - - Args: - pattern (str): File name pattern. - rank_id (int): The rank id. - iterations (Union[None, list[int]]): Filter condition of iteration id. Default: None. - - Returns: - OpDevicePath, operator file path object of one device. - """ - op_device_obj = OpDevicePath(rank_id) - - def _find_by_iter_dirs(dirs): - for iter_dir in dirs: - op_path_per_iter = self.find_tensor_file_per_iter(pattern, iter_dir) - op_device_obj.add(op_path_per_iter) - if iterations is None: - iter_dirs = self.data_loader.get_step_iter(rank_id=rank_id) - _find_by_iter_dirs(iter_dirs) - else: - for iteration in iterations: - iter_dirs = self.data_loader.get_step_iter(rank_id=rank_id, step=iteration) - _find_by_iter_dirs(iter_dirs) - return op_device_obj - - @staticmethod - def find_tensor_file_per_iter(pattern, iter_dir): - """ - Find tensor files per iteration directory. - - Args: - pattern (str): File name pattern. - iter_dir (Union[Path, str]): Iteration path. - - Returns: - OpPath, the operator file path object of one iteration. - """ - dir_path = Path(iter_dir) - - def _get_file_generator(tensor_type): - return dir_path.glob(f'*{pattern}.*{tensor_type}.[0-9]*.npy') - - in_gen = _get_file_generator('input') - out_gen = _get_file_generator('output') - iteration = int(dir_path.name) - op_path_obj = OpPath(iteration, in_gen, out_gen) - return op_path_obj - - -class OpPathManager: - """The manager of tensor files of one operator.""" - - def __init__(self, pattern, op_full_name=None): - self.pattern = pattern - self.op_full_name = op_full_name - self._op_path = {} - - @property - def devices(self): - """Get list of iterations in cache.""" - return list(self._op_path.keys()) - - def add(self, op_device_path): - """Add OpDevicePath object.""" - self._op_path[op_device_path.rank_id] = op_device_path - - def rank(self, rank_id): - """Get OpDevicePath object according to rank id.""" - return self._op_path.get(rank_id) - - def to_dict(self): - """Get operator files of all devices in dict format.""" - res = {} - for rank_id, op_path in self._op_path.items(): - key = f'rank_{rank_id}' - res[key] = op_path.to_dict() - return res - - -class OpDevicePath: - """The operator file object of specific device.""" - - def __init__(self, rank_id): - self._rank_id = rank_id - # record the operation path object of different iteration - # the format is like - self._op_path = {} - - @property - def rank_id(self): - """The property of rank id.""" - return self._rank_id - - @property - def iterations(self): - """Get list of iterations in cache.""" - return list(self._op_path.keys()) - - def iteration(self, iteration): - """Get the op path object according to iteration.""" - return self._op_path.get(iteration) - - def add(self, op_path): - """Add OpPath object.""" - self._op_path[op_path.iteration] = op_path - - def to_dict(self): - """Get operator files of one device in dict format.""" - res = {} - for iteration, op_path in self._op_path.items(): - res[iteration] = op_path.to_dict() - return res - - -class OpPath: - """The operator file object of specific iteration.""" - - def __init__(self, iteration, input_gen, output_gen): - self._iter = iteration - self._input_files = None - self._input_gen = input_gen - self._output_files = None - self._output_gen = output_gen - - @staticmethod - def _convert_path_gen_to_list(path_gen): - """Convert generator of Path.glob to list of string.""" - return [str(path) for path in path_gen] - - @property - def inputs(self): - """The list of input tensor files.""" - if self._input_files is None: - self._input_files = self._convert_path_gen_to_list(self._input_gen) - return self._input_files - - @property - def outputs(self): - """The list of output tensor file paths.""" - if self._output_files is None: - self._output_files = self._convert_path_gen_to_list(self._output_gen) - return self._output_files - - @property - def iteration(self): - """The iteration of the tensor file.""" - return self._iter - - def to_dict(self): - """Get operator files of one iteration in dict format.""" - res = { - 'input': self.inputs, - 'output': self.outputs - } - return res diff --git a/mindinsight/debugger/dump/parser.py b/mindinsight/debugger/dump/parser.py deleted file mode 100644 index aa16196c..00000000 --- a/mindinsight/debugger/dump/parser.py +++ /dev/null @@ -1,157 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Graph API module.""" - -import os -import stat -import datetime - -from mindinsight.debugger.dump.convert import FileMapping -from mindinsight.domain.graph.pb_parser import PBParser -from mindinsight.domain.graph.query import StackQuery -from mindinsight.domain.graph.utils import Toolkit - - -class Parser: - """ - Dump Parser Base. - - Args: - data_loader (DataLoader): DataLoader object. - """ - - def __init__(self, data_loader): - self._dump_dir = data_loader.dump_dir - self._loader = data_loader - self._constants = [] - self._parameters = [] - self._operators = [] - self._parse() - - def _parse(self): - """Parse dump graph files.""" - graphs = self._loader.load_graphs() - for graph in graphs: - rank_id = graph['rank_id'] - graph_protos = graph['graph_protos'] - for graph_data in graph_protos: - parser = PBParser(graph_data=graph_data) - parser.parse() - root_name = graph_data.root_name - root_graph_id = int(root_name) if root_name.isdigit() else 0 - for constant in parser.constants: - constant.graph_name = graph_data.name - constant.rank_id = rank_id - constant.root_graph_id = root_graph_id - self._constants += parser.constants - - for parameter in parser.parameters: - parameter.graph_name = graph_data.name - parameter.rank_id = rank_id - parameter.root_graph_id = root_graph_id - self._parameters += parser.parameters - - for operator in parser.operators: - operator.graph_name = graph_data.name - operator.rank_id = rank_id - operator.root_graph_id = root_graph_id - self._operators += parser.operators - - def get_tensor_files(self, qs, use_regex=False, rank_ids=None, iterations=None): - """ - Get tensor files. - - Args: - qs (str): Query string. - use_regex (bool): Indicates if query is regex. - rank_ids (list): Selected rank IDs. - iterations (list): Selected iterations. - - Returns: - dict, paths of tensor files. The format is like: {[op_full_name]: OpPathManager}. - Call OpPathManager.to_dict(), the result is format like: - {'rank_[rank_id]': - {[iteration_id]: - { - 'input': list[file_path], - 'output': list[file_path] - } - } - } - """ - operators = [] - if rank_ids is None: - operators = self._operators - else: - for operator in self._operators: - if operator.rank_id in rank_ids: - operators.append(operator) - - query = StackQuery(operators) - operators = query.filter(qs, use_regex=use_regex).all() - file_paths = {} - file_mapping = FileMapping(self._loader) - for operator in operators: - op_pattern = os.path.basename(operator.full_name) - res = file_mapping.find_tensor_file(op_pattern, rank_ids=rank_ids, iterations=iterations) - file_paths[operator.full_name] = res - return file_paths - - def export_xlsx(self, output_dir=None): - """ - Export to excel file. - - Args: - output_dir (str): Output directory to save the excel file. Default is None. - - Returns: - str, excel file path. - """ - if output_dir is None: - output_dir = os.getcwd() - else: - output_dir = os.path.realpath(output_dir) - if not os.path.exists(output_dir): - os.makedirs(output_dir, mode=stat.S_IRUSR | stat.S_IXUSR, exist_ok=True) - - toolkit = Toolkit( - dump_dir=self._dump_dir, - constants=self._constants, - parameters=self._parameters, - operators=self._operators) - - timestamp = datetime.datetime.now().strftime('%Y%m%d_%H%M%S') - file_path = os.path.join(output_dir, f'dump_{timestamp}.xlsx') - toolkit.export_xlsx(file_path) - return file_path - - -class DebuggerParser(Parser): - """Debugger Parser for Python API.""" - - @property - def parameters(self): - """Get parameters.""" - return self._parameters - - @property - def constants(self): - """Get constants.""" - return self._constants - - @property - def operators(self): - """Get parameters.""" - return self._operators diff --git a/mindinsight/debugger/proto/debug_grpc.proto b/mindinsight/debugger/proto/debug_grpc.proto deleted file mode 100644 index d4b04962..00000000 --- a/mindinsight/debugger/proto/debug_grpc.proto +++ /dev/null @@ -1,174 +0,0 @@ -/** - * Copyright 2020-2021 Huawei Technologies Co., Ltd - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -syntax = "proto3"; - -package debugger; - -import "mindinsight/domain/graph/proto/ms_graph.proto"; - - -service EventListener { - rpc WaitCMD (Metadata) returns (EventReply) {}; - rpc SendMetadata (Metadata) returns (EventReply) {}; - rpc SendGraph (stream Chunk) returns (EventReply) {}; - rpc SendTensors (stream mindinsight.domain.graph.TensorProto) returns (EventReply) {}; - rpc SendTensorBase (stream TensorBase) returns (EventReply) {}; - rpc SendTensorStats (stream TensorSummary) returns (EventReply) {}; - rpc SendWatchpointHits (stream WatchpointHit) returns (EventReply) {}; - rpc SendMultiGraphs (stream Chunk) returns (EventReply) {}; - rpc SendHeartbeat (Heartbeat) returns (EventReply) {}; -} - -message Metadata { - string device_name = 1; - int32 cur_step = 2; - // define the backend is 'GPU' or 'Ascend' - string backend = 3; - // the full name of current node - string cur_node = 4; - // check if training is done. - bool training_done = 5; - // the number of total graphs - int32 graph_num = 6; - // the version number of mindspore - string ms_version = 7; -} - -message Chunk { - bytes buffer = 1; - bool finished = 2; -} - -message EventReply { - enum Status { - OK = 0; - FAILED = 1; - PENDING = 2; - } - - Status status = 1; - - oneof cmd { - bool exit = 2; - RunCMD run_cmd = 3; - SetCMD set_cmd = 4; - ViewCMD view_cmd = 5; - bool version_matched = 6; - } -} - -message RunCMD { - // step level or node level. "step", "node" or "recheck". - string run_level = 1; - oneof cmd { - int32 run_steps = 2; - // the next node full name - string node_name = 3; - } -} - -message SetCMD { - repeated WatchNode watch_nodes = 1; - WatchCondition watch_condition = 2; - bool delete = 3; - int32 id = 4; -} - -message ViewCMD { - repeated mindinsight.domain.graph.TensorProto tensors = 1; - enum Level { - value = 0; - statistics = 1; - base = 2; - } - Level level = 2; -} - -message WatchCondition { - enum Condition { - // nan won't be not used anymore, but the first enum value must be zero in proto3, so we keep this Enum member. - nan = 0; - overflow = 2; - sd_gt = 11; - sd_lt = 12; - tensor_general_overflow = 13; - tensor_initialization = 14; - tensor_too_large = 15; - tensor_too_small = 16; - tensor_all_zero = 17; - tensor_change_too_large = 18; - tensor_change_too_small = 19; - tensor_not_changed = 20; - tensor_range = 21; - } - Condition condition = 1; - float value = 2; - message Parameter { - string name = 1; - bool disabled = 2; - double value = 3; - bool hit = 4; // Whether this parameter is hit when checking tensor. - double actual_value = 5; - } - // The ID 3 has been used on the mindspore side repeated bool include=3, so skip 3 for backward compatibility. - repeated Parameter params = 4; -} - -message WatchNode { - string node_name = 1; - string node_type = 2; - string graph_name = 3; - int32 rank_id = 4; - int32 device_id = 5; -} - -message WatchpointHit { - mindinsight.domain.graph.TensorProto tensor = 1; - WatchCondition watch_condition = 2; - int32 id = 3; - int32 error_code = 4; -} - -message Heartbeat { - string message = 1; - int32 period = 2; -} - -message TensorSummary{ - TensorBase tensor_base = 1; - Statistics statistics = 2; -} - -message Statistics { - bool is_bool = 1; - float max_value = 2; - float min_value = 3; - float avg_value = 4; - int32 count = 5; - int32 neg_zero_count = 6; - int32 pos_zero_count = 7; - int32 nan_count = 8; - int32 neg_inf_count = 9; - int32 pos_inf_count = 10; - int32 zero_count = 11; -} - -message TensorBase{ - int32 data_type = 1; - repeated int64 shape = 2; - int64 data_size = 3; -} diff --git a/mindinsight/debugger/proto/debug_grpc_pb2.py b/mindinsight/debugger/proto/debug_grpc_pb2.py deleted file mode 100644 index 490987cc..00000000 --- a/mindinsight/debugger/proto/debug_grpc_pb2.py +++ /dev/null @@ -1,1204 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: mindinsight/debugger/proto/debug_grpc.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from mindinsight.domain.graph.proto import ms_graph_pb2 as mindinsight_dot_domain_dot_graph_dot_proto_dot_ms__graph__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='mindinsight/debugger/proto/debug_grpc.proto', - package='debugger', - syntax='proto3', - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n+mindinsight/debugger/proto/debug_grpc.proto\x12\x08\x64\x65\x62ugger\x1a-mindinsight/domain/graph/proto/ms_graph.proto\"\x92\x01\n\x08Metadata\x12\x13\n\x0b\x64\x65vice_name\x18\x01 \x01(\t\x12\x10\n\x08\x63ur_step\x18\x02 \x01(\x05\x12\x0f\n\x07\x62\x61\x63kend\x18\x03 \x01(\t\x12\x10\n\x08\x63ur_node\x18\x04 \x01(\t\x12\x15\n\rtraining_done\x18\x05 \x01(\x08\x12\x11\n\tgraph_num\x18\x06 \x01(\x05\x12\x12\n\nms_version\x18\x07 \x01(\t\")\n\x05\x43hunk\x12\x0e\n\x06\x62uffer\x18\x01 \x01(\x0c\x12\x10\n\x08\x66inished\x18\x02 \x01(\x08\"\x87\x02\n\nEventReply\x12+\n\x06status\x18\x01 \x01(\x0e\x32\x1b.debugger.EventReply.Status\x12\x0e\n\x04\x65xit\x18\x02 \x01(\x08H\x00\x12#\n\x07run_cmd\x18\x03 \x01(\x0b\x32\x10.debugger.RunCMDH\x00\x12#\n\x07set_cmd\x18\x04 \x01(\x0b\x32\x10.debugger.SetCMDH\x00\x12%\n\x08view_cmd\x18\x05 \x01(\x0b\x32\x11.debugger.ViewCMDH\x00\x12\x19\n\x0fversion_matched\x18\x06 \x01(\x08H\x00\")\n\x06Status\x12\x06\n\x02OK\x10\x00\x12\n\n\x06\x46\x41ILED\x10\x01\x12\x0b\n\x07PENDING\x10\x02\x42\x05\n\x03\x63md\"L\n\x06RunCMD\x12\x11\n\trun_level\x18\x01 \x01(\t\x12\x13\n\trun_steps\x18\x02 \x01(\x05H\x00\x12\x13\n\tnode_name\x18\x03 \x01(\tH\x00\x42\x05\n\x03\x63md\"\x81\x01\n\x06SetCMD\x12(\n\x0bwatch_nodes\x18\x01 \x03(\x0b\x32\x13.debugger.WatchNode\x12\x31\n\x0fwatch_condition\x18\x02 \x01(\x0b\x32\x18.debugger.WatchCondition\x12\x0e\n\x06\x64\x65lete\x18\x03 \x01(\x08\x12\n\n\x02id\x18\x04 \x01(\x05\"\x97\x01\n\x07ViewCMD\x12\x36\n\x07tensors\x18\x01 \x03(\x0b\x32%.mindinsight.domain.graph.TensorProto\x12&\n\x05level\x18\x02 \x01(\x0e\x32\x17.debugger.ViewCMD.Level\",\n\x05Level\x12\t\n\x05value\x10\x00\x12\x0e\n\nstatistics\x10\x01\x12\x08\n\x04\x62\x61se\x10\x02\"\x81\x04\n\x0eWatchCondition\x12\x35\n\tcondition\x18\x01 \x01(\x0e\x32\".debugger.WatchCondition.Condition\x12\r\n\x05value\x18\x02 \x01(\x02\x12\x32\n\x06params\x18\x04 \x03(\x0b\x32\".debugger.WatchCondition.Parameter\x1a]\n\tParameter\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x08\x64isabled\x18\x02 \x01(\x08\x12\r\n\x05value\x18\x03 \x01(\x01\x12\x0b\n\x03hit\x18\x04 \x01(\x08\x12\x14\n\x0c\x61\x63tual_value\x18\x05 \x01(\x01\"\x95\x02\n\tCondition\x12\x07\n\x03nan\x10\x00\x12\x0c\n\x08overflow\x10\x02\x12\t\n\x05sd_gt\x10\x0b\x12\t\n\x05sd_lt\x10\x0c\x12\x1b\n\x17tensor_general_overflow\x10\r\x12\x19\n\x15tensor_initialization\x10\x0e\x12\x14\n\x10tensor_too_large\x10\x0f\x12\x14\n\x10tensor_too_small\x10\x10\x12\x13\n\x0ftensor_all_zero\x10\x11\x12\x1b\n\x17tensor_change_too_large\x10\x12\x12\x1b\n\x17tensor_change_too_small\x10\x13\x12\x16\n\x12tensor_not_changed\x10\x14\x12\x10\n\x0ctensor_range\x10\x15\"i\n\tWatchNode\x12\x11\n\tnode_name\x18\x01 \x01(\t\x12\x11\n\tnode_type\x18\x02 \x01(\t\x12\x12\n\ngraph_name\x18\x03 \x01(\t\x12\x0f\n\x07rank_id\x18\x04 \x01(\x05\x12\x11\n\tdevice_id\x18\x05 \x01(\x05\"\x99\x01\n\rWatchpointHit\x12\x35\n\x06tensor\x18\x01 \x01(\x0b\x32%.mindinsight.domain.graph.TensorProto\x12\x31\n\x0fwatch_condition\x18\x02 \x01(\x0b\x32\x18.debugger.WatchCondition\x12\n\n\x02id\x18\x03 \x01(\x05\x12\x12\n\nerror_code\x18\x04 \x01(\x05\",\n\tHeartbeat\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x0e\n\x06period\x18\x02 \x01(\x05\"d\n\rTensorSummary\x12)\n\x0btensor_base\x18\x01 \x01(\x0b\x32\x14.debugger.TensorBase\x12(\n\nstatistics\x18\x02 \x01(\x0b\x32\x14.debugger.Statistics\"\xea\x01\n\nStatistics\x12\x0f\n\x07is_bool\x18\x01 \x01(\x08\x12\x11\n\tmax_value\x18\x02 \x01(\x02\x12\x11\n\tmin_value\x18\x03 \x01(\x02\x12\x11\n\tavg_value\x18\x04 \x01(\x02\x12\r\n\x05\x63ount\x18\x05 \x01(\x05\x12\x16\n\x0eneg_zero_count\x18\x06 \x01(\x05\x12\x16\n\x0epos_zero_count\x18\x07 \x01(\x05\x12\x11\n\tnan_count\x18\x08 \x01(\x05\x12\x15\n\rneg_inf_count\x18\t \x01(\x05\x12\x15\n\rpos_inf_count\x18\n \x01(\x05\x12\x12\n\nzero_count\x18\x0b \x01(\x05\"A\n\nTensorBase\x12\x11\n\tdata_type\x18\x01 \x01(\x05\x12\r\n\x05shape\x18\x02 \x03(\x03\x12\x11\n\tdata_size\x18\x03 \x01(\x03\x32\xd7\x04\n\rEventListener\x12\x35\n\x07WaitCMD\x12\x12.debugger.Metadata\x1a\x14.debugger.EventReply\"\x00\x12:\n\x0cSendMetadata\x12\x12.debugger.Metadata\x1a\x14.debugger.EventReply\"\x00\x12\x36\n\tSendGraph\x12\x0f.debugger.Chunk\x1a\x14.debugger.EventReply\"\x00(\x01\x12N\n\x0bSendTensors\x12%.mindinsight.domain.graph.TensorProto\x1a\x14.debugger.EventReply\"\x00(\x01\x12@\n\x0eSendTensorBase\x12\x14.debugger.TensorBase\x1a\x14.debugger.EventReply\"\x00(\x01\x12\x44\n\x0fSendTensorStats\x12\x17.debugger.TensorSummary\x1a\x14.debugger.EventReply\"\x00(\x01\x12G\n\x12SendWatchpointHits\x12\x17.debugger.WatchpointHit\x1a\x14.debugger.EventReply\"\x00(\x01\x12<\n\x0fSendMultiGraphs\x12\x0f.debugger.Chunk\x1a\x14.debugger.EventReply\"\x00(\x01\x12<\n\rSendHeartbeat\x12\x13.debugger.Heartbeat\x1a\x14.debugger.EventReply\"\x00\x62\x06proto3' - , - dependencies=[mindinsight_dot_domain_dot_graph_dot_proto_dot_ms__graph__pb2.DESCRIPTOR,]) - - - -_EVENTREPLY_STATUS = _descriptor.EnumDescriptor( - name='Status', - full_name='debugger.EventReply.Status', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='OK', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='FAILED', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='PENDING', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=512, - serialized_end=553, -) -_sym_db.RegisterEnumDescriptor(_EVENTREPLY_STATUS) - -_VIEWCMD_LEVEL = _descriptor.EnumDescriptor( - name='Level', - full_name='debugger.ViewCMD.Level', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='value', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='statistics', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='base', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=880, - serialized_end=924, -) -_sym_db.RegisterEnumDescriptor(_VIEWCMD_LEVEL) - -_WATCHCONDITION_CONDITION = _descriptor.EnumDescriptor( - name='Condition', - full_name='debugger.WatchCondition.Condition', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='nan', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='overflow', index=1, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='sd_gt', index=2, number=11, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='sd_lt', index=3, number=12, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='tensor_general_overflow', index=4, number=13, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='tensor_initialization', index=5, number=14, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='tensor_too_large', index=6, number=15, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='tensor_too_small', index=7, number=16, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='tensor_all_zero', index=8, number=17, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='tensor_change_too_large', index=9, number=18, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='tensor_change_too_small', index=10, number=19, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='tensor_not_changed', index=11, number=20, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='tensor_range', index=12, number=21, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=1163, - serialized_end=1440, -) -_sym_db.RegisterEnumDescriptor(_WATCHCONDITION_CONDITION) - - -_METADATA = _descriptor.Descriptor( - name='Metadata', - full_name='debugger.Metadata', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='device_name', full_name='debugger.Metadata.device_name', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='cur_step', full_name='debugger.Metadata.cur_step', index=1, - number=2, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='backend', full_name='debugger.Metadata.backend', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='cur_node', full_name='debugger.Metadata.cur_node', index=3, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='training_done', full_name='debugger.Metadata.training_done', index=4, - number=5, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='graph_num', full_name='debugger.Metadata.graph_num', index=5, - number=6, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ms_version', full_name='debugger.Metadata.ms_version', index=6, - number=7, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=105, - serialized_end=251, -) - - -_CHUNK = _descriptor.Descriptor( - name='Chunk', - full_name='debugger.Chunk', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='buffer', full_name='debugger.Chunk.buffer', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='finished', full_name='debugger.Chunk.finished', index=1, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=253, - serialized_end=294, -) - - -_EVENTREPLY = _descriptor.Descriptor( - name='EventReply', - full_name='debugger.EventReply', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='status', full_name='debugger.EventReply.status', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='exit', full_name='debugger.EventReply.exit', index=1, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='run_cmd', full_name='debugger.EventReply.run_cmd', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='set_cmd', full_name='debugger.EventReply.set_cmd', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='view_cmd', full_name='debugger.EventReply.view_cmd', index=4, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='version_matched', full_name='debugger.EventReply.version_matched', index=5, - number=6, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _EVENTREPLY_STATUS, - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='cmd', full_name='debugger.EventReply.cmd', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=297, - serialized_end=560, -) - - -_RUNCMD = _descriptor.Descriptor( - name='RunCMD', - full_name='debugger.RunCMD', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='run_level', full_name='debugger.RunCMD.run_level', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='run_steps', full_name='debugger.RunCMD.run_steps', index=1, - number=2, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='node_name', full_name='debugger.RunCMD.node_name', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='cmd', full_name='debugger.RunCMD.cmd', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - ], - serialized_start=562, - serialized_end=638, -) - - -_SETCMD = _descriptor.Descriptor( - name='SetCMD', - full_name='debugger.SetCMD', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='watch_nodes', full_name='debugger.SetCMD.watch_nodes', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='watch_condition', full_name='debugger.SetCMD.watch_condition', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='delete', full_name='debugger.SetCMD.delete', index=2, - number=3, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='id', full_name='debugger.SetCMD.id', index=3, - number=4, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=641, - serialized_end=770, -) - - -_VIEWCMD = _descriptor.Descriptor( - name='ViewCMD', - full_name='debugger.ViewCMD', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='tensors', full_name='debugger.ViewCMD.tensors', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='level', full_name='debugger.ViewCMD.level', index=1, - number=2, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _VIEWCMD_LEVEL, - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=773, - serialized_end=924, -) - - -_WATCHCONDITION_PARAMETER = _descriptor.Descriptor( - name='Parameter', - full_name='debugger.WatchCondition.Parameter', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='name', full_name='debugger.WatchCondition.Parameter.name', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='disabled', full_name='debugger.WatchCondition.Parameter.disabled', index=1, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='debugger.WatchCondition.Parameter.value', index=2, - number=3, type=1, cpp_type=5, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='hit', full_name='debugger.WatchCondition.Parameter.hit', index=3, - number=4, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='actual_value', full_name='debugger.WatchCondition.Parameter.actual_value', index=4, - number=5, type=1, cpp_type=5, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1067, - serialized_end=1160, -) - -_WATCHCONDITION = _descriptor.Descriptor( - name='WatchCondition', - full_name='debugger.WatchCondition', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='condition', full_name='debugger.WatchCondition.condition', index=0, - number=1, type=14, cpp_type=8, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='debugger.WatchCondition.value', index=1, - number=2, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='params', full_name='debugger.WatchCondition.params', index=2, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_WATCHCONDITION_PARAMETER, ], - enum_types=[ - _WATCHCONDITION_CONDITION, - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=927, - serialized_end=1440, -) - - -_WATCHNODE = _descriptor.Descriptor( - name='WatchNode', - full_name='debugger.WatchNode', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='node_name', full_name='debugger.WatchNode.node_name', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='node_type', full_name='debugger.WatchNode.node_type', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='graph_name', full_name='debugger.WatchNode.graph_name', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='rank_id', full_name='debugger.WatchNode.rank_id', index=3, - number=4, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='device_id', full_name='debugger.WatchNode.device_id', index=4, - number=5, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1442, - serialized_end=1547, -) - - -_WATCHPOINTHIT = _descriptor.Descriptor( - name='WatchpointHit', - full_name='debugger.WatchpointHit', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='tensor', full_name='debugger.WatchpointHit.tensor', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='watch_condition', full_name='debugger.WatchpointHit.watch_condition', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='id', full_name='debugger.WatchpointHit.id', index=2, - number=3, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='error_code', full_name='debugger.WatchpointHit.error_code', index=3, - number=4, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1550, - serialized_end=1703, -) - - -_HEARTBEAT = _descriptor.Descriptor( - name='Heartbeat', - full_name='debugger.Heartbeat', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='message', full_name='debugger.Heartbeat.message', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='period', full_name='debugger.Heartbeat.period', index=1, - number=2, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1705, - serialized_end=1749, -) - - -_TENSORSUMMARY = _descriptor.Descriptor( - name='TensorSummary', - full_name='debugger.TensorSummary', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='tensor_base', full_name='debugger.TensorSummary.tensor_base', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='statistics', full_name='debugger.TensorSummary.statistics', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1751, - serialized_end=1851, -) - - -_STATISTICS = _descriptor.Descriptor( - name='Statistics', - full_name='debugger.Statistics', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='is_bool', full_name='debugger.Statistics.is_bool', index=0, - number=1, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='max_value', full_name='debugger.Statistics.max_value', index=1, - number=2, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='min_value', full_name='debugger.Statistics.min_value', index=2, - number=3, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='avg_value', full_name='debugger.Statistics.avg_value', index=3, - number=4, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='count', full_name='debugger.Statistics.count', index=4, - number=5, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='neg_zero_count', full_name='debugger.Statistics.neg_zero_count', index=5, - number=6, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='pos_zero_count', full_name='debugger.Statistics.pos_zero_count', index=6, - number=7, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='nan_count', full_name='debugger.Statistics.nan_count', index=7, - number=8, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='neg_inf_count', full_name='debugger.Statistics.neg_inf_count', index=8, - number=9, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='pos_inf_count', full_name='debugger.Statistics.pos_inf_count', index=9, - number=10, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='zero_count', full_name='debugger.Statistics.zero_count', index=10, - number=11, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1854, - serialized_end=2088, -) - - -_TENSORBASE = _descriptor.Descriptor( - name='TensorBase', - full_name='debugger.TensorBase', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='data_type', full_name='debugger.TensorBase.data_type', index=0, - number=1, type=5, cpp_type=1, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='shape', full_name='debugger.TensorBase.shape', index=1, - number=2, type=3, cpp_type=2, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='data_size', full_name='debugger.TensorBase.data_size', index=2, - number=3, type=3, cpp_type=2, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2090, - serialized_end=2155, -) - -_EVENTREPLY.fields_by_name['status'].enum_type = _EVENTREPLY_STATUS -_EVENTREPLY.fields_by_name['run_cmd'].message_type = _RUNCMD -_EVENTREPLY.fields_by_name['set_cmd'].message_type = _SETCMD -_EVENTREPLY.fields_by_name['view_cmd'].message_type = _VIEWCMD -_EVENTREPLY_STATUS.containing_type = _EVENTREPLY -_EVENTREPLY.oneofs_by_name['cmd'].fields.append( - _EVENTREPLY.fields_by_name['exit']) -_EVENTREPLY.fields_by_name['exit'].containing_oneof = _EVENTREPLY.oneofs_by_name['cmd'] -_EVENTREPLY.oneofs_by_name['cmd'].fields.append( - _EVENTREPLY.fields_by_name['run_cmd']) -_EVENTREPLY.fields_by_name['run_cmd'].containing_oneof = _EVENTREPLY.oneofs_by_name['cmd'] -_EVENTREPLY.oneofs_by_name['cmd'].fields.append( - _EVENTREPLY.fields_by_name['set_cmd']) -_EVENTREPLY.fields_by_name['set_cmd'].containing_oneof = _EVENTREPLY.oneofs_by_name['cmd'] -_EVENTREPLY.oneofs_by_name['cmd'].fields.append( - _EVENTREPLY.fields_by_name['view_cmd']) -_EVENTREPLY.fields_by_name['view_cmd'].containing_oneof = _EVENTREPLY.oneofs_by_name['cmd'] -_EVENTREPLY.oneofs_by_name['cmd'].fields.append( - _EVENTREPLY.fields_by_name['version_matched']) -_EVENTREPLY.fields_by_name['version_matched'].containing_oneof = _EVENTREPLY.oneofs_by_name['cmd'] -_RUNCMD.oneofs_by_name['cmd'].fields.append( - _RUNCMD.fields_by_name['run_steps']) -_RUNCMD.fields_by_name['run_steps'].containing_oneof = _RUNCMD.oneofs_by_name['cmd'] -_RUNCMD.oneofs_by_name['cmd'].fields.append( - _RUNCMD.fields_by_name['node_name']) -_RUNCMD.fields_by_name['node_name'].containing_oneof = _RUNCMD.oneofs_by_name['cmd'] -_SETCMD.fields_by_name['watch_nodes'].message_type = _WATCHNODE -_SETCMD.fields_by_name['watch_condition'].message_type = _WATCHCONDITION -_VIEWCMD.fields_by_name['tensors'].message_type = mindinsight_dot_domain_dot_graph_dot_proto_dot_ms__graph__pb2._TENSORPROTO -_VIEWCMD.fields_by_name['level'].enum_type = _VIEWCMD_LEVEL -_VIEWCMD_LEVEL.containing_type = _VIEWCMD -_WATCHCONDITION_PARAMETER.containing_type = _WATCHCONDITION -_WATCHCONDITION.fields_by_name['condition'].enum_type = _WATCHCONDITION_CONDITION -_WATCHCONDITION.fields_by_name['params'].message_type = _WATCHCONDITION_PARAMETER -_WATCHCONDITION_CONDITION.containing_type = _WATCHCONDITION -_WATCHPOINTHIT.fields_by_name['tensor'].message_type = mindinsight_dot_domain_dot_graph_dot_proto_dot_ms__graph__pb2._TENSORPROTO -_WATCHPOINTHIT.fields_by_name['watch_condition'].message_type = _WATCHCONDITION -_TENSORSUMMARY.fields_by_name['tensor_base'].message_type = _TENSORBASE -_TENSORSUMMARY.fields_by_name['statistics'].message_type = _STATISTICS -DESCRIPTOR.message_types_by_name['Metadata'] = _METADATA -DESCRIPTOR.message_types_by_name['Chunk'] = _CHUNK -DESCRIPTOR.message_types_by_name['EventReply'] = _EVENTREPLY -DESCRIPTOR.message_types_by_name['RunCMD'] = _RUNCMD -DESCRIPTOR.message_types_by_name['SetCMD'] = _SETCMD -DESCRIPTOR.message_types_by_name['ViewCMD'] = _VIEWCMD -DESCRIPTOR.message_types_by_name['WatchCondition'] = _WATCHCONDITION -DESCRIPTOR.message_types_by_name['WatchNode'] = _WATCHNODE -DESCRIPTOR.message_types_by_name['WatchpointHit'] = _WATCHPOINTHIT -DESCRIPTOR.message_types_by_name['Heartbeat'] = _HEARTBEAT -DESCRIPTOR.message_types_by_name['TensorSummary'] = _TENSORSUMMARY -DESCRIPTOR.message_types_by_name['Statistics'] = _STATISTICS -DESCRIPTOR.message_types_by_name['TensorBase'] = _TENSORBASE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Metadata = _reflection.GeneratedProtocolMessageType('Metadata', (_message.Message,), { - 'DESCRIPTOR' : _METADATA, - '__module__' : 'mindinsight.debugger.proto.debug_grpc_pb2' - # @@protoc_insertion_point(class_scope:debugger.Metadata) - }) -_sym_db.RegisterMessage(Metadata) - -Chunk = _reflection.GeneratedProtocolMessageType('Chunk', (_message.Message,), { - 'DESCRIPTOR' : _CHUNK, - '__module__' : 'mindinsight.debugger.proto.debug_grpc_pb2' - # @@protoc_insertion_point(class_scope:debugger.Chunk) - }) -_sym_db.RegisterMessage(Chunk) - -EventReply = _reflection.GeneratedProtocolMessageType('EventReply', (_message.Message,), { - 'DESCRIPTOR' : _EVENTREPLY, - '__module__' : 'mindinsight.debugger.proto.debug_grpc_pb2' - # @@protoc_insertion_point(class_scope:debugger.EventReply) - }) -_sym_db.RegisterMessage(EventReply) - -RunCMD = _reflection.GeneratedProtocolMessageType('RunCMD', (_message.Message,), { - 'DESCRIPTOR' : _RUNCMD, - '__module__' : 'mindinsight.debugger.proto.debug_grpc_pb2' - # @@protoc_insertion_point(class_scope:debugger.RunCMD) - }) -_sym_db.RegisterMessage(RunCMD) - -SetCMD = _reflection.GeneratedProtocolMessageType('SetCMD', (_message.Message,), { - 'DESCRIPTOR' : _SETCMD, - '__module__' : 'mindinsight.debugger.proto.debug_grpc_pb2' - # @@protoc_insertion_point(class_scope:debugger.SetCMD) - }) -_sym_db.RegisterMessage(SetCMD) - -ViewCMD = _reflection.GeneratedProtocolMessageType('ViewCMD', (_message.Message,), { - 'DESCRIPTOR' : _VIEWCMD, - '__module__' : 'mindinsight.debugger.proto.debug_grpc_pb2' - # @@protoc_insertion_point(class_scope:debugger.ViewCMD) - }) -_sym_db.RegisterMessage(ViewCMD) - -WatchCondition = _reflection.GeneratedProtocolMessageType('WatchCondition', (_message.Message,), { - - 'Parameter' : _reflection.GeneratedProtocolMessageType('Parameter', (_message.Message,), { - 'DESCRIPTOR' : _WATCHCONDITION_PARAMETER, - '__module__' : 'mindinsight.debugger.proto.debug_grpc_pb2' - # @@protoc_insertion_point(class_scope:debugger.WatchCondition.Parameter) - }) - , - 'DESCRIPTOR' : _WATCHCONDITION, - '__module__' : 'mindinsight.debugger.proto.debug_grpc_pb2' - # @@protoc_insertion_point(class_scope:debugger.WatchCondition) - }) -_sym_db.RegisterMessage(WatchCondition) -_sym_db.RegisterMessage(WatchCondition.Parameter) - -WatchNode = _reflection.GeneratedProtocolMessageType('WatchNode', (_message.Message,), { - 'DESCRIPTOR' : _WATCHNODE, - '__module__' : 'mindinsight.debugger.proto.debug_grpc_pb2' - # @@protoc_insertion_point(class_scope:debugger.WatchNode) - }) -_sym_db.RegisterMessage(WatchNode) - -WatchpointHit = _reflection.GeneratedProtocolMessageType('WatchpointHit', (_message.Message,), { - 'DESCRIPTOR' : _WATCHPOINTHIT, - '__module__' : 'mindinsight.debugger.proto.debug_grpc_pb2' - # @@protoc_insertion_point(class_scope:debugger.WatchpointHit) - }) -_sym_db.RegisterMessage(WatchpointHit) - -Heartbeat = _reflection.GeneratedProtocolMessageType('Heartbeat', (_message.Message,), { - 'DESCRIPTOR' : _HEARTBEAT, - '__module__' : 'mindinsight.debugger.proto.debug_grpc_pb2' - # @@protoc_insertion_point(class_scope:debugger.Heartbeat) - }) -_sym_db.RegisterMessage(Heartbeat) - -TensorSummary = _reflection.GeneratedProtocolMessageType('TensorSummary', (_message.Message,), { - 'DESCRIPTOR' : _TENSORSUMMARY, - '__module__' : 'mindinsight.debugger.proto.debug_grpc_pb2' - # @@protoc_insertion_point(class_scope:debugger.TensorSummary) - }) -_sym_db.RegisterMessage(TensorSummary) - -Statistics = _reflection.GeneratedProtocolMessageType('Statistics', (_message.Message,), { - 'DESCRIPTOR' : _STATISTICS, - '__module__' : 'mindinsight.debugger.proto.debug_grpc_pb2' - # @@protoc_insertion_point(class_scope:debugger.Statistics) - }) -_sym_db.RegisterMessage(Statistics) - -TensorBase = _reflection.GeneratedProtocolMessageType('TensorBase', (_message.Message,), { - 'DESCRIPTOR' : _TENSORBASE, - '__module__' : 'mindinsight.debugger.proto.debug_grpc_pb2' - # @@protoc_insertion_point(class_scope:debugger.TensorBase) - }) -_sym_db.RegisterMessage(TensorBase) - - - -_EVENTLISTENER = _descriptor.ServiceDescriptor( - name='EventListener', - full_name='debugger.EventListener', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=2158, - serialized_end=2757, - methods=[ - _descriptor.MethodDescriptor( - name='WaitCMD', - full_name='debugger.EventListener.WaitCMD', - index=0, - containing_service=None, - input_type=_METADATA, - output_type=_EVENTREPLY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SendMetadata', - full_name='debugger.EventListener.SendMetadata', - index=1, - containing_service=None, - input_type=_METADATA, - output_type=_EVENTREPLY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SendGraph', - full_name='debugger.EventListener.SendGraph', - index=2, - containing_service=None, - input_type=_CHUNK, - output_type=_EVENTREPLY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SendTensors', - full_name='debugger.EventListener.SendTensors', - index=3, - containing_service=None, - input_type=mindinsight_dot_domain_dot_graph_dot_proto_dot_ms__graph__pb2._TENSORPROTO, - output_type=_EVENTREPLY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SendTensorBase', - full_name='debugger.EventListener.SendTensorBase', - index=4, - containing_service=None, - input_type=_TENSORBASE, - output_type=_EVENTREPLY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SendTensorStats', - full_name='debugger.EventListener.SendTensorStats', - index=5, - containing_service=None, - input_type=_TENSORSUMMARY, - output_type=_EVENTREPLY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SendWatchpointHits', - full_name='debugger.EventListener.SendWatchpointHits', - index=6, - containing_service=None, - input_type=_WATCHPOINTHIT, - output_type=_EVENTREPLY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SendMultiGraphs', - full_name='debugger.EventListener.SendMultiGraphs', - index=7, - containing_service=None, - input_type=_CHUNK, - output_type=_EVENTREPLY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='SendHeartbeat', - full_name='debugger.EventListener.SendHeartbeat', - index=8, - containing_service=None, - input_type=_HEARTBEAT, - output_type=_EVENTREPLY, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) -_sym_db.RegisterServiceDescriptor(_EVENTLISTENER) - -DESCRIPTOR.services_by_name['EventListener'] = _EVENTLISTENER - -# @@protoc_insertion_point(module_scope) diff --git a/mindinsight/debugger/proto/debug_grpc_pb2_grpc.py b/mindinsight/debugger/proto/debug_grpc_pb2_grpc.py deleted file mode 100644 index 8dc5f207..00000000 --- a/mindinsight/debugger/proto/debug_grpc_pb2_grpc.py +++ /dev/null @@ -1,331 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from mindinsight.debugger.proto import debug_grpc_pb2 as mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2 -from mindinsight.domain.graph.proto import ms_graph_pb2 as mindinsight_dot_domain_dot_graph_dot_proto_dot_ms__graph__pb2 - - -class EventListenerStub(object): - """Missing associated documentation comment in .proto file.""" - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.WaitCMD = channel.unary_unary( - '/debugger.EventListener/WaitCMD', - request_serializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.Metadata.SerializeToString, - response_deserializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.FromString, - ) - self.SendMetadata = channel.unary_unary( - '/debugger.EventListener/SendMetadata', - request_serializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.Metadata.SerializeToString, - response_deserializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.FromString, - ) - self.SendGraph = channel.stream_unary( - '/debugger.EventListener/SendGraph', - request_serializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.Chunk.SerializeToString, - response_deserializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.FromString, - ) - self.SendTensors = channel.stream_unary( - '/debugger.EventListener/SendTensors', - request_serializer=mindinsight_dot_domain_dot_graph_dot_proto_dot_ms__graph__pb2.TensorProto.SerializeToString, - response_deserializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.FromString, - ) - self.SendTensorBase = channel.stream_unary( - '/debugger.EventListener/SendTensorBase', - request_serializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.TensorBase.SerializeToString, - response_deserializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.FromString, - ) - self.SendTensorStats = channel.stream_unary( - '/debugger.EventListener/SendTensorStats', - request_serializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.TensorSummary.SerializeToString, - response_deserializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.FromString, - ) - self.SendWatchpointHits = channel.stream_unary( - '/debugger.EventListener/SendWatchpointHits', - request_serializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.WatchpointHit.SerializeToString, - response_deserializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.FromString, - ) - self.SendMultiGraphs = channel.stream_unary( - '/debugger.EventListener/SendMultiGraphs', - request_serializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.Chunk.SerializeToString, - response_deserializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.FromString, - ) - self.SendHeartbeat = channel.unary_unary( - '/debugger.EventListener/SendHeartbeat', - request_serializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.Heartbeat.SerializeToString, - response_deserializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.FromString, - ) - - -class EventListenerServicer(object): - """Missing associated documentation comment in .proto file.""" - - def WaitCMD(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def SendMetadata(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def SendGraph(self, request_iterator, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def SendTensors(self, request_iterator, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def SendTensorBase(self, request_iterator, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def SendTensorStats(self, request_iterator, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def SendWatchpointHits(self, request_iterator, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def SendMultiGraphs(self, request_iterator, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def SendHeartbeat(self, request, context): - """Missing associated documentation comment in .proto file.""" - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_EventListenerServicer_to_server(servicer, server): - rpc_method_handlers = { - 'WaitCMD': grpc.unary_unary_rpc_method_handler( - servicer.WaitCMD, - request_deserializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.Metadata.FromString, - response_serializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.SerializeToString, - ), - 'SendMetadata': grpc.unary_unary_rpc_method_handler( - servicer.SendMetadata, - request_deserializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.Metadata.FromString, - response_serializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.SerializeToString, - ), - 'SendGraph': grpc.stream_unary_rpc_method_handler( - servicer.SendGraph, - request_deserializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.Chunk.FromString, - response_serializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.SerializeToString, - ), - 'SendTensors': grpc.stream_unary_rpc_method_handler( - servicer.SendTensors, - request_deserializer=mindinsight_dot_domain_dot_graph_dot_proto_dot_ms__graph__pb2.TensorProto.FromString, - response_serializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.SerializeToString, - ), - 'SendTensorBase': grpc.stream_unary_rpc_method_handler( - servicer.SendTensorBase, - request_deserializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.TensorBase.FromString, - response_serializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.SerializeToString, - ), - 'SendTensorStats': grpc.stream_unary_rpc_method_handler( - servicer.SendTensorStats, - request_deserializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.TensorSummary.FromString, - response_serializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.SerializeToString, - ), - 'SendWatchpointHits': grpc.stream_unary_rpc_method_handler( - servicer.SendWatchpointHits, - request_deserializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.WatchpointHit.FromString, - response_serializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.SerializeToString, - ), - 'SendMultiGraphs': grpc.stream_unary_rpc_method_handler( - servicer.SendMultiGraphs, - request_deserializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.Chunk.FromString, - response_serializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.SerializeToString, - ), - 'SendHeartbeat': grpc.unary_unary_rpc_method_handler( - servicer.SendHeartbeat, - request_deserializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.Heartbeat.FromString, - response_serializer=mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'debugger.EventListener', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class EventListener(object): - """Missing associated documentation comment in .proto file.""" - - @staticmethod - def WaitCMD(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/debugger.EventListener/WaitCMD', - mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.Metadata.SerializeToString, - mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def SendMetadata(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/debugger.EventListener/SendMetadata', - mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.Metadata.SerializeToString, - mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def SendGraph(request_iterator, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.stream_unary(request_iterator, target, '/debugger.EventListener/SendGraph', - mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.Chunk.SerializeToString, - mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def SendTensors(request_iterator, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.stream_unary(request_iterator, target, '/debugger.EventListener/SendTensors', - mindinsight_dot_domain_dot_graph_dot_proto_dot_ms__graph__pb2.TensorProto.SerializeToString, - mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def SendTensorBase(request_iterator, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.stream_unary(request_iterator, target, '/debugger.EventListener/SendTensorBase', - mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.TensorBase.SerializeToString, - mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def SendTensorStats(request_iterator, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.stream_unary(request_iterator, target, '/debugger.EventListener/SendTensorStats', - mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.TensorSummary.SerializeToString, - mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def SendWatchpointHits(request_iterator, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.stream_unary(request_iterator, target, '/debugger.EventListener/SendWatchpointHits', - mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.WatchpointHit.SerializeToString, - mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def SendMultiGraphs(request_iterator, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.stream_unary(request_iterator, target, '/debugger.EventListener/SendMultiGraphs', - mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.Chunk.SerializeToString, - mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def SendHeartbeat(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/debugger.EventListener/SendHeartbeat', - mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.Heartbeat.SerializeToString, - mindinsight_dot_debugger_dot_proto_dot_debug__grpc__pb2.EventReply.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/mindinsight/debugger/session_manager.py b/mindinsight/debugger/session_manager.py deleted file mode 100644 index fe1d29c6..00000000 --- a/mindinsight/debugger/session_manager.py +++ /dev/null @@ -1,189 +0,0 @@ -# Copyright 2020-2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Implement the session manager.""" -import os -import threading - -import _thread - -from mindinsight.conf import settings -from mindinsight.debugger.common.log import LOGGER as logger -from mindinsight.debugger.common.exceptions.exceptions import DebuggerSessionNumOverBoundError, \ - DebuggerSessionNotFoundError, DebuggerOnlineSessionUnavailable -from mindinsight.debugger.debugger_services.debugger_server_factory import DebuggerServerContext -from mindinsight.debugger.debugger_session import DebuggerSession - - -class SessionManager: - """The server manager of debugger.""" - - ONLINE_TYPE = "ONLINE" - MAX_OFFLINE_SESSION_NUM = settings.MAX_OFFLINE_DEBUGGER_SESSION_NUM - ONLINE_SESSION_ID = "0" - _instance = None - _cls_lock = threading.Lock() - - def __init__(self): - self.train_jobs = {} - self.sessions = {} - # The offline session id is start from 1, and the online session id is 0. - self._next_session_id = 1 - self._lock = threading.Lock() - self._exiting = False - enable_debugger = settings.ENABLE_DEBUGGER if hasattr(settings, 'ENABLE_DEBUGGER') else False - if enable_debugger: - self._create_online_session() - - @classmethod - def get_instance(cls): - """Get the singleton instance.""" - with cls._cls_lock: - if cls._instance is None: - cls._instance = SessionManager() - return cls._instance - - def exit(self): - """Called when the gunicorn worker process is exiting.""" - with self._lock: - logger.info("Start to exit sessions.") - self._exiting = True - for session in self.sessions.values(): - session.stop() - logger.info("Sessions exited.") - - def get_session(self, session_id): - """ - Get session by session id or get all session info. - - Args: - session_id (Union[None, str]): The id of session. - - Returns: - DebuggerSession, debugger session object. - """ - with self._lock: - if session_id in self.sessions: - return self.sessions.get(session_id) - - logger.error('Debugger session %s is not found.', session_id) - raise DebuggerSessionNotFoundError("{}".format(session_id)) - - def _create_online_session(self): - """Create online session.""" - with self._lock: - context = DebuggerServerContext(dbg_mode='online') - online_session = DebuggerSession(context) - online_session.start() - self.sessions[self.ONLINE_SESSION_ID] = online_session - - def _create_offline_session(self, train_job): - """Create offline session.""" - self._check_session_num() - if not isinstance(train_job, str): - logger.error('The train job path should be string.') - raise ValueError("The train job path should be string.") - summary_base_dir = settings.SUMMARY_BASE_DIR - whole_path = os.path.join(summary_base_dir, train_job) - normalized_path = validate_and_normalize_path(whole_path) - context = DebuggerServerContext(dbg_mode='offline', train_job=train_job, dbg_dir=normalized_path) - session = DebuggerSession(context) - session.start() - session_id = str(self._next_session_id) - self.sessions[session_id] = session - self.train_jobs[train_job] = session_id - self._next_session_id += 1 - return session_id - - def create_session(self, session_type, train_job=None): - """ - Create the session by the train job info or session type if the session doesn't exist. - - Args: - session_type (str): The session_type. - train_job (str): The train job info. - - Returns: - str, session id. - """ - with self._lock: - if self._exiting: - logger.info( - "System is exiting, will terminate the thread.") - _thread.exit() - - if session_type == self.ONLINE_TYPE: - if self.ONLINE_SESSION_ID not in self.sessions: - logger.error( - 'Online session is unavailable, set --enable-debugger as true/1 to enable debugger ' - 'when start Mindinsight server.') - raise DebuggerOnlineSessionUnavailable() - return self.ONLINE_SESSION_ID - - if train_job in self.train_jobs: - return self.train_jobs.get(train_job) - - return self._create_offline_session(train_job) - - def delete_session(self, session_id): - """Delete session by session id.""" - with self._lock: - if session_id == self.ONLINE_SESSION_ID: - logger.error('Online session can not be deleted.') - raise ValueError("Online session can not be delete.") - - if session_id not in self.sessions: - logger.error('Debugger session %s is not found', session_id) - raise DebuggerSessionNotFoundError("session id {}".format(session_id)) - - session = self.sessions.get(session_id) - session.stop() - self.sessions.pop(session_id) - self.train_jobs.pop(session.train_job) - return - - def get_train_jobs(self): - """Get all train jobs.""" - return {"train_jobs": self.train_jobs} - - def _check_session_num(self): - """Check the amount of sessions.""" - session_limitation = self.MAX_OFFLINE_SESSION_NUM - if self.ONLINE_SESSION_ID in self.sessions: - session_limitation += 1 - if len(self.sessions) >= session_limitation: - logger.warning('Offline debugger session num %s is reach the limitation %s', len(self.sessions), - session_limitation) - raise DebuggerSessionNumOverBoundError() - - -def validate_and_normalize_path(path): - """Validate and normalize_path""" - if not path: - logger.error('The whole path of dump directory is None.') - raise ValueError("The whole path of dump directory is None.") - - path_str = str(path) - - if not path_str.startswith("/"): - logger.error('The whole path of dump directory is not start with \'/\'') - raise ValueError("The whole path of dump directory is not start with \'/\'") - - try: - normalized_path = os.path.realpath(path) - except ValueError: - logger.error('The whole path of dump directory is invalid.') - raise ValueError("The whole path of dump directory is invalid.") - - return normalized_path diff --git a/mindinsight/debugger/stream_cache/__init__.py b/mindinsight/debugger/stream_cache/__init__.py deleted file mode 100644 index ae29db32..00000000 --- a/mindinsight/debugger/stream_cache/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Debugger stream cache module.""" diff --git a/mindinsight/debugger/stream_cache/data_loader.py b/mindinsight/debugger/stream_cache/data_loader.py deleted file mode 100644 index cb4036ed..00000000 --- a/mindinsight/debugger/stream_cache/data_loader.py +++ /dev/null @@ -1,427 +0,0 @@ -# Copyright 2021-2022 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""This file is used to define the DataLoader.""" -import csv -import enum -import os -import json -import re -from collections import namedtuple -from pathlib import Path - -from google.protobuf.message import DecodeError - -from mindinsight.debugger.common.exceptions.exceptions import DebuggerParamValueError, RankDirNotFound, \ - DebuggerJsonFileParseError, DebuggerNodeTooLarge -from mindinsight.debugger.common.log import LOGGER as log -from mindinsight.debugger.common.utils import DumpSettings, is_valid_rank_dir_name -from mindinsight.domain.graph.proto.ms_graph_pb2 import ModelProto - -RankDir = namedtuple("rank_dir", ["rank_id", "path"]) - - -@enum.unique -class DumpTarget(enum.Enum): - """Define the status of reply.""" - FULL = 0 - INPUT_ONLY = 1 - OUTPUT_ONLY = 2 - - -@enum.unique -class FileFormat(enum.Enum): - """Define the file format.""" - BIN = "bin" - NPY = "npy" - - -class DataLoader: - """The DataLoader object provides interface to load graphs and device information from base_dir.""" - - DUMP_METADATA = '.dump_metadata' - EXECUTION_ORDER = 'execution_order' - GRAPHS = 'graphs' - - def __init__(self, base_dir): - self._debugger_base_dir = Path(base_dir).absolute() - # list of RankDir objects - self._rank_dirs = [] - # flag for whether the data is from sync dump or async dump. - self._is_sync = False - self._device_target = "Ascend" - self._file_format = "" - self._net_name = "" - self._dump_type = 0 - self._initialize() - - @property - def file_format(self): - """The property of file format.""" - return self._file_format - - @property - def device_target(self): - """The property of device target.""" - return self._device_target - - @property - def dump_dir(self): - """The property of dump directory.""" - return str(self._debugger_base_dir) - - @property - def dump_target(self): - """The property of dump target.""" - return DumpTarget(self._dump_type) - - @property - def rank_dirs(self): - """The property of RankDir.""" - return self._rank_dirs - - def _initialize(self): - """Initialize the data_mode and net_dir of DataLoader.""" - self._load_rank_dirs() - if not self._rank_dirs: - log.error("No rank directory found under %s", str(self._debugger_base_dir)) - raise RankDirNotFound(str(self._debugger_base_dir)) - rank_dir = self._rank_dirs[0].path - dump_config = self._load_json_file(rank_dir / self.DUMP_METADATA / 'data_dump.json') - - def _parse_common_settings(): - nonlocal dump_config - common_settings = dump_config.get(DumpSettings.COMMON_DUMP_SETTINGS.value, {}) - try: - self._net_name = common_settings['net_name'] - self._dump_type = common_settings['input_output'] - self._file_format = common_settings.get('file_format', FileFormat.BIN.value) - except KeyError: - raise DebuggerJsonFileParseError("data_dump.json") - - def _set_dump_mode_and_device_target(): - nonlocal dump_config - config_json = self._load_json_file(rank_dir / self.DUMP_METADATA / 'config.json') - self._device_target = config_json.get('device_target', 'Ascend') - if self._device_target == 'GPU' or dump_config.get(DumpSettings.E2E_DUMP_SETTINGS.value) and \ - dump_config[DumpSettings.E2E_DUMP_SETTINGS.value]['enable']: - self._is_sync = True - else: - self._is_sync = False - - _parse_common_settings() - _set_dump_mode_and_device_target() - - def _load_rank_dirs(self): - """Load rank directories.""" - self._rank_dirs = [] - rank_dirs = self._debugger_base_dir.glob('rank_*') - for rank_dir in rank_dirs: - if not rank_dir.is_dir() or not is_valid_rank_dir_name(rank_dir.name) \ - or not os.path.exists(os.path.join(rank_dir, ".dump_metadata")): - continue - rank_id = int(rank_dir.name.split('_', 1)[-1]) - self._rank_dirs.append(RankDir(rank_id, rank_dir)) - if self._rank_dirs: - self._rank_dirs.sort(key=lambda x: x.rank_id) - - def load_graphs(self, threshold=None): - """ - Load graphs from the debugger_base_dir. - - Args: - threshold (int): Node limit during load graphs. - - Returns: - list, list of graph protos from all ranks. Each item is like: - {'rank_id': int, - 'graph_protos': [GraphProto]} - """ - graph_loader = GraphLoader(threshold) - res = [] - for rank_dir in self._rank_dirs: - rank_id, rank_path = rank_dir.rank_id, rank_dir.path - graphs_dir = rank_path / self.GRAPHS - if not graphs_dir.is_dir(): - log.debug("Directory '%s' doesn't exist.", graphs_dir) - res.append({'rank_id': rank_id, 'graph_protos': []}) - continue - graph_protos = graph_loader.get_graph_protos_from_dir(graphs_dir) - res.append({'rank_id': rank_id, 'graph_protos': graph_protos}) - - return res - - def load_device_info(self): - """Load device_info from dump path.""" - device_info = {} - if not self._rank_dirs: - log.info("No rank directory found under dump path.") - return device_info - rank_dir = self._rank_dirs[0].path - hccl_json = self._load_json_file(rank_dir / '.dump_metadata' / 'hccl.json') - if hccl_json.get('server_list'): - device_info = {'device_target': self._device_target, 'server_list': hccl_json['server_list']} - else: - log.info("Server List info is missing. Set device id same with rank id as default.") - devices = [] - for rank_dir in self._rank_dirs: - rank_id = rank_dir.rank_id - devices.append({'device_id': str(rank_id), 'rank_id': str(rank_id)}) - device_info = {'device_target': self._device_target, - 'server_list': [{'server_id': 'localhost', 'device': devices}]} - return device_info - - @staticmethod - def _load_json_file(file): - """ - Load json file content. - - Args: - file (Path): The Path object. - - Returns: - dict, the json content. - """ - if not file.is_file(): - log.info("File <%s> is missing.", str(file)) - return {} - with file.open() as handler: - try: - return json.load(handler) - except json.decoder.JSONDecodeError as err: - log.warning("Failed to load json file %s. %s", str(file), str(err)) - return {} - - def load_dumped_step(self, rank_id=None): - """ - Load dumped step number in the directory. - - Args: - rank_id (int): The specified rank id to query dumped steps. If None, load all step number. - - Returns: - dict, the dumped step info among all devices. The key is rank_id, - the value is like Dict[int, set[int]]. - """ - def _load_iters_per_rank(net_dir): - res = {} - for graph_dir in net_dir.iterdir(): - graph_id_str = graph_dir.name - if not graph_id_str.isdigit(): - log.warning("Invalid graph dir under net dir:%s", str(net_dir)) - continue - res[int(graph_id_str)] = _load_iters_per_graph(graph_dir) - return res - - def _load_iters_per_graph(graph_dir): - iters = set() - for iteration_dir in graph_dir.iterdir(): - iter_id_str = iteration_dir.name - if not iter_id_str.isdigit(): - log.debug("Ignore iteration dir: %s", str(iteration_dir)) - continue - iters.add(int(iter_id_str)) - return iters - - log.debug("Start to load dumped steps.") - step_num = {} - rank_dirs = [self.get_rank_dir(rank_id)] if rank_id is not None else self._rank_dirs - for rank_dir in rank_dirs: - rank_id, rank_path = rank_dir.rank_id, rank_dir.path - net_path = rank_path / self._net_name - if not net_path.is_dir(): - log.info("No net directory under rank dir: %s", str(rank_dir)) - continue - step_num[rank_id] = _load_iters_per_rank(net_path) - - return step_num - - def get_config_json_data(self): - rank_dir = self._rank_dirs[0].path - return self._load_json_file(rank_dir / self.DUMP_METADATA / 'config.json') - - def get_rank_dir(self, rank_id): - """ - Get the rank directory according to rank_id. - - Args: - rank_id (int): The rank id. - - Returns: - RankDir, the rank dir info. - """ - rank_path = self._debugger_base_dir / f'rank_{rank_id}' - if rank_path.is_dir(): - return RankDir(rank_id, rank_path) - log.error("No rank directory found.") - raise DebuggerParamValueError("Invalid rank_id.") - - def get_step_iter(self, rank_id=None, step=None, root_graph_id=None): - """Get the generator of step path.""" - step_pattern = '[0-9]*' if step is None else step - graph_pattern = '[0-9]*' if root_graph_id is None else root_graph_id - if rank_id is None: - rank_dirs = self._rank_dirs - else: - rank_dirs = [self.get_rank_dir(rank_id)] - for rank_dir in rank_dirs: - step_dirs = rank_dir.path.glob(f'{self._net_name}/{graph_pattern}/{step_pattern}/') - for step_dir in step_dirs: - yield step_dir - - def get_dump_dir(self): - """Get graph_name directory of the data.""" - return str(self._debugger_base_dir) - - def get_sync_flag(self): - """Get the sync flag of the data.""" - return self._is_sync - - def get_net_name(self): - """Get net_name of the data.""" - return self._net_name - - def load_graph_history(self): - """ - Load graph history of all devices. - - Returns: - dict, graph history. The key is rank id, the value is Dict[int, set[int]]. - """ - log.debug("Start to load graph history.") - all_graph_history = {} - for rank_dir in self._rank_dirs: - execution_order_dir = rank_dir.path / self.EXECUTION_ORDER - if not execution_order_dir.is_dir(): - log.warning("Execution order directory %s doesn't exist.", str(execution_order_dir)) - all_graph_history[rank_dir.rank_id] = {} - continue - graph_history = {} - history_pattern = re.compile(r"ms_global_execution_order_graph_(?P\d+).csv") - for item in execution_order_dir.iterdir(): - re_match = re.match(history_pattern, item.name) - if re_match: - history = read_graph_history(item) - graph_history[int(re_match.group('graph_id'))] = history - all_graph_history[rank_dir.rank_id] = graph_history - return all_graph_history - - def has_data(self, step, rank_id=None): - """ - Check if the step has data dumped. - - Args: - step (int): Step id to check. - rank_id (int): The rank id of the step. If None, check same step in all ranks. - - Returns: - bool, has data or not. - """ - rank_dirs = [self.get_rank_dir(rank_id)] if rank_id is not None else self._rank_dirs - for rank_dir in rank_dirs: - rank_id, rank_path = rank_dir.rank_id, rank_dir.path - net_path = rank_path / self._net_name - if not net_path.is_dir(): - log.info("No net directory under rank dir: %s", str(rank_dir)) - return False - for graph_dir in net_path.iterdir(): - target_step_dir = graph_dir / str(step) - if target_step_dir.is_dir(): - return True - return False - - -def read_graph_history(file_path): - """ - Load graph history from file. - - Args: - file_path (str): File path contains the graph execution order info. - - Returns: - set[int], the executed iteration ids of each graph. - """ - with open(file_path, 'r') as handler: - csv_reader = csv.reader(handler) - history = set(int(row[0]) for row in csv_reader) - return history - - -class GraphLoader: - """ - Load graph proto object in control. - - Args: - threshold (int): The node limit for load graphs. If None, there is no limit. - Default: None. - - Raises: - DebuggerNodeTooLarge: When load new graph, the total node count is over node threshold. - """ - def __init__(self, threshold=None): - self._node_limit = threshold - # node number loaded currently - self._total_node_num = 0 - - @staticmethod - def load_graph_from_file(graph_file_path): - """ - Load graph from file. - - Args: - graph_file_path (Path): Graph file path. - - Returns: - GraphProto, the parsed GraphProto object. - """ - with graph_file_path.open('rb') as file_handler: - model_bytes = file_handler.read() - model = ModelProto.FromString(model_bytes) - graph = model.graph - - return graph - - def _add_node_count(self, graph_proto): - """Accumulate node count.""" - if self._node_limit is None: - return - node_cnt = len(graph_proto.parameters) + len(graph_proto.const_vals) + len(graph_proto.node) - self._total_node_num += node_cnt - if self._total_node_num > self._node_limit: - raise DebuggerNodeTooLarge(self._node_limit, self._total_node_num) - - def get_graph_protos_from_dir(self, graphs_dir): - """ - Get graph from graph directory. - - Args: - graphs_dir (Union[Path, str]): The path of graph directory. - - Returns: - list, list of 'GraphProto' object. - """ - graphs_dir = graphs_dir if isinstance(graphs_dir, Path) else Path(graphs_dir) - graph_protos = [] - pre_file_name = "ms_output_trace_code_graph_" - for file_in_device in graphs_dir.iterdir(): - file_name = file_in_device.name - if file_name.startswith(pre_file_name) and file_name.endswith(".pb"): - try: - graph_proto = self.load_graph_from_file(file_in_device) - except DecodeError: - log.warning("Load graph failed. The graph file is invalid.") - return [] - self._add_node_count(graph_proto) - graph_protos.append(graph_proto) - return graph_protos diff --git a/mindinsight/debugger/stream_cache/debugger_graph.py b/mindinsight/debugger/stream_cache/debugger_graph.py deleted file mode 100644 index 0f424d1a..00000000 --- a/mindinsight/debugger/stream_cache/debugger_graph.py +++ /dev/null @@ -1,311 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""This file is used to define the basic graph.""" -from collections import deque -from copy import deepcopy - -from mindinsight.datavisual.data_transform.graph.msgraph import MSGraph -from mindinsight.debugger.common.exceptions.exceptions import \ - DebuggerNodeNotInGraphError -from mindinsight.debugger.common.log import LOGGER as log -from .node_type_identifier import NodeTypeIdentifier - - -def _is_match(identifier, node, condition): - """Check if the node is matched to the identifier. - Args: - identifier (NodeTypeIdentifier): The debug name of the node. - node (Node obj): The number of layers the user wants to trace. Default is 0. - - Returns: - list, a list of the traced tensors' name and node type, - arranged in order from leaf node to root node. - int, the number of output tensors. - """ - if condition: - matched = identifier.is_match(node, condition) - else: - matched = identifier.is_match(node) - return matched - - -class DebuggerGraph(MSGraph): - """The `DebuggerGraph` object provides interfaces to describe a debugger graph.""" - - def __init__(self): - super(DebuggerGraph, self).__init__() - self._root_graph_id = None - self._is_root_graph = True - self._graph_id = None - - def _parse_data(self, proto_data): - super(DebuggerGraph, self)._parse_data(proto_data) - root_name = proto_data.root_name - graph_id_str = proto_data.name.split('_')[-1] - self._is_root_graph = graph_id_str == root_name - self._root_graph_id = int(root_name) if root_name.isdigit() else 0 - - @property - def root_graph_id(self): - """Get the root graph id of current graph.""" - return self._root_graph_id - - @property - def is_root_graph(self): - """Return whether the graph is root graph.""" - return self._is_root_graph - - @property - def leaf_nodes(self): - """Return the leaf nodes.""" - return self._leaf_nodes - - @property - def normal_node_map(self): - """Return the normal_node_map""" - return self._normal_node_map - - @property - def node_id_map_name(self): - """Return the node_id_map_name""" - return self._node_id_map_name - - @property - def const_node_temp_cache(self): - """Return const_node_temp_cache""" - return self._const_node_temp_cache - - @property - def parameter_node_temp_cache(self): - """Return parameter_node_temp_cache""" - return self._parameter_node_temp_cache - - @property - def full_name_map_name(self): - """Return full_name_map_name""" - return self._full_name_map_name - - def get_node_name_by_full_name(self, full_name): - """Get node name by full names.""" - inner_name = self._full_name_map_name.get(full_name, '') - if not inner_name: - log.warning("Node %s does not find the relative inner node name.", full_name) - - return inner_name - - def get_full_name_by_node_name(self, node_name): - """Get full name by node name.""" - if not node_name: - return '' - node = self._normal_node_map.get(node_name) - if not node: - log.error("Node <%s> is not in graph.", node_name) - raise DebuggerNodeNotInGraphError(node_name=node_name) - - return node.full_name - - def get_node_type(self, node_name): - """ - Get the type of the node. - - Args: - node_name (str): The full name of the node with its scope. - - Returns: - str, node type or name_scope. - """ - if not node_name: - return 'name_scope' - node = self._normal_node_map.get(node_name) - if not node: - log.error("Node <%s> is not in graph.", node_name) - raise DebuggerNodeNotInGraphError(node_name=node_name) - - return node.type - - def search_nodes_by_category(self, node_category, condition=None): - """ - Search nodes by type. - - Args: - node_category (TargetTypeEnum): The node type supported in - mindinsight.conditionmgr.condition.TargetTypeEnum. - condition (dict): Search condition. Default: None. - - - activation_func (Union[str, list[str]): The target functions. Used when node_type - is TargetTypeEnum.ACTIVATION. - - search_range (list[Node]): The list of nodes to be searched from. - - Returns: - list[Node], list of nodes. - """ - identifier = NodeTypeIdentifier(node_category.value) - # get search range - condition = {} if condition is None else condition - search_range = condition.pop('search_range', None) - if not search_range: - search_range = self._leaf_nodes.values() - # search match nodes - matched_nodes = [] - for node in search_range: - matched = _is_match(identifier, node, condition) - if matched: - matched_nodes.append(node) - return matched_nodes - - def get_tensor_history(self, node_name, depth=0): - """ - Get the tensor history of a specified node. - - Args: - node_name (str): The debug name of the node. - depth (int): The number of layers the user wants to trace. Default is 0. - - Returns: - list, a list of the traced tensors' name and node type, - arranged in order from leaf node to root node. - int, the number of output tensors. - """ - node = self._leaf_nodes.get(node_name) - tensor_history = self._get_tensor_infos_of_node(node) - cur_outputs_nums = len(tensor_history) - cur_depth = 0 - trace_list = deque([(node, cur_depth)]) - while trace_list: - cur_node, cur_depth = trace_list.popleft() - tensors_info = self._get_input_tensors_of_node(cur_node) - if tensors_info: - tensor_history.extend(tensors_info) - if cur_depth < depth: - for name in cur_node.inputs.keys(): - trace_list.append((self._leaf_nodes[name], cur_depth + 1)) - - return tensor_history, cur_outputs_nums - - @staticmethod - def _get_tensor_infos_of_node(cur_node, slot=None): - """Get tensors info of specified node.""" - tensors_info = [] - if slot is None: - slots = range(cur_node.output_nums) - elif slot >= 0: - slots = [slot] - else: - log.info("Skip get tensor info for %s:%s.", cur_node.name, slot) - return tensors_info - for num in slots: - tensor_info = { - 'name': cur_node.name + ':' + str(num), - 'full_name': cur_node.full_name + ':' + str(num), - 'node_type': cur_node.type - } - tensors_info.append(tensor_info) - - return tensors_info - - def _get_input_tensors_of_node(self, cur_node): - """Get input tensors of node.""" - tensors_info = [] - for name in cur_node.inputs.keys(): - node = self._leaf_nodes.get(name) - tensor_info = self._get_tensor_infos_of_node(node) - tensors_info.extend(tensor_info) - - return tensors_info - - def get_tensor_graph(self, node_name): - """ - Get graph relative to a node. - - Args: - node_name (str): Node name. - - Returns: - dict, tensor graph, format is: - {'nodes': [ - {'name': , - 'full_name': , - 'type': - 'input': , - 'output': , - 'slot': {'id': }, - 'stack_info': [] - } - ]} - """ - graph_nodes = [] - cur_node = self._leaf_nodes.get(node_name) - node_detail_info = cur_node.to_dict() - cur_node_info = self._get_node_info_for_tensor_graph(cur_node) - cur_node_info['input'] = deepcopy(node_detail_info.get('input')) - cur_node_info['output'] = deepcopy(node_detail_info.get('output')) - self._add_input_node_info(cur_node_info=cur_node_info, graph_nodes=graph_nodes) - self._add_output_node_info(cur_node=cur_node, cur_node_info=cur_node_info, graph_nodes=graph_nodes) - graph_nodes.append(cur_node_info) - return {'nodes': graph_nodes} - - @staticmethod - def _get_node_info_for_tensor_graph(node): - """Get node infos for tensor graph.""" - node_info = { - 'name': node.name, - 'full_name': node.full_name, - 'type': node.type, - 'input': {}, - 'output': {}, - 'slots': [{'slot': str(slot)} for slot in range(node.output_nums)], - 'stack_info': node.stack_info - } - return node_info - - def _add_output_node_info(self, cur_node, cur_node_info, graph_nodes): - """ - Add output node info into cur_node_info and node list. - - Args: - cur_node (Node): The current node object. - cur_node_info (dict): Current node info. - graph_nodes (list[]): The nodes in tensor graph. - """ - output_slot_mapping = self._get_slot_mapping(cur_node) - for node_name, edge_info in cur_node_info.get('output').items(): - edge_info['slot_mapping'] = output_slot_mapping - # add output node info into graph - output_node = self._leaf_nodes.get(node_name) - output_node_info = self._get_node_info_for_tensor_graph(output_node) - output_node_info['input'][cur_node.name] = edge_info - graph_nodes.append(output_node_info) - - def _add_input_node_info(self, cur_node_info, graph_nodes): - """ - Add input node info into cur_node_info and node list. - - Args: - cur_node_info (dict): Current node info. - graph_nodes (list[]): The nodes in tensor graph. - """ - cur_node_name = cur_node_info.get('name') - for node_name, edge_info in cur_node_info.get('input').items(): - input_node = self._leaf_nodes.get(node_name) - edge_info['slot_mapping'] = self._get_slot_mapping(input_node) - # add input node info into graph - input_node_info = self._get_node_info_for_tensor_graph(input_node) - input_node_info['output'][cur_node_name] = edge_info - graph_nodes.append(input_node_info) - - @staticmethod - def _get_slot_mapping(input_node): - """Get slot mapping between nodes.""" - return [[str(slot), ''] for slot in range(input_node.output_nums)] diff --git a/mindinsight/debugger/stream_cache/debugger_multigraph.py b/mindinsight/debugger/stream_cache/debugger_multigraph.py deleted file mode 100644 index 55ee0058..00000000 --- a/mindinsight/debugger/stream_cache/debugger_multigraph.py +++ /dev/null @@ -1,102 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""This file is used to define the basic graph.""" -import copy -from mindinsight.debugger.common.log import LOGGER as log -from mindinsight.datavisual.data_transform.graph.node import Node -from ...domain.graph.base import NodeTypeEnum -from .debugger_graph import DebuggerGraph - - -class DebuggerMultiGraph(DebuggerGraph): - """The `DebuggerMultiGraph` object provides interfaces to describe a debugger multigraph.""" - - def add_graph(self, graph_dict): - """ - Add graphs to DebuggerMultiGraph. - - Args: - graph_dict (dict): The dict. - """ - if len(graph_dict) == 1: - graph = list(graph_dict.values())[0] - self._normal_node_map = graph.normal_node_map - self._node_id_map_name = graph.node_id_map_name - self._const_node_temp_cache = graph.const_node_temp_cache - self._parameter_node_temp_cache = graph.parameter_node_temp_cache - self._leaf_nodes = graph.leaf_nodes - self._full_name_map_name = graph.full_name_map_name - else: - for graph_name, graph in graph_dict.items(): - log.debug("add graph %s into whole graph.", graph_name) - - # add nodes - normal_nodes = copy.deepcopy(graph.normal_node_map) - for _, node_obj in normal_nodes.items(): - self._add_graph_scope(node_obj, graph_name) - self._cache_node(node_obj) - - # add graph_node - node = Node(name=graph_name, node_id=graph_name) - node.type = NodeTypeEnum.NAME_SCOPE.value - node.subnode_count = len(graph.list_node_by_scope()) - self._cache_node(node) - - self._leaf_nodes = self._get_leaf_nodes() - self._full_name_map_name = self._get_leaf_node_full_name_map() - - log.info( - "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 - 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) diff --git a/mindinsight/debugger/stream_cache/graph_history.py b/mindinsight/debugger/stream_cache/graph_history.py deleted file mode 100644 index ae33b502..00000000 --- a/mindinsight/debugger/stream_cache/graph_history.py +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""This file is used to define the GraphHistory.""" - - -class GraphHistory: - """Graph history of a device.""" - - def __init__(self, rank_id, graph_history): - self._rank_id = rank_id - # the key is graph id, the value is list of executed graph run id. - self._graph_history = graph_history - self._count = None - - @property - def rank_id(self): - """Return rank id.""" - return self._rank_id - - @property - def history(self): - """Return execution history of all graphs.""" - return self._graph_history - - def clear(self): - """Clear Graph History.""" - self._graph_history = {} - self._count = 0 - - def get_total_count(self): - """Get the last graph run id.""" - if self._count is not None: - return self._count - last_id = -1 - for history in self._graph_history.values(): - if not history: - continue - last_id = max(last_id, max(history)) - self._count = last_id + 1 - return self._count - - def get_run_ids(self, graph_id): - """ - Get executed graph run ids. - - Args: - graph_id (int): The root graph id. - - Returns: - set[int], the list of graph run ids. - """ - return self._graph_history.get(graph_id, set()) diff --git a/mindinsight/debugger/stream_cache/node_type_identifier.py b/mindinsight/debugger/stream_cache/node_type_identifier.py deleted file mode 100644 index 3a41f06b..00000000 --- a/mindinsight/debugger/stream_cache/node_type_identifier.py +++ /dev/null @@ -1,160 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""This file is used to identify the type of the node.""" -import sys - -from mindinsight.domain.graph.base import NodeTypeEnum -from mindinsight.debugger.common.exceptions.exceptions import DebuggerParamValueError - -_ACTIVATIONS = [ - 'elu', - 'fastgelu', - 'gelu', - 'hsigmoid', - 'hswish', - 'leakyrelu', - 'logsigmoid', - 'logsoftmax', - 'prelu', - 'relu', - 'relu6', - 'reluv2', - 'sigmoid', - 'softmax', - 'tanh' -] - - -class NodeTypeIdentifier: - """Node type identifier.""" - - def __init__(self, node_type): - self.identify_func = self.get_identify_func(node_type) - - @staticmethod - def get_identify_func(node_type): - """ - Get the identify function in this module. - - Args: - node_type (str): The node type. - - Returns: - function, the identify function. - """ - # the name of the identity function should start with 'is_' and end with '_node' - target_name = 'is_' + node_type + '_node' - cur_module = sys.modules[__name__] - for sub_module in dir(cur_module): - # the rule to get the identify function - if sub_module == target_name: - return getattr(cur_module, sub_module) - raise DebuggerParamValueError("Invalid identify type.") - - def is_match(self, *args, **kwargs): - """Check if the input match the idenfity function.""" - return self.identify_func(*args, **kwargs) - - -def is_parameter_node(node): - """ - Check if the node is weight type. - - Args: - node (Node): The node object. - - Returns: - bool, if the node is weight type. - """ - return bool(node.type == NodeTypeEnum.PARAMETER.value) - - -def is_weight_node(node): - """ - Check if the node is weight type. - - Args: - node (Node): The node object. - - Returns: - bool, if the node is weight type. - """ - if node.type == NodeTypeEnum.PARAMETER.value: - full_name = node.full_name.lower() - weight_flag = False - if full_name.endswith('.weight') or full_name.endswith('.bias'): - weight_flag = True - if weight_flag and 'optimizer-' not in full_name and not full_name.startswith('gradients/'): - return True - return False - - -def is_activation_node(node, condition=None): - """ - Check if the node is activation type. - - Args: - node (Node): The node object. - condition (dict): Filter condition. - - - activation_func (Union[str, list[str]): The target functions. - - Returns: - bool, if the node is activation type. - """ - activation_funcs = condition.get('activation_func') if condition else _ACTIVATIONS - if not activation_funcs: - activation_funcs = _ACTIVATIONS - if not isinstance(activation_funcs, list): - activation_funcs = [activation_funcs] - - if not is_gradient_node(node): - node_type = node.type - for activation_name in activation_funcs: - if node_type.lower() == activation_name: - return True - return False - - -def is_gradient_node(node): - """ - Check if the node is gradient type. - - Args: - node (Node): The node object. - - Returns: - bool, if the node is gradient type. - """ - full_name = node.full_name.lower() - if (full_name == 'gradients' or full_name.startswith('gradients/')) and \ - node.type not in [NodeTypeEnum.PARAMETER.value, NodeTypeEnum.CONST.value]: - return True - return False - - -def is_tensor_node(node): - """ - Check if the node is tensor type. - - Args: - node (Node): The node object. - - Returns: - bool, if the node is tensor type. - """ - if node is not None: - return True - return False diff --git a/mindinsight/debugger/stream_cache/tensor.py b/mindinsight/debugger/stream_cache/tensor.py deleted file mode 100644 index dba97317..00000000 --- a/mindinsight/debugger/stream_cache/tensor.py +++ /dev/null @@ -1,462 +0,0 @@ -# Copyright 2020-2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""The definition of tensor stream.""" -from abc import abstractmethod, ABC -from enum import Enum - -import numpy as np - -from mindinsight.debugger.common.exceptions.exceptions import DebuggerParamValueError -from mindinsight.debugger.common.log import LOGGER as log -from mindinsight.debugger.common.utils import NUMPY_TYPE_MAP, MAX_SINGLE_TENSOR_CACHE_BYTES -from mindinsight.domain.graph.proto.ms_graph_pb2 import DataType -from mindinsight.utils.tensor import TensorUtils - -NPY_HEADER_LENGTH = 128 - - -class TensorStatusEnum(Enum): - """Tensor status.""" - CACHED = "cached" - UNCACHED = "uncached" - EMPTY = 'empty' - OVERSIZE = "oversize" - - -class DownloadStatusEnum(Enum): - """Tensor status.""" - PENDING = "pending" - SENDING = "sending" - - -class BaseTensor(ABC): - """Tensor data structure.""" - - def __init__(self, step=0): - self._step = step - self._stats = None - - @property - @abstractmethod - def name(self): - """The property of tensor name.""" - - @property - @abstractmethod - def dtype(self): - """The property of tensor dtype.""" - - @property - @abstractmethod - def shape(self): - """The property of tensor shape.""" - - @property - @abstractmethod - def value(self): - """The property of tensor value.""" - - @property - @abstractmethod - def download_size(self): - """The property of download size.""" - - @property - @abstractmethod - def status(self): - """The property of tensor status.""" - - @property - def empty(self): - """If the tensor value is valid.""" - return self.value is None - - @property - def stats(self): - """The property of tensor stats.""" - return self._stats - - @stats.setter - def stats(self, stats): - """ - Update tensor stats. - - Args: - stats (Statistics): Instance of Statistics. - """ - self._stats = stats - - def get_tensor_serializable_value_by_shape(self, shape=None): - """ - Get tensor value info by shape. - - Args: - shape (tuple): The specified range of tensor value. - - Returns: - dict, the specified tensor value and value statistics. - """ - tensor_value = self.get_tensor_value_by_shape(shape) - res = {} - # the type of tensor_value is one of None, np.ndarray or str - if isinstance(tensor_value, np.ndarray): - res['value'] = tensor_value.tolist() - else: - res['value'] = tensor_value - res['statistics'] = self.get_tensor_statistics() - return res - - @abstractmethod - def get_tensor_value_by_shape(self, shape=None): - """Abstract method.""" - - @abstractmethod - def get_tensor_statistics(self): - """Abstract method.""" - - def _to_dict(self): - """Get tensor info in dict format.""" - res = { - 'full_name': self.name, - 'step': self._step, - 'dtype': self.dtype, - 'shape': self.shape, - 'bytes': self.download_size, - 'tensor_status': self.status, - 'has_prev_step': False - } - return res - - def get_basic_info(self): - """Return basic info about tensor info.""" - if self.status == TensorStatusEnum.EMPTY.value: - value = None - else: - value = 'click to view' - res = self._to_dict() - res['value'] = value - return res - - def get_full_info(self, shape=None): - """Get tensor info with value.""" - res = self._to_dict() - value_info = self.get_tensor_serializable_value_by_shape(shape) - res.update(value_info) - return res - - -class OpTensor(BaseTensor): - """ - Tensor data structure for operator Node. - - Args: - tensor_proto (TensorProto): Tensor proto contains tensor basic info. - tensor_content (byte): Tensor content value in byte format. - step (int): The step of the tensor. - """ - max_number_data_show_on_ui = 100000 - - def __init__(self, name, tensor_base=None, tensor_stats=None, tensor_content=None, step=0): - # the type of tensor_proto is TensorProto - super(OpTensor, self).__init__(step) - self._name = name - self._tensor_base = tensor_base - self._shape = tensor_base.get('shape') if tensor_base else [] - self._value = self.to_numpy(tensor_content) - self._download_size = tensor_base.get('data_size') + NPY_HEADER_LENGTH if tensor_base else 0 - self._stats = tensor_stats - self._tensor_comparison = None - self._status = self.get_status() - - @property - def name(self): - """The property of tensor name.""" - return self._name - - @property - def tensor_base(self): - """The property of tensor base.""" - return self._tensor_base - - @property - def step(self): - """The step of the tensor value.""" - return self._step - - @property - def dtype(self): - """The property of tensor dtype.""" - return DataType.Name(self._tensor_base.get('dtype') if self._tensor_base else 0) - - @property - def shape(self): - """The property of tensor shape.""" - dims = list(self._shape) - if dims == [0]: - dims = [] - return dims - - @property - def value(self): - """The property of tensor value.""" - return self._value - - @property - def nbytes(self): - """The property of tensor value.""" - return self._value.nbytes if self._value is not None else 0 - - @property - def download_size(self): - """The property of download size.""" - return self._download_size - - @property - def status(self): - """The property of tensor status.""" - return self._status - - @property - def tensor_comparison(self): - """The property of tensor_comparison.""" - return self._tensor_comparison - - def get_status(self): - """Set the tensor status.""" - res = TensorStatusEnum.EMPTY.value if self.tensor_base is None or self.tensor_base.get( - 'data_size') == 0 else TensorStatusEnum.OVERSIZE.value if self.tensor_base.get( - 'data_size') >= MAX_SINGLE_TENSOR_CACHE_BYTES else TensorStatusEnum.UNCACHED.value - return res if self.value is None else TensorStatusEnum.CACHED.value - - def calculate_stats(self): - """Calculate the tensor statistics.""" - self._stats = TensorUtils.get_statistics_from_tensor(self._value) - - def clean_tensor_value(self, oversize=True, remain_scalar=False): - """Clean the tensor.""" - if oversize: - self._status = TensorStatusEnum.OVERSIZE.value - if remain_scalar and not self.shape and self._status != TensorStatusEnum.EMPTY.value: - return - self._value = None - if self._status == TensorStatusEnum.CACHED.value: - self._status = TensorStatusEnum.UNCACHED.value - - def to_numpy(self, tensor_content): - """ - Construct tensor content from byte to numpy. - - Args: - tensor_content (byte): The tensor content. - - Returns: - Union[None, np.ndarray], the value of the tensor. - """ - tensor_value = None - if tensor_content: - np_type = NUMPY_TYPE_MAP.get(self.dtype) - tensor_value = np.frombuffer(tensor_content, dtype=np_type) - tensor_value = tensor_value.reshape(self.shape) - return tensor_value - - def get_tensor_statistics(self): - """ - Get Tensor statistics. - - Returns: - dict, overall statistics. - """ - if self.stats: - return TensorUtils.get_overall_statistic_dict(self.stats) - if self.empty: - return {} - self.stats = TensorUtils.get_statistics_from_tensor(self.value) - return TensorUtils.get_overall_statistic_dict(self.stats) - - def update_tensor_comparisons(self, tensor_comparison): - """ - Update tensor comparison for tensor. - - Args: - tensor_comparison (TensorComparison) instance of TensorComparison. - - """ - self._tensor_comparison = tensor_comparison - - def get_tensor_value_by_shape(self, shape=None): - """ - Get tensor value by shape. - - Args: - shape (tuple): The specified shape. - - Returns: - Union[None, str, numpy.ndarray], the value of parsed tensor. - """ - if self._status == TensorStatusEnum.OVERSIZE.value: - log.info("%s is too large to show on UI.", self.name) - return "Too large to show on UI." - if self._value is None: - log.warning("%s has no value yet.", self.name) - return None - if shape is None or not isinstance(shape, tuple): - log.info("Get the whole tensor value with shape is %s", shape) - return self._value - if len(shape) != len(self.shape): - log.error("Invalid shape. Received: %s, tensor shape: %s", shape, self.shape) - raise DebuggerParamValueError("Invalid shape. Shape unmatched.") - try: - value = self._value[shape] - except IndexError as err: - log.error("Invalid shape. Received: %s, tensor shape: %s", shape, self.shape) - log.exception(err) - raise DebuggerParamValueError("Invalid shape. Shape unmatched.") - if isinstance(value, np.ndarray): - if value.size > self.max_number_data_show_on_ui: - log.info("The tensor size is %d, which is too large to show on UI.", value.size) - value = "Too large to show." - else: - value = np.asarray(value) - return value - - -class ConstTensor(BaseTensor): - """Tensor data structure for Const Node.""" - _STRING_TYPE = 'DT_STRING' - _DT_TYPE = 'DT_TYPE' - - def __init__(self, const_proto): - # the type of const_proto is NamedValueProto - super(ConstTensor, self).__init__() - self._const_proto = const_proto - self._value = self.generate_value_from_proto(const_proto.value) - self._status = TensorStatusEnum.CACHED.value if self._value is not None else TensorStatusEnum.EMPTY.value - self._stats = None - self._tensor_base = {'dtype': DataType.Name(self._const_proto.value.dtype), - 'shape': [], - 'data_size': self.nbytes} - - def set_step(self, step): - """Set step value.""" - self._step = step - - @property - def name(self): - """The property of tensor name.""" - return self._const_proto.key + ':0' - - @property - def full_name(self): - """The property of tensor full name.""" - return self._const_proto.full_name + ':0' - - @property - def dtype(self): - """The property of tensor dtype.""" - return DataType.Name(self._const_proto.value.dtype) - - @property - def shape(self): - """The property of tensor shape.""" - return [] - - @property - def value(self): - """The property of tensor shape.""" - return self._value - - @property - def status(self): - """The property of tensor status.""" - return self._status - - @property - def download_size(self): - """The property of download size.""" - return self.nbytes - - @property - def tensor_base(self): - """The property of tensor_base.""" - return self._tensor_base - - @property - def nbytes(self): - """The property of tensor size.""" - return self._value.nbytes if self._value is not None else 0 - - def generate_value_from_proto(self, tensor_proto): - """ - Generate tensor value from proto. - - Args: - tensor_proto (TensorProto): The tensor proto. - - Returns: - Union[None, str, np.ndarray], the value of the tensor. - """ - fields = tensor_proto.ListFields() - if len(fields) != 2: - log.warning("Unexpected const proto <%s>.\n Please check offline.", tensor_proto) - tensor_value = None - for field_obj, field_value in fields: - if field_obj.name != 'dtype': - if tensor_proto.dtype == DataType.DT_TUPLE: - tensor_values = [] - for field_value_element in field_value: - value_element = self.generate_value_from_proto(field_value_element) - tensor_values.append(value_element) - tensor_value = tensor_values - elif tensor_proto.dtype == DataType.DT_TYPE: - tensor_value = DataType.Name(field_value.data_type) - else: - tensor_value = field_value - break - if tensor_value is not None and tensor_proto.dtype != self._STRING_TYPE: - tensor_value = np.array(tensor_value, dtype=NUMPY_TYPE_MAP.get(tensor_proto.dtype)) - return tensor_value - - def get_tensor_value_by_shape(self, shape=None): - """ - Get tensor value by shape. - - Args: - shape (tuple): The specified shape. - - Returns: - Union[None, str, int, float], the value of parsed tensor. - """ - if shape: - log.warning("Invalid shape for const value.") - return self._value - - def calculate_stats(self): - """Calculate the tensor statistics.""" - if not (self.empty or self.dtype == self._STRING_TYPE or self.dtype == self._DT_TYPE): - self._stats = TensorUtils.get_statistics_from_tensor(self._value) - - def get_tensor_statistics(self): - """ - Get Tensor statistics. - - Returns: - dict, overall statistics. - """ - self.calculate_stats() - if self.empty or self.dtype == self._STRING_TYPE or self.dtype == self._DT_TYPE: - log.debug("The tensor dtype is: %s, skip getting statistics.", self.dtype) - return {} - statistics = TensorUtils.get_overall_statistic_dict(self._stats) - return statistics diff --git a/mindinsight/debugger/stream_cache/watchpoint.py b/mindinsight/debugger/stream_cache/watchpoint.py deleted file mode 100644 index 6c76fa98..00000000 --- a/mindinsight/debugger/stream_cache/watchpoint.py +++ /dev/null @@ -1,371 +0,0 @@ -# Copyright 2020-2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Define the watchpoint stream.""" - -import copy - -from mindinsight.debugger.common.exceptions.exceptions import DebuggerParamValueError -from mindinsight.debugger.common.log import LOGGER as log -from mindinsight.debugger.common.utils import is_scope_type, is_cst_type -from mindinsight.debugger.conditionmgr.conditionmgr import ConditionMgr -from mindinsight.debugger.conditionmgr.common.utils import NodeBasicInfo -from mindinsight.debugger.conditionmgr.condition import ConditionIdEnum -from mindinsight.debugger.proto.debug_grpc_pb2 import WatchCondition - -WATCHPOINT_CONDITION_MAPPING = { - ConditionIdEnum.ACTIVATION_RANGE.value: WatchCondition.Condition.tensor_range, - ConditionIdEnum.GRADIENT_EXPLODING.value: WatchCondition.Condition.tensor_general_overflow, - ConditionIdEnum.GRADIENT_TOO_LARGE.value: WatchCondition.Condition.tensor_too_large, - ConditionIdEnum.GRADIENT_VANISHING.value: WatchCondition.Condition.tensor_too_small, - ConditionIdEnum.OPERATOR_OVERFLOW.value: WatchCondition.Condition.overflow, - ConditionIdEnum.TENSOR_ALL_ZERO.value: WatchCondition.Condition.tensor_all_zero, - ConditionIdEnum.TENSOR_OVERFLOW.value: WatchCondition.Condition.tensor_general_overflow, - ConditionIdEnum.TENSOR_RANGE.value: WatchCondition.Condition.tensor_range, - ConditionIdEnum.TENSOR_TOO_LARGE.value: WatchCondition.Condition.tensor_too_large, - ConditionIdEnum.TENSOR_TOO_SMALL.value: WatchCondition.Condition.tensor_too_small, - ConditionIdEnum.WEIGHT_CHANGE_TOO_LARGE.value: WatchCondition.Condition.tensor_change_too_large, - ConditionIdEnum.WEIGHT_CHANGE_TOO_SMALL.value: WatchCondition.Condition.tensor_change_too_small, - ConditionIdEnum.WEIGHT_INITIALIZATION.value: WatchCondition.Condition.tensor_initialization, - ConditionIdEnum.WEIGHT_NOT_CHANGED.value: WatchCondition.Condition.tensor_not_changed, - ConditionIdEnum.WEIGHT_OVERFLOW.value: WatchCondition.Condition.tensor_general_overflow, - ConditionIdEnum.WEIGHT_TOO_LARGE.value: WatchCondition.Condition.tensor_too_large, - ConditionIdEnum.WEIGHT_TOO_SMALL.value: WatchCondition.Condition.tensor_too_small -} - - -class WatchNodeTree: - """The WatchNode Node Structure.""" - INVALID = -1 # the scope node and the nodes below are invalid - NOT_WATCH = 0 # the scope node and the nodes below are not watched - PARTIAL_WATCH = 1 # at least one node under the scope node is not watched - TOTAL_WATCH = 2 # the scope node and the nodes below are all watched - - def __init__(self, node_name='', node_type=None, full_name='', watch_status=1): - self._node_name = node_name - self._full_name = full_name - self._node_type = self._translate_node_type(node_type) - self._watch_status = watch_status - self._children = {} - - @property - def node_name(self): - """The property of node name.""" - return self._node_name - - @property - def full_name(self): - """The property of node name.""" - return self._full_name - - @property - def node_type(self): - """The property of node type.""" - return self._node_type - - @node_type.setter - def node_type(self, value): - """Set the node type.""" - self._node_type = self._translate_node_type(value) - - @property - def watch_status(self): - """The property of watch status about current node.""" - return self._watch_status - - @watch_status.setter - def watch_status(self, value): - """Set the node watch_status.""" - self._watch_status = value - - def update_metadata(self, node_type, full_name, watch_status): - """Update the metadata for watched node.""" - self._full_name = full_name - self._node_type = self._translate_node_type(node_type) - self._watch_status = watch_status - - @staticmethod - def _translate_node_type(node_type): - """Translate node type to watch node type.""" - flag = node_type - if not node_type or is_scope_type(node_type): - flag = 'scope' - return flag - - def get(self, sub_name): - """Get sub node.""" - return self._children.get(sub_name) - - def get_children(self): - """Get all children.""" - for name_scope, sub_watch_node in self._children.items(): - yield name_scope, sub_watch_node - - def get_children_count(self): - """Get the count of children nodes.""" - return len(self._children) - - def add_node(self, node_name, node_type, full_name=''): - """ - Add watch node to watch node tree. - - Args: - node_name (str): The node name. - node_type (str): The node type. - full_name (str): The full name of node. - """ - log.debug("Add node %s with type: %s, full_name: %s", node_name, node_type, full_name) - scope_names = node_name.split('/', 1) - if len(scope_names) == 1: - target_node = self.get(node_name) - if not target_node: - self.add(node_name, node_type, full_name, watch_status=WatchNodeTree.TOTAL_WATCH) - else: - target_node.update_metadata(node_type, full_name, WatchNodeTree.TOTAL_WATCH) - return - - scope_name, sub_names = scope_names - sub_tree = self.get(scope_name) - if not sub_tree: - sub_tree = self.add(scope_name, watch_status=1) - sub_tree.add_node(sub_names, node_type, full_name) - - def add(self, name, node_type=None, full_name='', watch_status=1): - """Add sub WatchPointTree.""" - sub_name = '/'.join([self._node_name, name]) if self._node_name else name - sub_tree = WatchNodeTree(sub_name, node_type, full_name, watch_status) - self._children[name] = sub_tree - - return sub_tree - - def remove_node(self, node_name): - """Remove sub node from current tree.""" - log.debug("Remove %s", node_name) - scope_names = node_name.split('/', 1) - sub_tree_name = scope_names[0] - sub_tree = self._children.get(sub_tree_name) - if not sub_tree: - log.error("Failed to find node %s in WatchNodeTree.", sub_tree_name) - raise DebuggerParamValueError("Failed to find node {}".format(sub_tree_name)) - - if len(scope_names) > 1: - sub_tree.remove_node(scope_names[1]) - - if sub_tree.watch_status == WatchNodeTree.NOT_WATCH or len(scope_names) == 1: - self._children.pop(sub_tree_name) - - self._watch_status = WatchNodeTree.PARTIAL_WATCH if self._children else \ - WatchNodeTree.NOT_WATCH - - -class Watchpoint: - """ - The class of watchpoint stream. - - Args: - watchpoint_id (int): The id of Watchpoint. - watch_condition (dict): The condition of Watchpoint. - - - condition (str): Accept `INF` or `NAN`. - - param (list[float]): Not defined yet. - """ - - def __init__(self, watchpoint_id, watch_condition, name=None): - self._id = watchpoint_id - self._condition = watch_condition - self._watch_node = {0: WatchNodeTree()} - self.name = name - - @property - def watchpoint_id(self): - """The property of watchpoint id.""" - return self._id - - @property - def nodes(self): - """The property of watch nodes.""" - return self._watch_node - - @property - def condition(self): - """The property of watch condition.""" - return self._condition - - def copy_nodes_from(self, other_watchpoint, deep_copy=False): - """ - Copy nodes from other watchpoint. - Args: - other_watchpoint (Watchpoint): Other watchpoint. - deep_copy (bool): Whether using deepcopy. - """ - if deep_copy: - self._watch_node = copy.deepcopy(other_watchpoint.nodes) - else: - self._watch_node = other_watchpoint.nodes - - def add_nodes(self, nodes, rank_id): - """Add node into watchpoint.""" - if not nodes: - log.warning("Add empty nodes.") - return - if rank_id not in self._watch_node: - self._watch_node[rank_id] = WatchNodeTree() - if not isinstance(nodes, list): - nodes = [nodes] - for node in nodes: - watch_node = self._watch_node.get(rank_id) - watch_node.add_node(node.name, node.type, node.full_name) - - def remove_nodes(self, nodes, rank_id): - """Remove nodes from watchpoint.""" - if not nodes: - return - self.validate_rank_id(rank_id) - if not isinstance(nodes, list): - nodes = [nodes] - for node in nodes: - self._watch_node.get(rank_id).remove_node(node.name) - - def get_node_status(self, node_name, node_type, full_name, rank_id): - """Judge if the node is in watch nodes.""" - if is_cst_type(node_type): - return WatchNodeTree.INVALID - scope_names = node_name.split('/') - self.validate_rank_id(rank_id) - cur_node = self._watch_node.get(rank_id) - status = 1 - for scope_name in scope_names: - cur_node = cur_node.get(scope_name) - if cur_node is None: - status = WatchNodeTree.NOT_WATCH - break - if cur_node.watch_status == WatchNodeTree.TOTAL_WATCH: - status = WatchNodeTree.TOTAL_WATCH - break - if status == WatchNodeTree.TOTAL_WATCH and cur_node.node_name != node_name: - self._watch_node.get(rank_id).add_node(node_name, node_type, full_name) - - return status - - def _get_watch_node(self, cur_watch_node, watch_node_list): - """ - Traverse the watch nodes and add total watched node list to `watch_node_list`. - - Args: - cur_watch_node (WatchNodeTree): The current watch node. - watch_node_list (list[NodeBasicInfo]): The list of watch node basic infos. - """ - if cur_watch_node.watch_status == WatchNodeTree.TOTAL_WATCH: - node_info = NodeBasicInfo(name=cur_watch_node.node_name, - full_name=cur_watch_node.full_name, - type=cur_watch_node.node_type) - watch_node_list.append(node_info) - return - for _, watch_node in cur_watch_node.get_children(): - self._get_watch_node(watch_node, watch_node_list) - - def get_watch_nodes(self): - """ - Get the name of all total watched nodes. - - Returns: - list[NodeBasicInfo], the list of watch node basic infos. - """ - watch_nodes_for_devices = {} - for rank_id, watch_node_tree in self._watch_node.items(): - watch_nodes = [] - self._get_watch_node(watch_node_tree, watch_nodes) - watch_nodes_for_devices[rank_id] = watch_nodes - return watch_nodes_for_devices - - def add_set_cmd_detail(self, set_cmd, watch_nodes_for_devices): - """Return the watchpoint in proto format.""" - # construct SetCMD - condition_id = self._condition.get('id') - set_cmd.id = self._id - set_cmd.delete = False - set_cmd.watch_condition.condition = WATCHPOINT_CONDITION_MAPPING.get(condition_id) - condition_mgr = ConditionMgr() - condition = condition_mgr.get_condition(condition_id) - param_dict = { - param.get('name'): param for param in self._condition.get('params') - } - for param_name in condition.ordered_parameter_names: - param = param_dict.get(param_name) - if param: - param_proto = set_cmd.watch_condition.params.add() - param_proto.name = param.get('name') - param_proto.value = param.get('value') - param_proto.disabled = False - # Only one parameter of condition in old mindspore version. - set_cmd.watch_condition.value = param.get('value') - else: - param_proto = set_cmd.watch_condition.params.add() - param_proto.name = param_name - param_proto.disabled = True - - for rank_id, watch_nodes in watch_nodes_for_devices.items(): - for watch_node in watch_nodes: - event_node = set_cmd.watch_nodes.add() - event_node.graph_name = watch_node.name.split('/', 1)[0] - event_node.node_name = watch_node.full_name - event_node.node_type = watch_node.type - event_node.rank_id = rank_id - - def get_watch_condition_info(self): - """Get watch condition info.""" - watchpoint_info = { - 'id': self._id, - 'watch_condition': self._condition - } - if self.name: - watchpoint_info['name'] = self.name - return watchpoint_info - - def validate_rank_id(self, rank_id): - """Validate the rank id.""" - if rank_id not in self._watch_node: - log.warning("Rank_id not exist") - return - - -class WatchpointHit: - """The watchpoint hit structure.""" - - def __init__(self, tensor_proto, watchpoint, node_name, graph_name): - self._full_name = tensor_proto.node_name - self._watchpoint = watchpoint - self.node_name = node_name - self.slot = tensor_proto.slot - self.graph_name = graph_name - self.error_code = 0 - - @property - def tensor_full_name(self): - """The property of tensor full name.""" - tensor_name = ':'.join([self._full_name, self.slot]) - return tensor_name - - @property - def watchpoint(self): - """The property of watchpoint.""" - watchpoint = self._watchpoint.get_watch_condition_info() - return watchpoint - - def __eq__(self, other): - """Define the equal condition.""" - flag = self.tensor_full_name == other.tensor_full_name \ - and self.watchpoint == other.watchpoint \ - and self.graph_name == other.graph_name - return flag diff --git a/mindinsight/debugger/stream_handler/__init__.py b/mindinsight/debugger/stream_handler/__init__.py deleted file mode 100644 index 284e6a6f..00000000 --- a/mindinsight/debugger/stream_handler/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2020-2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Import the streams handlers.""" -from .event_handler import EventHandler -from .metadata_handler import MetadataHandler -from .graph_handler import GraphHandler, MultiCardGraphHandler -from .tensor_handler import TensorHandler, MultiCardTensorHandler -from .watchpoint_handler import WatchpointHandler, WatchpointHitHandler, MultiCardWatchpointHitHandler - -__all__ = ['EventHandler', 'MetadataHandler', 'GraphHandler', 'TensorHandler', 'WatchpointHitHandler', - 'MultiCardGraphHandler', 'MultiCardTensorHandler', - 'WatchpointHandler', 'MultiCardWatchpointHitHandler'] diff --git a/mindinsight/debugger/stream_handler/base_handler.py b/mindinsight/debugger/stream_handler/base_handler.py deleted file mode 100644 index d57c4442..00000000 --- a/mindinsight/debugger/stream_handler/base_handler.py +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Define the stream handler base.""" -from abc import abstractmethod - - -class StreamHandlerBase: - """The stream handler base.""" - - @abstractmethod - def put(self, value): - """Abstract method of set data.""" - return NotImplementedError - - @abstractmethod - def get(self, filter_condition): - """Abstract method of get data.""" - return NotImplementedError - - def clean(self): - """Clean cache.""" - self.__init__() diff --git a/mindinsight/debugger/stream_handler/device_handler.py b/mindinsight/debugger/stream_handler/device_handler.py deleted file mode 100644 index 9af7ec3b..00000000 --- a/mindinsight/debugger/stream_handler/device_handler.py +++ /dev/null @@ -1,192 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Define the Device stream handler.""" -from collections import defaultdict - -from mindinsight.debugger.common.exceptions.exceptions import DebuggerParamValueError, DeviceIdUnregistered, \ - DebuggerParamTypeError -from mindinsight.debugger.common.log import LOGGER as log -from mindinsight.debugger.stream_handler.base_handler import StreamHandlerBase - - -class DeviceHandler(StreamHandlerBase): - """Metadata Handler.""" - - def __init__(self): - # contains all device infos, the format is like Dict[int(, )] - self._rank_info = defaultdict(DeviceInfo) - self._device_rank_map = {} - - @property - def rank_ids(self): - """The rank ids.""" - return list(self._rank_info) - - @property - def device_amount(self): - """The rank ids.""" - return len(self._rank_info) - - def put(self, value): - """ - Put value into device info cache. - - Args: - value (list): The list of server info. Each item is format like: - { - "server_id": str, - "device": list[] - }, - The format of is like: - { - "device_id": str, - "device_ip": str, - "rank_id": str - }. - """ - if not isinstance(value, list): - log.error("Invalid input type. list object is expected.") - raise DebuggerParamTypeError("List object is expected.") - try: - self._extract_rank_info(value) - except (TypeError, ValueError) as err: - log.exception(err) - log.error("Invalid Device info.") - raise DebuggerParamValueError("Invalid device info.") - log.debug("Put Device into cache") - - def _extract_rank_info(self, value): - """Extract rank info and save.""" - for server_info in value: - server_ip = server_info.get('server_id') - for device_info in server_info.get('device', []): - rank_id = int(device_info.get('rank_id')) - if rank_id in self._rank_info: - log.error("Repeated rank info for rank_id: %d", rank_id) - raise DebuggerParamValueError("Repeated rank info.") - device_info_obj = self._rank_info[rank_id] - device_info_obj.rank_id = rank_id - device_info_obj.server_ip = server_ip - device_info_obj.device_id = int(device_info.get('device_id')) - device_info_obj.device_ip = device_info.get('device_ip') - self._device_rank_map[device_info_obj.device_id] = rank_id - - def add_step_num_info(self, step_info): - """ - Add step number information for each rank. - - Args: - step_info (dict): Step info per rank. The key is the rank id, the value - is the relative step number. - """ - if not step_info: - log.warning("No step number information.") - return - for rank_id, step_num in step_info.items(): - self._rank_info[rank_id].step_num = step_num - - def add_graph_name_info(self, graphs): - """ - Add graph name per device. - - Args: - graphs (dict): Graph infos of all rank id. Each item is format like - """ - for rank_id, graph_info in graphs.items(): - graph_names = list(graph_info) - if len(graph_names) > 1: - # if more than one graphs in a device, sort them - # by the number following the last "_" in the graph_name - graph_names = sorted(graph_names, key=lambda x: x.split("_")[-1]) - self._rank_info[rank_id].graph_names = graph_names - - def get(self, filter_condition=None): - """ - Get device information according to filter_condition. - - Args: - filter_condition (list): The rank id. - - Returns: - dict, the device info. - """ - if filter_condition is None: - filter_condition = self.rank_ids - if not isinstance(filter_condition, list): - filter_condition = [filter_condition] - device_infos = [] - for rank_id in filter_condition: - device_info = self._rank_info.get(rank_id) - if device_info is None: - log.error("Invalid rank id.") - raise DeviceIdUnregistered(rank_id) - device_infos.append(device_info.to_dict()) - return {'devices': device_infos} - - def get_rank_id_by_device_id(self, device_id): - """ - Get rank id by device id. - - Args: - device_id (int): The device id. - - Returns: - int, the rank id. - """ - rank_id = self._device_rank_map.get(device_id) - if rank_id is None: - log.error("Failed to find rank_id for device_id %s", device_id) - raise DeviceIdUnregistered(device_id) - return rank_id - - def get_device_id_by_rank_id(self, rank_id): - """ - Get device id by rank id. - - Args: - rank_id (int): The rank id. - - Returns: - int, the device id. - """ - device_info = self._rank_info.get(rank_id) - if device_info: - return device_info.device_id - log.error("Failed to find device id according to rank_id %s", rank_id) - raise DeviceIdUnregistered(rank_id) - - -class DeviceInfo: - """Device info object.""" - - def __init__(self): - self.rank_id = 0 - self.device_id = 0 - self.server_ip = '' - self.graph_names = [] - self.device_ip = '' - self.step_num = 0 - - def to_dict(self): - """Convert device info to dict.""" - res = { - 'rank_id': self.rank_id, - 'server_ip': self.server_ip, - 'device_id': self.device_id, - 'device_ip': self.device_ip, - 'graph_names': self.graph_names, - 'total_step_num': self.step_num - } - return res diff --git a/mindinsight/debugger/stream_handler/event_handler.py b/mindinsight/debugger/stream_handler/event_handler.py deleted file mode 100644 index d9419a51..00000000 --- a/mindinsight/debugger/stream_handler/event_handler.py +++ /dev/null @@ -1,161 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Define the message handler.""" -import uuid -from queue import Queue, Empty -from threading import Lock - -from mindinsight.debugger.common.exceptions.exceptions import DebuggerParamValueError -from mindinsight.debugger.common.log import LOGGER as log -from mindinsight.debugger.stream_handler.base_handler import StreamHandlerBase - - -class EventHandler(StreamHandlerBase): - """Message Handler.""" - - max_limit = 1000 # the max number of items in cache - - def __init__(self): - self._prev_flag = str(uuid.uuid4()) - self._cur_flag = str(uuid.uuid4()) - self._next_idx = 0 - self._event_cache = [None] * self.max_limit - self._pending_requests = {} - self._lock = Lock() - - @property - def next_pos(self): - """The next pos to be updated in cache.""" - return ':'.join([self._cur_flag, str(self._next_idx)]) - - def has_pos(self, pos): - """Get the event according to pos.""" - cur_flag, cur_idx = self._parse_pos(pos) - if cur_flag not in [self._cur_flag, self._prev_flag]: - cur_flag, cur_idx = self._cur_flag, 0 - event = self._event_cache[cur_idx] - if event is not None: - if not cur_flag or (cur_flag == self._cur_flag and cur_idx < self._next_idx) or \ - (cur_flag == self._prev_flag and cur_idx >= self._next_idx): - return event - - return None - - def clean(self): - """Clean event cache.""" - with self._lock: - self._prev_flag = str(uuid.uuid4()) - self._cur_flag = str(uuid.uuid4()) - self._next_idx = 0 - self._event_cache = [None] * self.max_limit - value = {'metadata': {'pos': '0'}} - self.clean_pending_requests(value) - log.debug("Clean event cache. %d request is waiting.", len(self._pending_requests)) - - def put(self, value): - """ - Put value into event_cache. - - Args: - value (dict): The event to be put into cache. - """ - if not isinstance(value, dict): - log.error("Dict type required when put event message.") - raise DebuggerParamValueError("Dict type required when put event message.") - - with self._lock: - log.debug("Put the %d-th message into queue. \n %d requests is waiting.", - self._next_idx, len(self._pending_requests)) - cur_pos = self._next_idx - # update next pos - self._next_idx += 1 - if self._next_idx >= self.max_limit: - self._next_idx = 0 - self._prev_flag = self._cur_flag - self._cur_flag = str(uuid.uuid4()) - # set next pos - if not value.get('metadata'): - value['metadata'] = {} - value['metadata']['pos'] = self.next_pos - self._event_cache[cur_pos] = value - # feed the value for pending requests - self.clean_pending_requests(value) - - def clean_pending_requests(self, value): - """Clean pending requests.""" - for _, request in self._pending_requests.items(): - request.put(value) - self._pending_requests = {} - - def get(self, filter_condition=None): - """ - Get the pos-th value from event_cache according to filter_condition. - - Args: - filter_condition (str): The index of event in cache. Default: None. - - Returns: - object, the pos-th event. - """ - flag, idx = self._parse_pos(filter_condition) - cur_id = str(uuid.uuid4()) - with self._lock: - # reset the pos after the cache is re-initialized. - if not flag or flag not in [self._cur_flag, self._prev_flag]: - idx = 0 - # get event from cache immediately - if idx != self._next_idx and self._event_cache[idx]: - return self._event_cache[idx] - # wait for the event - cur_queue = Queue(maxsize=1) - self._pending_requests[cur_id] = cur_queue - # block until event has been received - event = self._wait_for_event(cur_id, cur_queue, filter_condition) - - return event - - def _parse_pos(self, pos): - """Get next pos according to input position.""" - elements = pos.split(':') - try: - idx = int(elements[-1]) - except ValueError: - log.error("Invalid index. The index in pos should be digit but get pos:%s", pos) - raise DebuggerParamValueError("Invalid pos.") - - if idx < 0 or idx >= self.max_limit: - log.error("Invalid index. The index in pos should between [0, %d)", self.max_limit) - raise DebuggerParamValueError(f"Invalid pos. {idx}") - flag = elements[0] if len(elements) == 2 else '' - - return flag, idx - - def _wait_for_event(self, cur_id, cur_queue, pos): - """Wait for the pos-th event.""" - try: - # set the timeout to 25 seconds which is less the the timeout limit from UI - event = cur_queue.get(timeout=25) - except Empty: - event = None - - if event is None: - with self._lock: - if self._pending_requests.get(cur_id): - self._pending_requests.pop(cur_id) - log.debug("Clean timeout request. Left pending requests: %d", - len(self._pending_requests)) - event = {'metadata': {'pos': pos}} - - return event diff --git a/mindinsight/debugger/stream_handler/graph_handler.py b/mindinsight/debugger/stream_handler/graph_handler.py deleted file mode 100644 index 199cdf22..00000000 --- a/mindinsight/debugger/stream_handler/graph_handler.py +++ /dev/null @@ -1,699 +0,0 @@ -# Copyright 2020-2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Define the graph stream handler.""" -from collections import defaultdict -from dataclasses import dataclass, field -from typing import List - -from mindinsight.debugger.common.exceptions.exceptions import DebuggerParamValueError, \ - DebuggerNodeNotInGraphError, DebuggerGraphNotExistError -from mindinsight.debugger.common.log import LOGGER as log -from mindinsight.debugger.common.utils import is_scope_type -from mindinsight.debugger.conditionmgr.common.utils import NodeBasicInfo -from mindinsight.debugger.conditionmgr.condition import TargetTypeEnum as CategoryTypeEnum -from mindinsight.debugger.stream_cache.debugger_graph import DebuggerGraph -from mindinsight.debugger.stream_cache.debugger_multigraph import DebuggerMultiGraph -from mindinsight.debugger.stream_handler.base_handler import StreamHandlerBase -from mindinsight.debugger.stream_handler.source_handler import validate_stack_pattern, SourceHandler -from mindinsight.domain.graph.query import StackQuery - - -class MultiCardGraphHandler(StreamHandlerBase): - """Multi-card Graph Handler.""" - - def __init__(self): - self._graph_handlers = {} - self._source_handler = SourceHandler() - - @property - def graph_handlers(self): - """The property of whole_graph.""" - return self._graph_handlers - - @property - def source_handler(self): - """The property of source handler.""" - return self._source_handler - - def get_graph_handler_by_rank_id(self, rank_id=0): - """Get handler by rank id.""" - if rank_id in self._graph_handlers: - return self._graph_handlers.get(rank_id) - if rank_id == 0: - # ms side still using device id instead of rank id, so the first rank_id is not 0 - for graph_handler in self._graph_handlers.values(): - return graph_handler - log.error("There is no rank id %d.", rank_id) - raise ValueError - - def put(self, value): - """Put graphs into graph_handlers.""" - for rank_id, graph in value.items(): - if rank_id not in self._graph_handlers: - self._graph_handlers[rank_id] = GraphHandler() - self._graph_handlers[rank_id].put(graph) - - def parse_stack_infos(self): - """Add stack infos into cache.""" - source_handler = self._source_handler - for graph_stream in self._graph_handlers.values(): - for leaf_node in graph_stream.leaf_nodes.values(): - source_handler.put(leaf_node.stack) - self._source_handler.sort() - - def get(self, filter_condition=None): - """Get the graph of specific node for specific device.""" - if not self._graph_handlers: - log.warning('There is no graph received yet.') - return {'graph': {}} - - def _get_first_rank_id(): - rank_ids = list(self._graph_handlers.keys()) - rank_ids.sort() - return rank_ids[0] - if not filter_condition or not filter_condition.get('rank_id'): - rank_id = _get_first_rank_id() - else: - rank_id = filter_condition.get('rank_id') - if rank_id in self._graph_handlers: - return self._graph_handlers.get(rank_id).get(filter_condition) - log.error("There is no rank id %d.", rank_id) - raise ValueError - - def has_graph(self): - """check if has graph""" - for graph_handler in self._graph_handlers.values(): - if graph_handler.graph_names: - return True - return False - - def register_graph_handler(self, rank_id, graph_handler): - """Register graph handler.""" - self._graph_handlers[rank_id] = graph_handler - - def clean(self): - """Clean cache.""" - self.__init__() - - def validate_rank_id(self, rank_id): - """Judge if the rank_id is valid""" - return rank_id in self._graph_handlers - - -@dataclass -class RootGraph: - """The RootGraph data class.""" - graph_name: str = '' - sub_graph_names: List[str] = field(default_factory=list) - - -class GraphHandler(StreamHandlerBase): - """Metadata Handler.""" - - def __init__(self): - # the key is root_graph_id, the value is RootGraph - self._root_graphs = defaultdict(RootGraph) - # dict of - self._graph = {} - self._searched_node_list = {} - # dict of - self.graph_node_map = {} - # dict of for all graphs - self._all_leaf_nodes = {} - # the whole graph - self._whole_graph = None - - @property - def whole_graph(self): - """The property of whole_graph.""" - return self._whole_graph - - @property - def root_graphs(self): - """The property of root graphs.""" - return self._root_graphs - - @property - def graph_names(self): - """The property of graph names.""" - return list(self._graph) - - @property - def debugger_graph_obj(self): - """The property of graph object.""" - return self._graph - - @property - def leaf_nodes(self): - """The property of leaf nodes among all graphs.""" - return self._all_leaf_nodes - - def put(self, value): - """ - Put value into graph cache. Called by grpc server. - - Args: - value (dict): The Graph proto message. Each item is format like (, GraphProto). - """ - log.info("Put graph into cache.") - sorted_value_list = self._sort_graph(value) - for graph_name, graph_value in sorted_value_list: - # build sub graph - graph = DebuggerGraph() - graph.build_graph(graph_value) - self._graph[graph_name] = graph - leaf_nodes = graph.leaf_nodes - self._all_leaf_nodes.update(leaf_nodes) - for _, node in leaf_nodes.items(): - self.graph_node_map[node.full_name] = graph_name - - self._parse_root_graphs() - # build whole graph - graph = DebuggerMultiGraph() - graph.add_graph(self._graph) - self._whole_graph = graph - - def _parse_root_graphs(self): - """Parse root graph infos.""" - for graph_name, debugger_graph in self._graph.items(): - root_graph_id = debugger_graph.root_graph_id - root_graph = self._root_graphs[root_graph_id] - if debugger_graph.is_root_graph: - log.info("Found root graph: %s", graph_name) - root_graph.graph_name = graph_name - else: - log.info("Found subgraph %s, the root_graph_id is %s", graph_name, root_graph_id) - root_graph.sub_graph_names.append(graph_name) - - def get(self, filter_condition=None): - """ - Get the graph of specific node. - - Args: - filter_condition (dict): - - - name (str): The full debug node name. - - graph_name (str): The relative graph_name of the node. - - single_node (bool): If True, return the graph from root - to the specific node; else, return the sublayer of the - graph. Default: False. - - Returns: - dict, the metadata. - """ - try: - self._graph_exists() - except DebuggerGraphNotExistError: - log.warning('The graph is empty. To view a graph, ' - 'please start the training script first.') - return {'graph': {}} - - graph = {} - if filter_condition is None: - filter_condition = {} - graph = {'graph_names': self.graph_names} - - single_node = filter_condition.get('single_node', False) - name = filter_condition.get('name') - graph_name = filter_condition.get('graph_name') - if single_node is True: - nodes = self._get_single_node(name, graph_name) - else: - nodes = self._list_nodes(name, graph_name) - graph.update(nodes) - - return {'graph': graph} - - def _get_single_node(self, name, graph_name=None): - """ - Search node, and return every layer nodes until this node. - - Args: - graph_name(str): The graph_name. - name (str): The name of node. - - Returns: - dict, every layer nodes until this node. - """ - graph = self._get_graph(graph_name=graph_name) - searched_graph = graph.search_single_node(name) - - return searched_graph - - def _list_nodes(self, scope, graph_name): - """ - Get the nodes of every layer in graph. - - Args: - scope (str): The name of a scope. - graph_name(str): The graph name. - - Returns: - TypedDict{'nodes': ['Node_1', ...], 'graph_names': ['graph_name_1', ...]}, - format is {'nodes': [], 'graph_names': []}. - example: - { - "nodes" : [ - { - "attr" : - { - "index" : "i: 0\n" - }, - "input" : {}, - "name" : "input_tensor", - "output" : - { - "Default/TensorAdd-op17" : - { - "edge_type" : "data", - "scope" : "name_scope", - "shape" : [1, 16, 128, 128] - } - }, - "output_i" : -1, - "proxy_input" : {}, - "proxy_output" : {}, - "independent_layout" : False, - "subnode_count" : 0, - "type" : "Data" - } - ] - } - """ - graph = self._get_graph(graph_name, scope) - nodes = graph.list_node_by_scope(scope=scope) - res = {'nodes': nodes} - - return res - - def get_tensor_history(self, node_name, graph_name=None, depth=0): - """ - Get the tensor history of a specified node. - - Args: - node_name (str): The debug name of the node. - graph_name (str): The graph_name. Default: None. - depth (int): The number of layers the user - wants to trace. Default is 0. - - Returns: - dict, basic tensor history, only including tensor name and tensor type and node type. - """ - graph_name, node_name = self._parse_node_name(node_name, graph_name) - graph = self._get_graph(graph_name=graph_name, node_name=node_name) - # validate node type, scope node has no tensor history - node_type = graph.get_node_type(node_name) - if is_scope_type(node_type): - log.error("Scope type node has no tensor history.") - raise DebuggerParamValueError("Invalid leaf node name.") - # get tensor history - tensor_history, cur_outputs_nums = graph.get_tensor_history(node_name, depth) - # add the tensor type for tensor history - self._update_tensor_history(tensor_history[0:cur_outputs_nums], 'output', graph_name) - self._update_tensor_history(tensor_history[cur_outputs_nums:], 'input', graph_name) - log.debug("Get %d tensors in tensor history for node <%s>.", len(tensor_history), node_name) - return {'tensor_history': tensor_history} - - @staticmethod - def _update_tensor_history(tensor_history, tensor_type, graph_name): - """ - Add tensor source type for tensor history. - - Args: - tensor_history (list[dict]): Tensor history from Graph stream. Each element has two - keys: `node_type` and `name`. `node_type` refers to the type of the node which - the tensor come from. `name` refers to the tensor name. - tensor_type (str): The source type of the tensor. `input` or `output`. - graph_name (str): The graph name. - """ - for single_tensor_info in tensor_history: - single_tensor_info['type'] = tensor_type - single_tensor_info['graph_name'] = graph_name - - def search_nodes(self, pattern): - """ - Search nodes by given pattern. - - Args: - pattern (dict): Filter condition. - - - name (str): The name pattern. - - graph_name (str): The graph name. - - node_category (str): The node_category. - - condition (dict): The additional filter condition. - - stack_pattern (str): The pattern of stack info. - - Returns: - dict, the searched node. - """ - graph_name = pattern.pop('graph_name', None) - search_nodes = self.search_in_graph(pattern, graph_name) - # construct to search tree - graph = self._get_graph(graph_name=graph_name) - format_nodes = graph.get_nodes(search_nodes) - return {'nodes': format_nodes} - - def search_in_graph(self, pattern, graph_name=None): - """ - Search nodes by given pattern. - - Args: - pattern (dict): Filter condition. - - - name (str): The name pattern. - - node_category (str): The node_category. Default: None. - - condition (dict): The additional filter condition. - - stack_pattern (str): The pattern of stack info. - graph_name (str): The graph name. Default: None. - - Returns: - list, the searched node list. - """ - temp_node_list = [] - node_category = pattern.get('node_category') - graph = self._get_graph(graph_name=graph_name) - stack_pattern = pattern.get('stack_pattern') - validate_stack_pattern(stack_pattern) - # filter nodes by name - if pattern.get('name'): - if node_category or stack_pattern: - # get leaf nodes for forward filter - temp_node_list = graph.search_leaf_nodes_by_pattern(pattern.get('name')) - else: - # optimize search nodes - temp_node_list = graph.search_nodes_by_pattern(pattern.get('name')) - if not temp_node_list: - log.debug("No node named %s", pattern.get('name')) - return [] - # filter nodes by category - if node_category: - node_category = self._get_inner_node_category(node_category) - condition = pattern['condition'].copy() if pattern.get('condition') else {} - condition['search_range'] = temp_node_list - temp_node_list = graph.search_nodes_by_category(node_category, condition=condition) - if not temp_node_list: - log.debug("No node with category %s", node_category) - return [] - # filter nodes by stack_pattern - if stack_pattern: - if not temp_node_list: - temp_node_list = graph.leaf_nodes.values() - log.info("Begin to filter nodes by `stack_pattern`.") - query = StackQuery(temp_node_list) - temp_node_list = query.filter(stack_pattern).all() - return temp_node_list - - @staticmethod - def _get_inner_node_category(node_category): - """ - Get inner node category. - - Args: - node_category (str): The node category supported in - mindinsight.conditionmgr.condition.TargetTypeEnum. - - Returns: - CategoryTypeEnum, the translated value. - """ - try: - res = CategoryTypeEnum(node_category) - except ValueError as err: - log.error("Invalid node category. %s", err) - raise DebuggerParamValueError("Invalid node_category.") - return res - - def get_graph_id_by_name(self, node_name): - """ - Get graph id by full name. - - Args: - node_name (str): The name of the node. - - Returns: - str, the graph name of the node. - - Raises: - DebuggerNodeNotInGraphError: If can not find the node in all graphs. - """ - if node_name: - for graph_name, sub_graph in self._graph.items(): - if sub_graph.exist_node(name=node_name): - return graph_name - log.error('Failed to find node %s in graph. Please make sure the graph has been sent and ' - 'the node name is correct, and try again.', node_name) - raise DebuggerGraphNotExistError - - def get_graph_id_by_full_name(self, node_name): - """ - Get graph id by full name. - - Args: - node_name (str): The full name of the node. - - Returns: - str, the graph name of the node. - - Raises: - DebuggerNodeNotInGraphError: If can not find the node in all graphs. - """ - graph_id = self.graph_node_map.get(node_name) if node_name else None - if not graph_id: - log.warning("Failed to get graph id by full name: %s", node_name) - return graph_id - - def get_node_type(self, node_name, graph_name=None): - """ - Get the type of the specified node. - - Args: - node_name (str): The debug name of the node. - graph_name (str): The relative graph_name of the node. Default: None. - - Returns: - A string of the node type, name_scope or leaf. - """ - if graph_name: - graph = self._get_graph(node_name=node_name, graph_name=graph_name) - else: - graph = self._whole_graph - node_type = graph.get_node_type(node_name) - - return node_type - - def get_full_name(self, node_name, graph_name=None): - """Get full name according to ui node name.""" - full_name = '' - if node_name: - graph = self._get_graph(node_name=node_name, graph_name=graph_name) - full_name = graph.get_full_name_by_node_name(node_name) - - return full_name - - def get_node_basic_info(self, node_name, graph_name): - """Get node basic info with graph scope.""" - graph_name, node_name = self._parse_node_name(node_name=node_name, graph_name=graph_name) - graph = self._get_graph(graph_name, node_name) - full_name = graph.get_full_name_by_node_name(node_name) - node_type = graph.get_node_type(node_name) - return self.construct_node_basic_info(full_name, graph_name, node_name, node_type) - - def get_tensor_graph(self, tensor_name, graph_name): - """ - Get tensor graph according to node name. - - Args: - tensor_name (str): Tensor name from UI, format is "node_name:slot". - graph_name (str): The relative graph_name of the node. Default: None. - - Returns: - dict, relative node. - """ - node_name, _ = tensor_name.rsplit(':', 1) - graph = self._get_graph(graph_name=graph_name, node_name=node_name) - tensor_graph = graph.get_tensor_graph(node_name) - return {'graph': tensor_graph} - - @staticmethod - def construct_node_basic_info(full_name, graph_name, node_name, node_type): - """Construct node basic info.""" - node_name_with_graph_scope = '/'.join([graph_name, node_name]) if node_name else graph_name - return NodeBasicInfo(name=node_name_with_graph_scope, full_name=full_name, type=node_type) - - def get_node_basic_info_by_scope(self, scope_name, graph_name): - """ - Get node by a given scope name. - - Args: - scope_name (str): The name of scope. - graph_name (str): The relative graph_name of the watched node. Default: None. - - Returns: - list[NodeBasicInfo], a list of node. - """ - graph_name, node_name = self._parse_node_name(scope_name, graph_name) - graph = self._get_graph(graph_name) - # to make sure fully match the scope name - node_name = node_name + '/' if node_name and not node_name.endswith('/') else node_name - nodes = graph.search_leaf_nodes_by_pattern(node_name, True) - res = [self.construct_node_basic_info(full_name=node.full_name, - graph_name=graph_name, - node_name=node.name, - node_type=node.type) for node in nodes] - return res - - def get_node_name_by_full_name(self, full_name, graph_name): - """Get UI node name by full name and graph name.""" - if graph_name and full_name: - graph = self._get_graph(graph_name) - node_name = graph.get_node_name_by_full_name(full_name) - else: - node_name = '' - log.debug("Get empty full name.") - return node_name - - def _graph_exists(self): - """ - Check if the graph has been loaded in the debugger cache. - - Raises: - DebuggerGraphNotExistError: If the graph does not exist. - """ - if not self._graph: - log.error('The graph does not exist. Please start the ' - 'training script and try again.') - raise DebuggerGraphNotExistError - - def _get_graph(self, graph_name=None, node_name=None): - """ - Get the graph object according to graph name and node name. - - Args: - graph_name (str): The graph name. - node_name (str): The node name. - - Returns: - DebuggerGraph, the graph object. - - Raises: - DebuggerGraphNotExistError: If the graph does not exist. - """ - graph = self._graph.get(graph_name) if graph_name else self._whole_graph - # get graph according to graph name and check the node - if graph and (not node_name or graph.exist_node(name=node_name)): - return graph - log.error('The graph %s does not exist node %s.', graph_name, node_name) - raise DebuggerGraphNotExistError - - def _has_graph_scope(self, graph_name): - """Check if query with graph_scope.""" - return bool(graph_name is None and len(self._graph) > 1) - - def validate_graph_name(self, graph_name): - """Validate graph_name.""" - if graph_name and self._graph.get(graph_name) is None: - log.error("No graph named %s in debugger cache.", graph_name) - raise DebuggerGraphNotExistError - if not graph_name and len(self._graph) == 1: - graph_name = self.graph_names[0] - return graph_name - - def _add_graph_scope_for_nodes(self, nodes, graph_name): - """ - Add graph scope for nodes. - - Args: - nodes (list[Node]): List of nodes object. - graph_name (str): The graph name. - """ - - def _get_updated_node_info(cur_node, node_type): - """Add graph scope in key.""" - old_node = cur_node.get(node_type) - if not old_node: - return - new_values = {} - for old_name, node_info in old_node.items(): - new_name = '/'.join([graph_name, old_name]) if old_name else graph_name - new_values[new_name] = node_info - cur_node[node_type] = new_values - - for node in nodes: - node['name'] = '/'.join([graph_name, node['name']]) if node['name'] else graph_name - _get_updated_node_info(node, 'input') - _get_updated_node_info(node, 'output') - if node.get('nodes'): - self._add_graph_scope_for_nodes(node.get('nodes'), graph_name) - - def _parse_node_name(self, node_name, graph_name): - """ - Parse node_name according to graph_name. - - Args: - node_name (str): The ui node name. - graph_name (str): The graph name. - - Returns: - str, parsed graph name. - str, parsed node name. - """ - node_name = '' if node_name is None else node_name - if self._has_graph_scope(graph_name): - names = node_name.split("/", 1) - graph_name = names[0] - node_name = names[1] if len(names) == 2 else '' - if graph_name is None and len(self._graph) == 1: - graph_name = self.graph_names[0] - return graph_name, node_name - - def validate_node_name(self, node_name, graph_name): - """ - Validate the graph exist the specified node. - - Args: - node_name (str): The ui node name. - graph_name (str): The graph name. - - Raises: - DebuggerNodeNotInGraphError: If can not find the node in all graphs. - """ - graph = self._get_graph(graph_name=graph_name) - if not graph.exist_node(name=node_name): - log.error("graph %s doesn't find node: %s.", graph_name, node_name) - raise DebuggerNodeNotInGraphError(node_name) - - @staticmethod - def _sort_graph(graphs): - """ - Sort graph by graph_name. - - Args: - graphs(dict): . - """ - if len(graphs) == 1: - return graphs.items() - sorted_graphs = sorted(graphs.items(), key=lambda x: get_graph_number(x[0])) - return sorted_graphs - - def get_root_graph_id(self, graph_name, node_name=None): - """Get the root_graph_id of a graph.""" - graph_name, node_name = self._parse_node_name(node_name=node_name, graph_name=graph_name) - graph = self._get_graph(graph_name=graph_name) - return graph.root_graph_id - - -def get_graph_number(graph_name): - """Get the number of graph.""" - number = graph_name.split("_")[-1] - return int(number) diff --git a/mindinsight/debugger/stream_handler/graph_history_handler.py b/mindinsight/debugger/stream_handler/graph_history_handler.py deleted file mode 100644 index 540740e4..00000000 --- a/mindinsight/debugger/stream_handler/graph_history_handler.py +++ /dev/null @@ -1,143 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Define the GraphHistory stream handler.""" -from mindinsight.debugger.common.exceptions.exceptions import DebuggerParamValueError -from mindinsight.debugger.common.log import LOGGER as log -from mindinsight.debugger.common.utils import enter_tag -from mindinsight.debugger.stream_cache.graph_history import GraphHistory -from mindinsight.debugger.stream_handler.base_handler import StreamHandlerBase - - -class GraphHistoryHandler(StreamHandlerBase): - """GraphHistory Handler.""" - - def __init__(self): - # the key is rank id, the value is GraphHistory - self._history = {} - # the key is rank id, the value is like Dict[, List[]] - self._dumped_step = {} - - def put(self, value): - """ - Put graph history into cache. - - Args: - value (dict): The key is the rank id, the value is like {: list[]}. - """ - for rank_id, graph_history in value.items(): - self._history[rank_id] = GraphHistory(rank_id, graph_history) - - def put_dumped_step(self, dumped_step): - """ - Put dumped step info. - - Args: - dumped_step (dict): The key is rank id, the - value is like Dict[, List[]]. - """ - self._check_dumped_step(dumped_step) - self._dumped_step = dumped_step - - @enter_tag - def _check_dumped_step(self, dumped_step): - """Check if all dumped step in is graph history.""" - def _matched(dumped_steps, run_history): - diff_set = dumped_steps - run_history - if not diff_set: - return True - if len(diff_set) != 1: - return False - # check if it is a data sink exception case - max_step_id = max(dumped_steps) - if max_step_id in diff_set and (max_step_id - 1) in run_history: - msg = f"The dumped iteration {max_step_id} is not expected. It may be normal if " \ - f"the data is dumped in dataset sink mode and there is only AssignAdd operator " \ - f"in that directory. Otherwise, the dump structure is not correct." - log.warning(msg) - dumped_steps.remove(max_step_id) - return True - return False - - for rank_id, value in dumped_step.items(): - graph_history = self.get(rank_id) - is_matched = True - for root_graph_id, dumped_steps_per_graph in value.items(): - whole_run_ids = graph_history.get_run_ids(root_graph_id) - if not whole_run_ids: - # in case there is no graph history file - log.warning("Graph History file of %s in rank_%s is empty.", root_graph_id, rank_id) - continue - is_matched = is_matched and _matched(dumped_steps_per_graph, whole_run_ids) - if not is_matched: - log.warning("Dumped step value of graph %s in rank_%s mismatch the graph history. " - "Clear the history graph.", root_graph_id, rank_id) - graph_history.clear() - - def get(self, filter_condition=None): - """ - Get GraphHistory of specified rank id. - - Args: - filter_condition (int): The rank id. - - Returns: - GraphHistory, the GraphHistory. - """ - rank_id = filter_condition - if rank_id not in self._history: - log.error("Invalid rank id. Failed to find graph history with rank id %s", rank_id) - raise DebuggerParamValueError("Invalid rank_id.") - return self._history.get(rank_id) - - def get_dumped_step(self, rank_id): - """ - Get dumped step info of specified device. - - Args: - rank_id (int): The rank id. - - Returns: - dict, the key is graph id, the value is the list of dumped steps. - """ - if rank_id not in self._dumped_step: - log.error("Invalid rank id. Failed to find dumped steps with rank id %s", rank_id) - raise DebuggerParamValueError("Invalid rank_id.") - return self._dumped_step.get(rank_id) - - def get_total_count(self): - """ - Get total count per device. - - Returns: - dict, the key is rank id, the value is the total count of each device. - """ - total_count = {} - for rank_id, graph_history in self._history.items(): - total_count_per_rank = graph_history.get_total_count() - if not total_count_per_rank: - log.warning("Failed to get total graph run count from graph history of rank_%s. " - "Try to get it based on dumped iterations.", rank_id) - total_count_per_rank = self._get_max_dumped_step_id(rank_id) - total_count[rank_id] = total_count_per_rank - return total_count - - def _get_max_dumped_step_id(self, rank_id): - """Get the maximum step id of specified device.""" - max_step_id = -1 - for dumped_step_per_graph in self._dumped_step.get(rank_id, {}).values(): - if not dumped_step_per_graph: - continue - max_step_id = max(max_step_id, max(dumped_step_per_graph)) - return max_step_id + 1 diff --git a/mindinsight/debugger/stream_handler/source_handler.py b/mindinsight/debugger/stream_handler/source_handler.py deleted file mode 100644 index 51bdf5ed..00000000 --- a/mindinsight/debugger/stream_handler/source_handler.py +++ /dev/null @@ -1,151 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Source Handler.""" -from collections import defaultdict - -from mindinsight.datavisual.common.log import logger as log -from mindinsight.debugger.common.exceptions.exceptions import DebuggerParamTypeError, DebuggerParamValueError -from mindinsight.debugger.stream_handler.base_handler import StreamHandlerBase -from mindinsight.domain.graph.query import StackQuery - - -class SourceHandler(StreamHandlerBase): - """Source Data object.""" - - def __init__(self): - # contains the stack info with different file path and line number - self._stack_info_set = set() - # keep the stack info in order - self._stack_infos = [] - - def put(self, value): - """ - Put source object into cache. - - Args: - value (list[DebuggerSource]): The list of source object. - """ - if not isinstance(value, list): - value = [value] - for source in value: - # avoid showing annotation which has no file_path - if source.file_path: - self._stack_info_set.add(source) - - def sort(self): - """Sort the stack info according to file path and line number.""" - self._stack_infos = list(self._stack_info_set) - self._stack_infos.sort() - - def get(self, filter_condition): - """ - Get stack infos according to filter_condition. - - Args: - filter_condition (str): The pattern of stack info. - - Returns: - list, the list of DebuggerSource objects. - """ - if filter_condition: - query = StackQuery(self._stack_infos) - stack_infos = query.filter(filter_condition).all() - else: - stack_infos = self._stack_infos - return stack_infos - - def get_stack_info_by_offset(self, pattern=None, limit=0, offset=0): - """ - Get stack infos. - - Args: - pattern (str): The pattern of stack infos. Default: None. If not given, return all stack infos. - limit (int): The size of each page. Default: 0. If 0, there is no limitation. - offset (int): The index of the page. Valid only when `limit` is not 0. - - Returns: - dict, stack info objects. The format is like: - { - 'total': int, - 'offset': int, - 'stack_infos': [{: [{'file_path': str, 'line_no': int, 'code_line': str}]] - } - - """ - # validate params - self.check_int('limit', limit, min_num=0, max_num=100) - self.check_int('offset', offset, min_num=0, max_num=len(self._stack_infos)) - validate_stack_pattern(pattern) - if not limit and offset > 0: - return {} - # get filter results - filter_res = self.get(pattern) - if not filter_res: - log.debug("No stack info with pattern %s", pattern) - return {} - merged_res = self._merge_stack_by_file_path(filter_res) - total_size = len(merged_res) - if not limit: - limit = total_size - st_index = offset * limit - query_res = merged_res[st_index: st_index + limit] - for stack_info in query_res: - source_items = stack_info['items'] - stack_info['items'] = list(map(lambda x: x.to_dict(), source_items)) - - return {'total': total_size, - 'offset': offset, - 'stack_infos': query_res} - - @staticmethod - def check_int(param_name, value, min_num, max_num): - """Check if the value is positive integer.""" - if isinstance(value, int) and min_num <= value <= max_num: - return - log.error("Invalid param `%s`. The integer should be in [%d, %d].", param_name, min_num, max_num) - raise DebuggerParamTypeError(f"Invalid param `{param_name}`.") - - @staticmethod - def _merge_stack_by_file_path(stack_infos): - """ - Merge stack infos by file path. - - Args: - stack_infos (list[DebuggerSource]): List of Debugger Source objects which is sorted already. - - Returns: - list, list of merged stack infos. The format of stack info is like: - {'file_path': str, 'items': [DebuggerSource]} - """ - merged_dict = defaultdict(list) - for stack_info in stack_infos: - merged_dict[stack_info.file_path].append(stack_info) - res = [None] * len(merged_dict) - for index, (file_path, source_items) in enumerate(merged_dict.items()): - res[index] = {'file_path': file_path, 'items': source_items} - return res - - -def validate_stack_pattern(stack_pattern): - """Check stack pattern.""" - if stack_pattern: - if not isinstance(stack_pattern, str): - log.error("Invalid stack pattern. String type is required, but got %s.", type(stack_pattern)) - raise DebuggerParamTypeError("stack_pattern is not string type.") - pattern_limit = 255 - if len(stack_pattern) > pattern_limit: - log.error("The length of stack_pattern is %s, which should no greater than %s.", len(stack_pattern), - pattern_limit) - raise DebuggerParamValueError("stack_pattern is over length limit.") diff --git a/mindinsight/debugger/stream_handler/tensor_handler.py b/mindinsight/debugger/stream_handler/tensor_handler.py deleted file mode 100644 index 5c8d2695..00000000 --- a/mindinsight/debugger/stream_handler/tensor_handler.py +++ /dev/null @@ -1,739 +0,0 @@ -# Copyright 2020-2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Define the tensor stream handler.""" -import os -import tempfile -import threading -import time -from collections import OrderedDict -from collections import namedtuple - -import numpy as np - -from mindinsight.conf import settings -from mindinsight.domain.graph.base import NodeTypeEnum -from mindinsight.debugger.common.exceptions.exceptions import DebuggerParamValueError, DebuggerDownloadOverQueue, \ - DebuggerDownloadTensorNotExist -from mindinsight.debugger.common.log import LOGGER as log -from mindinsight.debugger.common.utils import MAX_CACHE_SPACE_BYTES, MAX_SINGLE_TENSOR_CACHE_BYTES -from mindinsight.debugger.stream_cache.tensor import OpTensor, ConstTensor, TensorStatusEnum, DownloadStatusEnum -from mindinsight.debugger.stream_handler.base_handler import StreamHandlerBase -from mindinsight.domain.graph.proto.ms_graph_pb2 import DataType -from mindinsight.utils.tensor import TensorUtils, TensorComparison - -TensorBasicInfo = namedtuple('tensor_basic_info', ['full_name', 'node_type', 'iter']) -FILE_MODE = 0o600 -DIR_MODE = 0o700 - - -class MemoryMgr: - """The memory manager of tensors.""" - - def __init__(self): - self._memory_queue = OrderedDict() - self._remaining_cache_space = MAX_CACHE_SPACE_BYTES - self._lock = threading.Lock() - - @property - def remaining_cache_space(self): - return self._remaining_cache_space - - def request(self, key, request_space, release_func): - """Request for the memory space.""" - if self.check_space(request_space): - release_func(True) - return - if request_space == 0: - return - with self._lock: - if key in self._memory_queue: - log.error("Key already exist error for memory queue.") - raise ValueError("Key already exist error for memory queue.") - self._remaining_cache_space -= request_space - while self._remaining_cache_space <= 0: - self.release() - with self._lock: - self._memory_queue[key] = (request_space, release_func) - - def release(self, key=None): - """Release the memory space.""" - with self._lock: - if key is not None: - if key not in self._memory_queue: - return - self._memory_queue.move_to_end(key, last=False) - _, value = self._memory_queue.popitem(last=False) - free_space, release_func = value - release_func() - self._remaining_cache_space += free_space - log.debug("Update cache space.") - - @staticmethod - def check_space(space): - """Check if the space over allowed space.""" - return space >= MAX_SINGLE_TENSOR_CACHE_BYTES - - -class DownloadMgr: - """The download manager.""" - - def __init__(self): - """Download manager.""" - - self._temp_base_dir = self.mk_temp_base_dir() - self.tensor_info = None - self.file_name = None - self.file_path = None - self.temp_dir = None - self._lock = threading.Lock() - self.status = DownloadStatusEnum.PENDING.value - - @property - def temp_base_dir(self): - return self._temp_base_dir - - def add(self, file_name, file_path, temp_dir, **tensor_info): - """Add the temp file path.""" - with self._lock: - if self.status != DownloadStatusEnum.SENDING.value: - self.file_name = file_name - self.file_path = file_path - self.temp_dir = temp_dir - self.tensor_info = tensor_info - return - log.error("There is already a tensor in download") - raise DebuggerDownloadOverQueue() - - def get(self, **tensor_info): - """Get the temp file path.""" - with self._lock: - if self.tensor_info == tensor_info: - self.status = DownloadStatusEnum.SENDING.value - return self.file_name, self.file_path, self.clean - log.error("No such tensor to download") - raise DebuggerDownloadTensorNotExist() - - def check_status(self): - """Check the download status.""" - if self.status == DownloadStatusEnum.SENDING.value: - log.error("There is already a tensor in download") - raise DebuggerDownloadOverQueue() - - @staticmethod - def mk_temp_base_dir(): - workspace = settings.WORKSPACE - temp_base_dir = os.path.join(workspace, 'tempdata') - os.makedirs(temp_base_dir, DIR_MODE, exist_ok=True) - return temp_base_dir - - def clean(self): - """Clean cache.""" - with self._lock: - if self.temp_dir: - self.temp_dir.cleanup() - self.temp_dir = None - self.tensor_info = None - self.file_name = None - self.file_path = None - self.status = DownloadStatusEnum.PENDING.value - - -class MultiCardTensorHandler: - """Multi-card Tensor Handler.""" - def __init__(self): - self._memory_mgr = MemoryMgr() - self._download_mgr = DownloadMgr() - self.tensor_handlers = {0: TensorHandler(self._memory_mgr, self._download_mgr, rank_id=0)} - - @property - def download_mgr(self): - return self._download_mgr - - def set_step(self, step_id): - """Set step id.""" - for tensor_handler in self.tensor_handlers.values(): - tensor_handler.cur_step = step_id - - def get_tensor_handler_by_rank_id(self, rank_id=0, create_if_not_exit=False): - """get handler by rank id""" - if rank_id in self.tensor_handlers: - return self.tensor_handlers.get(rank_id) - if create_if_not_exit: - tensor_handler = TensorHandler(self._memory_mgr, self._download_mgr, rank_id=rank_id) - self.tensor_handlers[rank_id] = tensor_handler - return tensor_handler - log.error("There is no rank id %d in MultiCardTensorHandler.", rank_id) - raise ValueError - - def put(self, value): - """put graphs into graph_handlers""" - for rank_id, tensor in value: - if rank_id not in self.tensor_handlers: - self.tensor_handlers[rank_id] = TensorHandler(self._memory_mgr, self._download_mgr, rank_id=rank_id) - self.tensor_handlers[rank_id].put(tensor) - - def get(self, filter_condition=None, rank_id=0): - """Get the graph of specific node for specific device.""" - if rank_id in self.tensor_handlers: - return self.tensor_handlers.get(rank_id).get(filter_condition) - log.error("There is no rank id %d.", rank_id) - raise ValueError - - def clean(self): - """Clean cache.""" - self.__init__() - - @staticmethod - def tensor_basic_info(full_name, node_type, iter_step): - return TensorBasicInfo(full_name=full_name, node_type=node_type, iter=iter_step) - - -class TensorHandler(StreamHandlerBase): - """Metadata Handler.""" - - def __init__(self, memory_mgr, download_mgr, rank_id): - # the collection of parameter full names - self._param_names = set() - # const value objects, the format is like: dict[, ] - self._const_vals = {} - # tensor values, the format is like: - # dict[, dict[, ]] - self._tensors = {} - self._cur_step = 0 - self._memory_mgr = memory_mgr - self.download_mgr = download_mgr - self._rank_id = rank_id - self._hold_value = {} - - @property - def cur_step(self): - """The property of current step.""" - return self._cur_step - - @cur_step.setter - def cur_step(self, step_id): - """The property of current step.""" - self._cur_step = step_id - - @property - def prev_step(self): - """The property of previous step.""" - return self._cur_step - 1 - - def put(self, value): - """ - Put value into tensor cache. Called by grpc server. - - Args: - value (dict): The Tensor proto message. - - - step (int): The current step of tensor. - - tensor_proto (TensorProto): The tensor proto. - - tensor_contents (list[byte]): The list of tensor content values. - - Returns: - bool, the tensor has updated successfully. - """ - tensor = self._deal_with_tensor(value) - stats = None - if value.get('stats', False) and tensor.status == TensorStatusEnum.CACHED.value: - tensor.calculate_stats() - stats = tensor.stats - - flag = self._put_tensors(tensor) - new_tensor = self._tensors.get(tensor.name).get(tensor.step) - new_tensor.stats = stats - log.info("Put tensor %s of step: %d, into cache. Flag: %s", tensor.name, tensor.step, flag) - return flag - - @staticmethod - def _deal_with_tensor(value): - """Deal with tensor from tensor proto.""" - step = value.get('step', 0) - tensor_content = b''.join(value.get('tensor_contents')) - tensor = OpTensor(value.get('name'), value.get('tensor_base'), tensor_content=tensor_content, step=step) - if value.get('oversize'): - tensor.clean_tensor_value(oversize=True) - return tensor - - def put_empty_tensor(self, name, step): - """Put empty tensor into cache.""" - cache_tensor = self._tensors.get(name) - if cache_tensor is None: - cache_tensor = {} - self._tensors[name] = cache_tensor - old_tensor = cache_tensor.get(step) - if old_tensor is None: - tensor = OpTensor(name, step=step) - cache_tensor[step] = tensor - return True - return False - - def put_tensor_base(self, name, step, tensor_base): - """Put tensor base info.""" - cache_tensor = self._tensors.get(name) - if cache_tensor is None: - cache_tensor = {} - self._tensors[name] = cache_tensor - old_tensor = cache_tensor.get(step) - if old_tensor is None or old_tensor.tensor_base != tensor_base: - tensor = OpTensor(name, tensor_base, step=step) - cache_tensor[step] = tensor - return True - return False - - def put_tensor_stats(self, name, step, tensor_base, tensor_stats): - """Put tensor stats info.""" - cache_tensor = self._tensors.get(name) - if cache_tensor is None: - cache_tensor = {} - self._tensors[name] = cache_tensor - old_tensor = cache_tensor.get(step) - if old_tensor is None: - tensor = OpTensor(name, tensor_base, tensor_stats=tensor_stats, step=step) - cache_tensor[step] = tensor - return True - if old_tensor.get_tensor_statistics() != TensorUtils.get_overall_statistic_dict(tensor_stats): - old_tensor.stats = tensor_stats - return True - return False - - def _put_tensors(self, tensor): - """ - Put tensor into cache. - - Args: - tensor (OpTensor): The tensor value. - - Returns: - bool, the tensor has updated successfully. - """ - step = tensor.step - cache_tensor = self._tensors.get(tensor.name) - if cache_tensor is None: - cache_tensor = {} - self._tensors[tensor.name] = cache_tensor - - if not self._hold_value.pop((tensor.name, tensor.step), False): - tensor.clean_tensor_value(oversize=False, remain_scalar=True) - - old_tensor = cache_tensor.get(step) - if self._check_tensor_update(old_tensor, tensor): - self._put_tensor_into_cache(cache_tensor, tensor) - return True - return False - - def _check_tensor_update(self, old_tensor, tensor): - """Check if the tensor update compared with old_tensor.""" - if not old_tensor or (old_tensor.status == TensorStatusEnum.CACHED.value and self._is_value_diff( - old_tensor.value, tensor.value)) or (old_tensor.status == TensorStatusEnum.UNCACHED.value - and tensor.status == TensorStatusEnum.CACHED.value): - return True - return False - - def _put_tensor_into_cache(self, cache_tensor, tensor): - """Put tensor into cache.""" - step = tensor.step - self._memory_mgr.release((self._rank_id, tensor.name, step)) - - def release_func(over_size=False): - cache_tensor.get(step).clean_tensor_value(over_size) - - self._memory_mgr.request((self._rank_id, tensor.name, step), tensor.nbytes, release_func) - cache_tensor[step] = tensor - log.debug("Put updated tensor value for %s of step %s.", tensor.name, step) - - @staticmethod - def _is_value_diff(old_value, new_value): - """Check tensor value if there are equal.""" - log.debug("old value type: %s, new_value type: %s", type(old_value), type(new_value)) - if old_value is None and new_value is None: - return False - flag = old_value != new_value - if isinstance(flag, np.ndarray): - return flag.any() - return flag - - def put_const_vals(self, const_vals): - """ - Put const value into tensor cache. - - Args: - const_vals (list[NamedValueProto]): List of const values. - """ - for const_val in const_vals: - if not (const_val.value and const_val.key): - continue - if DataType.Name(const_val.value.dtype) == "DT_TENSOR": - tensor_proto = const_val.value.tensor_val - tensor_value = tensor_proto.tensor_content - tensor_proto.ClearField('tensor_content') - tensor_proto.node_name = const_val.key - tensor_proto.slot = '0' - tensor_base = { - 'dtype': tensor_proto.data_type, - 'shape': tensor_proto.dims, - 'data_size': len(tensor_value) - } - name = ':'.join([tensor_proto.node_name, tensor_proto.slot]) - const_tensor = OpTensor(name, tensor_base, tensor_content=tensor_value) - const_key = name - else: - const_tensor = ConstTensor(const_val) - const_key = const_tensor.full_name - self._const_vals[const_key] = const_tensor - - def record_parameter_names(self, names): - """ - Record parameter names. - - Note: - Parameter values could be changed during an iteration step. It must be cleaned after each node step. - - Args: - names (list[str]): List of tensor full names. - """ - self._param_names.update(names) - log.debug("Record %d parameters in cache. Total parameter number: %d", len(names), len(self._param_names)) - - def get(self, filter_condition=None): - """ - Get full tensor value. - - Args: - filter_condition (dict): Filter condition. - - - name (str): The full name of tensor. - - node_type (str): The type of the node. - - prev (bool): Whether to get previous tensor. - - Returns: - dict, the tensor_value and whether need to send view_command. - """ - name = filter_condition.get('name') - node_type = filter_condition.get('node_type') - shape = filter_condition.get('shape') - if filter_condition.get('prev'): - step = self.prev_step - else: - step = self.cur_step - tensor = self._get_tensor(name, node_type, step) - if not tensor: - log.error("No tensor named %s at the step %s", name, step) - raise DebuggerParamValueError("No tensor named {}".format(name)) - tensor_info = tensor.get_full_info(shape) - missing_tensors_info = self.get_missing_tensor_info(name, node_type, step, self._check_tensor_value) - if not missing_tensors_info and node_type == NodeTypeEnum.PARAMETER.value and step > 0: - tensor_info['has_prev_step'] = True - res = { - 'tensor_value': tensor_info, - 'view_cmd': False - } - if tensor.status == TensorStatusEnum.UNCACHED.value: - self._add_hold_value_tensors(name, step) - res['view_cmd'] = True - return res - - def _get_tensor(self, tensor_name, node_type=None, step=None): - """ - Get tensor according to tensor name and node_type. - - Args: - tensor_name (str): Tensor name, format like `node_name:slot`. - node_type (str): Node type. - step (int): The step of tensor info. Default: None. - - Returns: - Union[OPTensor, ConstTensor], the tensor object. - """ - if step is None: - step = self._cur_step - tensor = self._tensors.get(tensor_name, {}).get(step) - if not tensor and node_type == NodeTypeEnum.CONST.value: - const_name = tensor_name.rsplit('/', 1)[-1] - tensor = self._const_vals.get(const_name) - if tensor: - self._tensors[tensor_name] = {step: tensor} - - return tensor - - def _get_basic_info(self, tensor_name, node_type, step): - """Get the latest basic tensor info by tensor name.""" - tensor = self._get_tensor(tensor_name, node_type, step) - if tensor: - return tensor.get_basic_info() - - return None - - def update_tensor_history(self, tensor_history, step): - """ - Add tensor basic info in tensor_history. - - Args: - tensor_history (dict): Tensor history, including a list of tensor name and type. - step (int): The step of tensor info. - - Returns: - list[dict], the list of tensor basic info cache. - """ - missed_tensors = [] - for tensor_info in tensor_history.get('tensor_history'): - tensor_name = tensor_info.get('full_name') - node_type = tensor_info.get('node_type') - basic_info = self._get_basic_info(tensor_name, node_type, step) - # add `has_prev_step` field to tensor basic info. - missing_tensors_info = self.get_missing_tensor_info(tensor_name, node_type, step, - self._check_tensor_base) - if not missing_tensors_info and node_type == NodeTypeEnum.PARAMETER.value and step > 0: - basic_info['has_prev_step'] = True - if basic_info: - tensor_info.update(basic_info) - if missing_tensors_info: - missed_tensors.extend(missing_tensors_info) - - return missed_tensors - - def get_missing_tensor_info(self, tensor_name, node_type, step=None, check_func=None): - """Update has_prev_step field in tensor info.""" - if step is None: - step = self._cur_step - if check_func is None: - check_func = self._check_tensor_value - missing_tensors_info = [] - # check the current step tensor base is missing - if check_func(tensor_name, step): - missing_tensors_info.append(TensorBasicInfo(full_name=tensor_name, node_type=node_type, iter='')) - log.debug("Add current step tensor base view cmd for %s", tensor_name) - # check the previous step value is missing - if node_type == NodeTypeEnum.PARAMETER.value and step > 0 and \ - check_func(tensor_name, step - 1): - missing_tensors_info.append(TensorBasicInfo(full_name=tensor_name, node_type=node_type, iter='prev')) - log.debug("Add previous step tensor base view cmd for %s", tensor_name) - return missing_tensors_info - - def _check_tensor_base(self, tensor_name, step): - """Check if tensor base info is in cache.""" - tensor = self._get_tensor(tensor_name, step=step) - if tensor is not None and ((tensor.tensor_base and tensor.tensor_base.get( - 'data_size') > 0) or tensor.status == TensorStatusEnum.OVERSIZE.value): - return False - return True - - def _check_tensor_stats(self, tensor_name, step): - """Check if tensor stats is in cache.""" - tensor = self._get_tensor(tensor_name, step=step) - if tensor is not None and (tensor.stats or tensor.status == TensorStatusEnum.OVERSIZE.value): - return False - return True - - def _check_tensor_value(self, tensor_name, step): - """Check if tensor value is in cache.""" - tensor = self._get_tensor(tensor_name, step=step) - res = bool(not tensor or tensor.status == TensorStatusEnum.OVERSIZE.value) - res = bool(res or tensor.status == TensorStatusEnum.UNCACHED.value) - return res - - def get_valid_tensor_by_name(self, tensor_name, step, prev=False): - """Get tensor value by name in numpy type.""" - target_step = step - 1 if prev else step - if target_step < 0: - log.warning("Step %d has no previous value for tensor: %s", target_step, tensor_name) - return None - tensor = self._get_tensor(tensor_name, step=target_step) - return tensor - - def clean_tensors(self, cur_step): - """Clean the tensor cache.""" - if cur_step != self._cur_step: - self._cur_step = cur_step - self._clean_expired_tensors(cur_step) - self._clean_parameters() - - def _clean_expired_tensors(self, cur_step): - """Clean expired tensors less than current steps.""" - expired_tensor = [] - for tensor_name, tensor in self._tensors.items(): - expired_step = [step for step in tensor.keys() if step <= cur_step - 2] - for step in expired_step: - self._memory_mgr.release((self._rank_id, tensor_name, step)) - if not tensor: - expired_tensor.append(tensor_name) - for tensor_name in expired_tensor: - self._tensors.pop(tensor_name) - - def _clean_parameters(self): - """Clean parameter cache.""" - for param in self._param_names: - if param in self._tensors: - params = self._tensors.pop(param) - for step in params: - self._memory_mgr.release((self._rank_id, param, step)) - log.debug("Clean param %s in cache.", param) - - def get_tensors_diff(self, tensor_name, shape, tolerance=0, step=None): - """ - Get tensor comparisons data for given name, detail, shape and tolerance. - - Args: - tensor_name (str): The name of tensor for cache. - shape (tuple): Specify concrete dimensions of shape. - tolerance (str): Specify tolerance of difference between current step tensor and previous - step tensor. Default value is 0. Its is a percentage. The boundary value is equal to - max(abs(min),abs(max)) * tolerance. The function of min and max is being used to - calculate the min value and max value of the result of the current step tensor subtract - the previous step tensor. If the absolute value of result is less than or equal to - boundary value, the result will set to be zero. - step (int): The step of the tensor. Default: None. - - Raises: - DebuggerParamValueError, If get current step node and previous step node failed or - the type of tensor value is not numpy.ndarray." - - Returns: - dict, the retrieved data. - """ - curr_tensor = self.get_valid_tensor_by_name(tensor_name, step=step) - prev_tensor = self.get_valid_tensor_by_name(tensor_name, prev=True, step=step) - if not (curr_tensor and prev_tensor) or self._check_no_comparison_status( - curr_tensor) or self._check_no_comparison_status(prev_tensor): - log.error("Get current step and previous step for this tensor name %s failed.", tensor_name) - raise DebuggerParamValueError(f"Get current step and previous step for this tensor name " - f"{tensor_name} failed.") - if self._check_not_cached_status(curr_tensor) or self._check_not_cached_status(prev_tensor): - self._add_hold_value_tensors(tensor_name, step) - reply = { - 'tensor_status': TensorStatusEnum.UNCACHED.value, - 'view_cmd': True - } - return reply - curr_tensor_slice = curr_tensor.get_tensor_value_by_shape(shape) - prev_tensor_slice = prev_tensor.get_tensor_value_by_shape(shape) - # get tensor comparison basic info - tensor_info = curr_tensor.get_basic_info() - tensor_info.pop('has_prev_step') - tensor_info.pop('value') - # calculate tensor comparison object - tensor_comparison = curr_tensor.tensor_comparison - if not tensor_comparison or tensor_comparison.tolerance != tolerance: - if curr_tensor.value.shape != prev_tensor.value.shape: - raise DebuggerParamValueError("The shape of these two step tensors is not the same.") - tensor_diff = TensorUtils.calc_diff_between_two_tensor(curr_tensor.value, prev_tensor.value, tolerance) - stats = TensorUtils.get_statistics_from_tensor(tensor_diff) - tensor_comparison = TensorComparison(tolerance, stats, tensor_diff) - curr_tensor.update_tensor_comparisons(tensor_comparison) - # calculate diff value - # the type of curr_tensor_slice is one of np.ndarray or str - if isinstance(curr_tensor_slice, np.ndarray) and isinstance(prev_tensor_slice, np.ndarray): - if not shape: - tensor_diff_slice = tensor_comparison.value - else: - tensor_diff_slice = tensor_comparison.value[shape] - result = np.stack([prev_tensor_slice, curr_tensor_slice, tensor_diff_slice], axis=-1) - tensor_info['diff'] = result.tolist() - elif isinstance(curr_tensor_slice, str): - tensor_info['diff'] = curr_tensor_slice - # add comparison statistics - tensor_info.update(self._get_comparison_statistics(curr_tensor, prev_tensor)) - reply = { - 'tensor_status': TensorStatusEnum.CACHED.value, - 'tensor_value': tensor_info - } - return reply - - def _add_hold_value_tensors(self, tensor_name, step): - """Add tensors which hold tensor values.""" - self._hold_value[(tensor_name, step)] = True - # if the current step > 1, the last step will be also recorded - if step - 1 >= 0: - self._hold_value[(tensor_name, step - 1)] = True - - @staticmethod - def _check_no_comparison_status(tensor): - """Check the status that have no comparison.""" - return tensor.status == TensorStatusEnum.EMPTY.value or tensor.status == TensorStatusEnum.OVERSIZE.value - - @staticmethod - def _check_not_cached_status(tensor): - """Check the tensor with not cached status.""" - return tensor.status == TensorStatusEnum.UNCACHED.value - - @staticmethod - def _get_comparison_statistics(curr_tensor, prev_tensor): - """Get comparison statistics.""" - stats_info = {} - diff_tensor_stats = curr_tensor.tensor_comparison.stats - curr_tensor_stats = TensorUtils.get_statistics_from_tensor(curr_tensor.value) - prev_tensor_stats = TensorUtils.get_statistics_from_tensor(prev_tensor.value) - stats_info['curr_step_statistics'] = TensorUtils.get_overall_statistic_dict(overall_stats=curr_tensor_stats) - stats_info['prev_step_statistics'] = TensorUtils.get_overall_statistic_dict(overall_stats=prev_tensor_stats) - stats_info['statistics'] = TensorUtils.get_overall_statistic_dict(overall_stats=diff_tensor_stats) - return stats_info - - def get_tensor_info_for_tensor_graph(self, tensor_name, node_type, step): - """ - Get Tensor info for tensor graphs. - - Args: - tensor_name (str): Tensor name, format like `node_name:slot`. - node_type (str): Node type. - step (int): The step of tensor info. - - Returns: - dict, tensor infos, including overall statistics, tensor shape and has_prev_step info. - list, list of missing tensor basic information. - """ - res = {} - tensor = self._get_tensor(tensor_name, node_type, step) - if tensor and (not tensor.empty or tensor.stats): - res['statistics'] = tensor.get_tensor_statistics() - res['shape'] = tensor.shape - missing_tensors_info = self.get_missing_tensor_info(tensor_name, node_type, step, self._check_tensor_stats) - if not missing_tensors_info and node_type == NodeTypeEnum.PARAMETER.value and step > 0: - res['has_prev_step'] = True - return res, missing_tensors_info - - def load(self, tensor_name, graph_name, prev, node_type, tensor=None): - """Load the tensor.""" - self.download_mgr.check_status() - step = self._cur_step - if prev: - step -= 1 - tensor = self._get_tensor(tensor_name, node_type, step) if tensor is None else tensor - if not tensor or tensor.status == TensorStatusEnum.EMPTY.value: - log.error("No tensor named %s at the step %s", tensor_name, step) - raise DebuggerParamValueError("No tensor named {}".format(tensor_name)) - if tensor.download_size > MAX_CACHE_SPACE_BYTES: - log.error("Tensor named %s at the step %s is too large to download.", tensor_name, step) - raise DebuggerParamValueError( - "Tensor named {} at the step {} is too large to download.".format(tensor_name, step)) - if tensor.status == TensorStatusEnum.CACHED.value: - temp_dir = tempfile.TemporaryDirectory(dir=self.download_mgr.temp_base_dir) - os.chmod(temp_dir.name, DIR_MODE) - node_name, slot = tensor_name.rsplit(':', 1) - node_name = node_name.rsplit('/', 1)[-1] - file_name = "{}.{}.0.0.{}.output.{}.NONE.npy".format(node_type, node_name, round(time.time() * 100), - slot) - file_path = os.path.join(temp_dir.name, file_name) - np.save(file_path, tensor.value) - os.chmod(file_path, FILE_MODE) - tensor_info = { - "tensor_name": tensor_name, - "graph_name": graph_name, - "step": step, - "rank_id": self._rank_id - } - self.download_mgr.add(file_name, file_path, temp_dir, **tensor_info) - return {'in_memory': True} - return {'in_memory': False} diff --git a/mindinsight/debugger/stream_handler/watchpoint_handler.py b/mindinsight/debugger/stream_handler/watchpoint_handler.py deleted file mode 100644 index aa061a2f..00000000 --- a/mindinsight/debugger/stream_handler/watchpoint_handler.py +++ /dev/null @@ -1,875 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Define the watchpoint stream handler.""" -from mindinsight.debugger.common.exceptions.exceptions import DebuggerParamValueError, \ - DebuggerParamTypeError -from mindinsight.debugger.common.log import LOGGER as log -from mindinsight.debugger.conditionmgr.condition import ParamTypeEnum -from mindinsight.debugger.conditionmgr.condition import ValueTypeEnum -from mindinsight.debugger.proto.debug_grpc_pb2 import SetCMD -from mindinsight.debugger.stream_cache.watchpoint import Watchpoint, WatchpointHit, \ - WatchNodeTree -from mindinsight.debugger.stream_handler.base_handler import StreamHandlerBase - -RANGE_START = 'range_start_inclusive' -RANGE_END = 'range_end_inclusive' - - -class WatchpointHandler(StreamHandlerBase): - """Watchpoint Handler.""" - - def __init__(self): - self._watchpoints = {} - # list of ids of new created watchpoints - self._created_watchpoints = [] - # list of SetCMD of watchpoints to be deleted - self._deleted_watchpoints = [] - # dict of of watchpoints to be updated - self._updated_watchpoints = {} - # the collection of watched node full names, which have been sent to MindSpore - self._latest_id = 0 - self._cache_set_cmd = {} - # whether the watchpoint list has been changed since last step - self._outdated = False - - @property - def empty(self): - """Check the there is no watchpoint.""" - return not self._watchpoints - - def set_outdated(self): - """"Set outdated as True.""" - self._outdated = True - - def put(self, value): - """ - Put Watchpoint into watchpoint handler. - - Args: - value (Watchpoint): The name of nodes that have been chosen. - """ - new_id = value.watchpoint_id - self._watchpoints[new_id] = value - self._created_watchpoints.append(new_id) - self._updated_watchpoints[new_id] = value - self._latest_id = new_id - log.debug("Put watchpoint %d into cache.", new_id) - - def sync_set_cmd(self, set_cmds): - """Clean temp watchpoints.""" - self._outdated = False - self._created_watchpoints = [] - self._deleted_watchpoints = [] - self._updated_watchpoints = {} - for set_cmd in set_cmds: - self._cache_set_cmd[set_cmd.id] = set_cmd - - def clean_cache_set_cmd(self, set_cmd): - """Clean cache set command.""" - self._cache_set_cmd.pop(set_cmd.id, None) - - def get_watchpoint_by_id(self, watchpoint_id): - """Get watchpoint by watchpoint id.""" - res = self.get(watchpoint_id) - watchpoint = res.get('watch_points')[0] - - return watchpoint - - def get(self, filter_condition=None): - """ - Get the watchpoints. - - Args: - filter_condition (Union[None, int]): The filter conditions. Get watchpoint by - id. If None, return all watchpoint. Default: None. - - Returns: - dict, the watchpoint list. - """ - reply = [] - if not filter_condition: - # get watch condition list - for _, watchpoint in self._watchpoints.items(): - watchpoint_info = watchpoint.get_watch_condition_info() - reply.append(watchpoint_info) - else: - self.validate_watchpoint_id(filter_condition) - reply = [self._watchpoints.get(filter_condition)] - - log.debug("get the watch points with filter_condition:%s", filter_condition) - - return {'watch_points': reply} - - def get_pending_commands(self): - """ - Get all watchpoint in SetCMD proto format. - - Returns: - list[SetCMD], updated watchpoint to be sent to MindSpore. - """ - newly_set_cmds = [] - for _, watchpoint in self._updated_watchpoints.items(): - set_cmd = SetCMD() - set_cmd.id = watchpoint.watchpoint_id - set_cmd.delete = False - newly_set_cmds.append(set_cmd) - newly_set_cmds.extend(self._deleted_watchpoints) - self.sync_set_cmd(newly_set_cmds) - - return list(self._cache_set_cmd.values()) - - def is_recheckable(self): - """ - Check if current status is able to recheck. - - Returns: - bool, if enable to recheck. - """ - return self._outdated - - def set_watch_nodes(self, graph, graph_stream, watch_point_id, graph_name=None, rank_id=0): - """ - set watch nodes for graph. - - Args: - graph (dict): The graph with list of nodes. - graph_stream (GraphHandler): The graph handler. - watch_point_id (int): The id of watchpoint. - graph_name (str): The graph name. - rank_id (int): The rank id. - """ - if not (watch_point_id and graph): - return - log.debug("add watch flags") - watchpoint = self._watchpoints.get(watch_point_id) - self._set_watch_status_recursively(graph, graph_stream, watchpoint, graph_name, rank_id) - - def _set_watch_status_recursively(self, graph, graph_stream, watchpoint, graph_name=None, rank_id=0): - """Set watch status to graph.""" - if graph.get('children'): - self._set_watch_status_recursively( - graph.get('children'), graph_stream, watchpoint, graph_name, rank_id=0) - - if graph.get('nodes'): - _ = self._set_watch_state_for_nodes(graph['nodes'], graph_stream, watchpoint, graph_name, rank_id) - - def _set_watch_state_for_nodes(self, nodes, graph_stream, watchpoint, graph_name, rank_id=0): - """ - Set watch state for nodes. - - Args: - nodes (list[Node]): List of node info. - - Returns: - int, the number of all watched nodes. - """ - all_watched_num = 0 - valid_node_num = len(nodes) - # initialize the state of current node. - state = WatchNodeTree.NOT_WATCH - for node in nodes: - node_name = node.get('name') - # search result could have `nodes` in nodes object - - disable = True - if node.get('nodes'): - flag = self._set_watch_state_for_nodes(node.get('nodes'), graph_stream, watchpoint, graph_name, rank_id) - else: - full_name = graph_stream.get_full_name(node_name, graph_name) - new_node_name = node_name if graph_name is None else '/'.join([graph_name, node_name]) - flag = watchpoint.get_node_status(new_node_name, node.get('type'), full_name, rank_id) - node['watched'] = flag - if flag == WatchNodeTree.NOT_WATCH: - node['disable'] = disable - continue - state = WatchNodeTree.PARTIAL_WATCH - if flag == WatchNodeTree.INVALID: - valid_node_num -= 1 - elif flag == WatchNodeTree.TOTAL_WATCH: - disable = False - all_watched_num += 1 - node['disable'] = disable - # update the watch status of current node - if not valid_node_num: - state = WatchNodeTree.INVALID - elif all_watched_num == valid_node_num: - state = WatchNodeTree.TOTAL_WATCH - return state - - def create_watchpoint(self, condition_mgr, watch_condition, watch_nodes=None, watch_point_id=None, name=None, - device_amount=8): - """ - Create watchpoint. - Args: - condition_mgr (ConditionMgr): Instance of ConditionMgr. - watch_condition (dict): The watch condition. - "condition": { - id: "tensor_too_large", - "params": [ - { - "name": "abs_mean_gt", - "value": 1.1 - } - ] - } - - - id (str): Id of condition. - - param (list[dict]): The list of param for this condition. - watch_nodes (dict[list[NodeBasicInfo]]): The list of node basic info. - watch_point_id (int): The id of watchpoint. - name (str): The name of watchpoint. - device_amount (int): The amount of devices. - - Returns: - int, the new id of watchpoint. - """ - validate_watch_condition(condition_mgr, watch_condition) - watch_condition = set_default_param(condition_mgr, watch_condition) - new_id = self._latest_id + 1 - watchpoint = Watchpoint(new_id, watch_condition, name) - if watch_nodes: - for rank_id, watch_nodes_for_device in watch_nodes.items(): - validate_rank_id(rank_id, device_amount) - watchpoint.add_nodes(watch_nodes_for_device, rank_id) - elif watch_point_id: - self.validate_watchpoint_id(watch_point_id) - watchpoint.copy_nodes_from(self._watchpoints.get(watch_point_id)) - self.put(watchpoint) - self._outdated = True - return new_id - - def update_watchpoint(self, watch_point_id, watch_nodes, watched=False, rank_id=0): - """ - Update watchpoint. - - Args: - watch_point_id (int): The id of watchpoint. - watch_nodes (list[NodeBasicInfo]): The list of node basic info. - watched (bool): The update operator on nodes. If False, remove nodes from watch nodes. - If True, add nodes to watch nodes. Default: False. - rank_id (int): The rank id. - """ - self.validate_watchpoint_id(watch_point_id) - watchpoint = self._watchpoints.get(watch_point_id) - if watched: - watchpoint.add_nodes(watch_nodes, rank_id) - else: - watchpoint.remove_nodes(watch_nodes, rank_id) - self._updated_watchpoints[watch_point_id] = watchpoint - self._outdated = True - log.debug("Update watchpoint %d in cache.", watch_point_id) - - def delete_watchpoint(self, watch_point_id=None): - """ - Delete watchpoint. - - Args: - watch_point_id (Union[None, int]): The id of watchpoint. - If None, delete all watchpoints. Default: None. - """ - if watch_point_id is None: - watch_point_ids = [sub_id for sub_id, _ in self._watchpoints.items()] - else: - self.validate_watchpoint_id(watch_point_id) - watch_point_ids = [watch_point_id] - for single_id in watch_point_ids: - self._delete_single_watchpoint(single_id) - self._outdated = True - - def _delete_single_watchpoint(self, watch_point_id): - """ - Delete single watchpoint. - - Args: - watch_point_id (int): The id of watchpoint. - """ - self._watchpoints.pop(watch_point_id) - # if the watchpoint has not been created by MindSpore, clean the relative cache directly - if watch_point_id in self._created_watchpoints: - self._created_watchpoints.remove(watch_point_id) - self._updated_watchpoints.pop(watch_point_id) - log.debug("Cancel create watchpoint %d in cache.", watch_point_id) - return - set_cmd = SetCMD() - set_cmd.id = watch_point_id - set_cmd.delete = True - self._deleted_watchpoints.append(set_cmd) - log.debug("Delete watchpoint %d in cache.", watch_point_id) - - def validate_watchpoint_id(self, watch_point_id): - """Validate watchpoint id.""" - if not isinstance(watch_point_id, int): - log.error("Invalid watchpoint id %s. The watch point id should be int.", watch_point_id) - raise DebuggerParamTypeError("Watchpoint id should be int type.") - if watch_point_id and watch_point_id not in self._watchpoints: - log.error("Invalid watchpoint id: %d.", watch_point_id) - raise DebuggerParamValueError("Invalid watchpoint id: {}".format(watch_point_id)) - - -class MultiCardWatchpointHitHandler: - """Multi-card Watchpoint-hit Handler.""" - - def __init__(self): - self.watchpoint_hit_handlers = {0: WatchpointHitHandler()} - - def get_hit_handler_by_rank_id(self, rank_id=0): - """Get handler by rank id.""" - if rank_id in self.watchpoint_hit_handlers: - return self.watchpoint_hit_handlers.get(rank_id) - log.error("There is no rank id %d.", rank_id) - raise ValueError - - def put(self, value): - """Put watchpoint hit into cache.""" - for rank_id, tensor_hit_values in value.items(): - if rank_id not in self.watchpoint_hit_handlers: - self.watchpoint_hit_handlers[rank_id] = WatchpointHitHandler() - cur_hit_handler = self.watchpoint_hit_handlers[rank_id] - for tensor_hit_value in tensor_hit_values: - cur_hit_handler.put(tensor_hit_value) - - def get(self, filter_condition=None, rank_id=0): - """Get the graph of specific node for specific device.""" - if rank_id in self.watchpoint_hit_handlers: - return self.watchpoint_hit_handlers.get(rank_id).get(filter_condition) - log.error("There is no rank id %d.", rank_id) - raise ValueError - - def update_tensor_history(self, tensor_history, rank_id): - """ - Add hit flag to tensor history. - - Args: - tensor_history (dict): The tensor history. - rank_id (int): The rank id. - """ - if rank_id in self.watchpoint_hit_handlers: - self.watchpoint_hit_handlers[rank_id].update_tensor_history(tensor_history) - else: - for tensor_info in tensor_history.get('tensor_history'): - tensor_info['is_hit'] = False - - def check_rank_id(self, rank_id): - """check if has the rank id.""" - return rank_id in self.watchpoint_hit_handlers - - def clean(self): - """Clean cache.""" - self.__init__() - - -class WatchpointHitHandler(StreamHandlerBase): - """Watchpoint hit handler.""" - - def __init__(self): - # dict of >, - self._ordered_hits = [] - # filtered results in self._ordered_hits - self._filtered_hits = [] - self._multi_graph_hits = {} - - @property - def empty(self): - """Whether the watchpoint hit is empty.""" - return not self._multi_graph_hits - - def put(self, value): - """ - Put value into watchpoint hit cache. Called by grpc server. - - Args: - value (dict): The watchpoint hit info. - - - tensor_proto (TensorProto): The message about hit tensor. - - watchpoint (Watchpoint): The Watchpoint that a node hit. - - node_name (str): The UI node name. - - graph_name (str): The graph name. - - error_code (int): The code of errors. - """ - watchpoint_hit = WatchpointHit( - tensor_proto=value.get('tensor_proto'), - watchpoint=value.get('watchpoint'), - node_name=value.get('node_name'), - graph_name=value.get('graph_name') - ) - if 'error_code' in value.keys(): - watchpoint_hit.error_code = value.get('error_code') - # get all hit watchpoints according to node name ans tensor slot - watchpoint_hits = self._get_watchpoints_by_tensor_name(watchpoint_hit.graph_name, watchpoint_hit.node_name, - watchpoint_hit.slot) - if watchpoint_hit not in watchpoint_hits: - watchpoint_hits.append(watchpoint_hit) - - def _get_watchpoints_by_tensor_name(self, graph_name, node_name, slot): - """ - Get hit tensors according to ui node name and slot. - - Args: - node_name (str): The node name. - slot (str): The tensor slot. - - Returns: - list, list of watchpoints. - """ - index = self._multi_graph_hits.get((graph_name, node_name)) - if index is None: - hit_node = {} - self._ordered_hits.append(hit_node) - index = len(self._ordered_hits) - 1 - self._multi_graph_hits[(graph_name, node_name)] = index - - hit_node = self._ordered_hits[index] - hit_tensors = hit_node.get(slot) - if hit_tensors is None: - hit_tensors = [] - hit_node[slot] = hit_tensors - - return hit_tensors - - def get(self, filter_condition=None): - """ - Get watchpoint hit list. - - Args: - filter_condition (str): Get the watchpoint hit according to specified node name. - If not given, get all watchpoint hits. Default: None. - - Returns: - dict, the watchpoint hit list. - """ - reply = None - if filter_condition is None: - log.debug("Get all watchpoint hit list.") - reply = self.get_watchpoint_hits() - else: - log.debug("Get the watchpoint for node: <%s>.", filter_condition) - index = self._multi_graph_hits.get(("", filter_condition)) - if index is not None: - reply = self._ordered_hits[index] - return reply - - def group_by(self, group_condition): - """ - Return the watchpoint hits by group condition. - - Args: - group_condition (dict): The group conditions. - - - limit (int): The limit number of watchpoint hits each page. - - offset (int): The page offset. - - focused_node (dict): The focused node. - If the specified node is hit, return the page where the node is located. - - - node_name (str): The retrieved node name. - - graph_name (str): The retrieved graph name. - - graph_id (int): The graph id. - - watchpoint_id (int): The watchpoint id. - - Returns: - dict, the watchpoint hit list. - """ - if not isinstance(group_condition, dict): - log.error("The parameter should be dict") - raise DebuggerParamTypeError("The parameter should be dict.") - log.debug("Group watch_point_hits by group_condition: %s.", group_condition) - limit = group_condition.get('limit', 0) - if not isinstance(limit, int) or limit <= 0: - log.error("Param 'limit' is invalid or absent. 'limit' should be a positive integer.") - raise DebuggerParamValueError("Param 'limit' is invalid or absent. 'limit' should be a positive integer.") - # Get all watch_point_hit info - watch_point_hits = [] - for watch_point_hit in self._ordered_hits: - self._get_tensors(watch_point_hit, watch_point_hits) - - graph_id = group_condition.get('graph_id') - watchpoint_id = group_condition.get('watchpoint_id') - - # Filter by graph and watch_point - if graph_id: - log.debug("Filter by graph: %s", graph_id) - watch_point_hits = self._filter_by_graph(graph_id, watch_point_hits) - else: - watch_point_hits.sort(key=lambda hit: int(hit['graph_id'].split("_")[-1])) - if watchpoint_id: - log.debug("Filter by watchpoint: %s.", watchpoint_id) - watch_point_hits = self._filter_by_watchpoint(watchpoint_id, watch_point_hits) - - total = len(watch_point_hits) - focused_node = group_condition.get('focused_node') - if focused_node is None: - watch_point_hits = self._get_by_offset(group_condition, watch_point_hits) - else: - watch_point_hits = self._get_by_name(group_condition, watch_point_hits) - reply = {} - if watch_point_hits: - reply = {'offset': group_condition.get('offset', 0), - 'total': total, - 'watch_point_hits': watch_point_hits - } - return reply - - def _filter_by_graph(self, graph_id, watch_point_hits): - """Return the list of watchpoint hits filtered by graph_id.""" - if not isinstance(graph_id, str): - log.error("Param graph_id is not a string.") - raise DebuggerParamValueError("Param graph_id is not a string.") - log.debug("Filter by graph: %s.", graph_id) - filtered_watchpoint_hits = [] - log.debug("Before filtering, watch_point_hits are: %s.", watch_point_hits) - for watch_point_hit in watch_point_hits: - if watch_point_hit['graph_id'] == graph_id: - filtered_watchpoint_hits.append(watch_point_hit) - log.debug("Filtered watch_point_hits: %s", filtered_watchpoint_hits) - return filtered_watchpoint_hits - - def _filter_by_watchpoint(self, watchpoint_id, watch_point_hits): - """Return the list of watchpoint hits filtered by watchpoint_id""" - if not isinstance(watchpoint_id, int): - log.error("Param watchpoint_id is not an integer.") - raise DebuggerParamValueError("Param watchpoint_id is not an integer.") - log.debug("Filter by watchpoint: %s", watchpoint_id) - log.debug("Before filtering, watch_point_hits are: %s.", watch_point_hits) - filtered_watchpoint_hits = [] - for watch_point_hit in watch_point_hits: - if watchpoint_id in watch_point_hit['watchpoint_id']: - filtered_watchpoint_hits.append(watch_point_hit) - - log.debug("Filtered watch_point_hits: %s", filtered_watchpoint_hits) - return filtered_watchpoint_hits - - def _get_by_offset(self, group_condition, watch_point_hits): - """Return the list of watchpoint hits on the offset page.""" - limit = group_condition.get('limit', 10) - offset = group_condition.get('offset', 0) - if not isinstance(limit, int) or not isinstance(offset, int): - log.error("Param limit or offset is not a integer") - raise DebuggerParamValueError("Param limit or offset is not a integer") - - total = len(watch_point_hits) - - if limit * offset >= total and offset != 0: - log.error("Param offset out of bounds") - raise DebuggerParamValueError("Param offset out of bounds") - - if total == 0: - return [] - - hits_in_offset = [] - for hit in watch_point_hits[(limit * offset): (limit * (offset + 1))]: - hits_in_offset.append(hit) - - return hits_in_offset - - def _get_by_name(self, group_condition, watch_point_hits): - """Return the list of watchpoint hits by the group condition.""" - limit = group_condition.get('limit') - focused_node = group_condition.get('focused_node') - if not isinstance(focused_node, dict): - log.error("Param focused_node is not a dict.") - raise DebuggerParamValueError("Param focused_node is not a dict.") - - graph_name = focused_node.get('graph_name') - node_name = focused_node.get('node_name') - index = None - for i, watch_point_hit in enumerate(watch_point_hits): - if watch_point_hit['graph_name'] == graph_name and watch_point_hit['node_name'] == node_name: - index = i - break - - if index is not None: - group_condition['offset'] = index//limit - - return self._get_by_offset(group_condition, watch_point_hits) - - def get_watchpoint_hits(self): - """Return the list of watchpoint hits.""" - log.debug("Get watch_point_hits.") - watch_point_hits = [] - for watchpoint_hits in self._ordered_hits: - self._get_tensors(watchpoint_hits, watch_point_hits) - log.debug("Watch_point_hits: %s.", watch_point_hits) - - return {'watch_point_hits': watch_point_hits} - - def _get_tensors(self, watchpoint_hits, watch_point_hits): - """Get the tensors info for the watchpoint_hits.""" - log.debug("Get tensors for watch_point_hits.") - tensors = [] - graph_name = None - node_name = None - watchpoint_ids = [] - for slot, tensor_hits in watchpoint_hits.items(): - if graph_name is None: - graph_name = tensor_hits[0].graph_name - if node_name is None: - node_name = tensor_hits[0].node_name - tensor_info = self._get_tensor_hit_info(slot, tensor_hits) - tensors.append(tensor_info) - for tensor_hit in tensor_hits: - watch_point = tensor_hit.watchpoint - watchpoint_id = watch_point['id'] - watchpoint_ids.append(watchpoint_id) - - watch_point_hits.append({ - 'node_name': node_name, - 'tensors': tensors, - 'graph_name': graph_name, - 'graph_id': graph_name, - 'watchpoint_id': watchpoint_ids - }) - - @staticmethod - def _get_tensor_hit_info(slot, tensor_hits): - """ - Get watchpoint hit info of specified tensor. - - Args: - slot (str): Slot id. - tensor_hits (list): A list of watchpoint hit objects that the tensor hit. - - Returns: - dict, tensor hit info. - """ - res = {} - watch_points = [] - - for tensor_hit in tensor_hits: - error_code = tensor_hit.error_code - error_list = _get_error_list(error_code) - watchpoint = tensor_hit.watchpoint - watchpoint['error_code'] = error_code - watchpoint['error_list'] = error_list - watch_points.append(watchpoint) - - if watch_points: - watch_points.sort(key=lambda watch_point: watch_point.get('id')) - res = { - 'slot': slot, - 'watch_points': watch_points - } - return res - - def _is_tensor_hit(self, tensor_name, graph_name): - """ - Check if the tensor is record in hit cache. - - Args: - tensor_name (str): The name of ui tensor name. - graph_name (str): The name of ui graph name - - Returns: - bool, if the tensor is hit. - """ - node_name, slot = tensor_name.rsplit(':', 1) - index = self._multi_graph_hits.get((graph_name, node_name)) - if index is not None: - watchpoint_hits = self._ordered_hits[index].get(slot) - return bool(watchpoint_hits) - return False - - def update_tensor_history(self, tensor_history): - """ - Add hit flag to tensor history. - - Args: - tensor_history (dict): The tensor history. - """ - if not self._multi_graph_hits: - return - - # add hit tensor names to `tensor_names` - for tensor_info in tensor_history.get('tensor_history'): - tensor_name = tensor_info['name'] - graph_name = tensor_info['graph_name'] - hit_flag = self._is_tensor_hit(tensor_name, graph_name) - tensor_info['is_hit'] = hit_flag - - def get_tensor_hit_infos(self, tensor_name, graph_name): - """ - Get all hit information of a tensor. - - Args: - tensor_name (str): Tensor name showed on UI. - - Returns: - dict, tensor hit info. - """ - tensor_hit_info = {} - if self._is_tensor_hit(tensor_name, graph_name): - node_name, slot = tensor_name.rsplit(':', 1) - tensor_hits = self._get_watchpoints_by_tensor_name(graph_name, node_name, slot) - tensor_hit_info = self._get_tensor_hit_info(slot, tensor_hits) - return tensor_hit_info - - -def validate_watch_condition(condition_mgr, watch_condition): - """Validate watch condition.""" - if not isinstance(watch_condition, dict): - log.error(" should be dict. %s received.", watch_condition) - raise DebuggerParamTypeError(" should be dict.") - # validate condition_id - condition_id = watch_condition.get('id') - if condition_id not in condition_mgr.conditions.keys(): - log.error("Invalid watch condition. Acceptable values are <%s>. %s received.", - str(condition_mgr.conditions.keys()), condition_id) - raise DebuggerParamValueError("Invalid watch condition value.") - # validate param - validate_watch_condition_params(condition_mgr, watch_condition) - - -def validate_watch_condition_params(condition_mgr, watch_condition): - """ - Validate watch condition parameters. - - Args: - condition_mgr (ConditionMgr): Instance of ConditionMgr. - watch_condition (dict): Watch condition. - - - id (str): Condition id. Should be in WATCHPOINT_CONDITION_MAPPING. - - param (list): Condition value. Should be given for comparison condition. The value - will be translated to np.float32. - """ - condition_id = watch_condition.get('id') - params = watch_condition.get('params') - condition = condition_mgr.get_condition(condition_id) - if condition_id in condition_mgr.get_no_param_condition(): - if params: - log.error("No param is expected for %s condition", condition_id) - raise DebuggerParamValueError("No param is expected.") - return - - check_param_num = 0 - support_params = set() - defined_support_params = set() - range_param = {RANGE_START: None, RANGE_END: None} - for param in params: - if len(param) > 2: - log.error("Invalid param keys for condition: %s", condition_id) - raise DebuggerParamValueError("Invalid param keys.") - - condition_param_name = param.get("name") - if condition_param_name not in condition.names: - log.error("Invalid name of parameter for condition: %s, available values: %s", - condition_id, condition.names) - raise DebuggerParamValueError("Invalid name of parameter.") - - condition_param = condition.get_parameter_definition(condition_param_name) - validate_param_type(condition_id, condition_param, param) - - if not condition_param.is_valid(param.get("value")): - log.error("Param %s out of range for condition: %s", condition_param_name, condition_id) - raise DebuggerParamValueError("Parameter out of range.") - - if condition_param.param_type == ParamTypeEnum.CHECK_PARAM.value: - if condition_param.required_params: - defined_support_params = set(condition_param.required_params) - check_param_num += 1 - else: - support_params.add(condition_param.name) - - if condition_param_name in range_param: - range_param[condition_param_name] = param.get("value") - - if check_param_num > 1: - log.error("Multiple check params for condition: %s", condition_id) - raise DebuggerParamValueError("Multiple check params.") - - if support_params != defined_support_params: - log.error("Invalid support params for condition: %s", condition_id) - raise DebuggerParamValueError("Invalid support params.") - - if range_param.get(RANGE_START) is not None and \ - range_param.get(RANGE_END) is not None and range_param.get(RANGE_START) > \ - range_param.get(RANGE_END): - log.error("Invalid support params for condition: %s", condition_id) - raise DebuggerParamValueError("Invalid support params.") - - -def validate_param_type(condition_id, condition_param, param): - """ - Validate parameter type. - - Args: - condition_id (str): Condition id. Should be in WATCHPOINT_CONDITION_MAPPING. - condition_param (ConditionParameter): Condition Parameter object. - param (dict): Condition parameter value. - """ - if condition_param.type.name in (ValueTypeEnum.FLOAT64.name, ValueTypeEnum.INT64.name) \ - and (not isinstance(param.get("value"), (float, int)) or isinstance(param.get("value"), bool)): - log.error("Number param should be given for condition: %s", condition_id) - raise DebuggerParamValueError("Number param should be given.") - if condition_param.type.name == ValueTypeEnum.BOOL.name \ - and not isinstance(param.get("value"), bool): - log.error("Bool param should be given for condition: %s", condition_id) - raise DebuggerParamValueError("Bool param should be given.") - - -def set_default_param(condition_mgr, watch_condition): - """ - Set default param. - Args: - condition_mgr (ConditionMgr): Instance of ConditionMgr. - watch_condition (dict): The watch condition. - "condition": { - id: "tensor_too_large", - "params": [ - { - "name": "abs_mean_gt", - "value": 1.1 - } - ] - } - - - id (str): Id of condition. - - param (list[dict]): The list of param for this condition. - - Returns: - dict, the new watch_condition. - """ - condition_id = watch_condition.get('id') - condition = condition_mgr.get_condition(condition_id) - for param in condition.parameters: - if not param.visible_on_ui and not param.support_disable: - watch_condition["params"].append({ - "name": param.name, - "value": param.default_value - }) - watch_condition["abbr"] = condition.abbr - return watch_condition - - -def _get_error_list(error_code): - """ - Get error list. - Args: - error_code (int): The code of errors. - - Returns: - list, the error list. - """ - all_error_list = ["nan", "inf", "no_prev_tensor", "out_of_mem", "no_history"] - error_list = [] - for i, error_str in enumerate(all_error_list): - error = (error_code >> i) & 1 - if error == 1: - error_list.append(error_str) - - return error_list - - -def validate_rank_id(rank_id, device_amount): - """validate rank id""" - if rank_id >= device_amount: - log.debug("The rank id %d over device amount.", rank_id) diff --git a/mindinsight/debugger/stream_operator/__init__.py b/mindinsight/debugger/stream_operator/__init__.py deleted file mode 100644 index e0a45cbe..00000000 --- a/mindinsight/debugger/stream_operator/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""This package contains operators using multiple streams to deal with specific task.""" diff --git a/mindinsight/debugger/stream_operator/graph_runs_operator.py b/mindinsight/debugger/stream_operator/graph_runs_operator.py deleted file mode 100644 index e6ab6176..00000000 --- a/mindinsight/debugger/stream_operator/graph_runs_operator.py +++ /dev/null @@ -1,131 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""This module is aimed to provide with GraphRuns.""" -from collections import defaultdict -from dataclasses import field, dataclass, asdict -from typing import List - -from mindinsight.debugger.common.exceptions.exceptions import DebuggerHistoryNotFoundError, \ - DebuggerHistoryValueError -from mindinsight.debugger.common.log import LOGGER as log -from mindinsight.debugger.common.utils import Streams, enter_tag - - -@dataclass -class GraphRun: - """Graph run data class.""" - count: int = 0 - graph_name: str = 'None' - has_data: bool = False - sub_graph_names: List[str] = field(default_factory=list) - - @staticmethod - def _get_graph_id(graph_name): - """Get graph id by graph name.""" - graph_id_str = graph_name.rsplit('_', 1)[-1] - graph_id = int(graph_id_str) if graph_id_str.isdigit() else 0 - return graph_id - - def __lt__(self, other): - if self.count != other.count: - return self.count < other.count - cur_graph_id = self._get_graph_id(self.graph_name) - other_graph_id = self._get_graph_id(other.graph_name) - return cur_graph_id < other_graph_id - - -class GraphRunsOperator: - """Manage Graph runs information.""" - - def __init__(self, cache): - self._cache = cache - self._multi_card_graph_stream = cache.get_stream_handler(Streams.GRAPH) - self._graph_history_stream = cache.get_stream_handler(Streams.GRAPH_HISTORY) - - def get_graph_runs(self, rank_id): - """ - Get graph runs info of specified rank. - - Args: - rank_id (int): The rank id. - - Returns: - dict, the graph runs. The format is like {'graph_runs': List[GraphRun]} - The GraphRun object = { - "count": int, - "graph_name": str, - "has_data": bool, - "sub_graph_names": List[str] - } - """ - graph_history = self._graph_history_stream.get(rank_id) - graph_run_count = graph_history.get_total_count() - if not graph_run_count: - log.warning("No graph runs found.") - return {'graph_runs': []} - graph_run_map = self.get_basic_graph_runs(rank_id) - graph_run_map = self.update_has_data_field(graph_run_map, rank_id) - res = self.get_sorted_graph_runs(graph_run_map) - return {'graph_runs': res} - - @enter_tag - def get_basic_graph_runs(self, rank_id): - """ - Get basic graph runs. - - Args: - rank_id (int): The rank id. - - Returns: - dict, the key is count id, the value is dict of . - """ - graph_history = self._graph_history_stream.get(rank_id) - root_graphs = self._multi_card_graph_stream.get_graph_handler_by_rank_id(rank_id).root_graphs - graph_run_map = defaultdict(dict) - for root_graph_id, graph_run_ids in graph_history.history.items(): - root_graph = root_graphs.get(root_graph_id) - if root_graph is None: - log.error("Didn't find relative graph info of graph %s. " - "Please check the dump structure.", root_graph_id) - raise DebuggerHistoryNotFoundError(root_graph_id) - for graph_run_id in graph_run_ids: - graph_run = GraphRun(count=graph_run_id + 1, - graph_name=root_graph.graph_name, - sub_graph_names=root_graph.sub_graph_names) - graph_run_map[graph_run_id][root_graph_id] = graph_run - return graph_run_map - - def update_has_data_field(self, graph_run_map, rank_id): - """Update has_data field in GraphRun.""" - dumped_steps = self._graph_history_stream.get_dumped_step(rank_id) - for root_graph_id, dumped_steps in dumped_steps.items(): - for step_id in dumped_steps: - graph_run = graph_run_map.get(step_id, {}).get(root_graph_id) - if graph_run is None: - log.error("Didn't find step_id %s in graph history of rank %s", step_id, rank_id) - raise DebuggerHistoryValueError(root_graph_id) - graph_run.has_data = True - return graph_run_map - - @staticmethod - def get_sorted_graph_runs(graph_run_map): - """Turn graph run map into ordered list.""" - graph_runs = [] - for graph_runs_per_step in graph_run_map.values(): - for graph_run in graph_runs_per_step.values(): - graph_runs.append(graph_run) - graph_runs.sort() - graph_runs = [asdict(graph_run) for graph_run in graph_runs] - return graph_runs diff --git a/mindinsight/debugger/stream_operator/tensor_detail_info.py b/mindinsight/debugger/stream_operator/tensor_detail_info.py deleted file mode 100644 index 3bc62109..00000000 --- a/mindinsight/debugger/stream_operator/tensor_detail_info.py +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""This module is aimed to provide with tensor detail info.""" -from mindinsight.debugger.common.exceptions.exceptions import DebuggerParamValueError -from mindinsight.debugger.common.log import LOGGER as log -from mindinsight.debugger.common.utils import Streams, create_view_event_from_tensor_basic_info, ViewCommandLevelEnum - - -class TensorDetailInfo: - """Manage tensor detail information.""" - - def __init__(self, cache): - self._put_command = cache.put_command - self._metadata_stream = cache.get_stream_handler(Streams.METADATA) - self._multi_card_tensor_stream = cache.get_stream_handler(Streams.TENSOR) - self._multi_card_graph_stream = cache.get_stream_handler(Streams.GRAPH) - self._multi_card_hit_stream = cache.get_stream_handler(Streams.WATCHPOINT_HIT) - - def validate_tensor_name(self, tensor_name, graph_name, rank_id): - """ - Get the graph id of the tensor. - - Args: - tensor_name (str): The tensor name on UI. - graph_name (str): The graph name. - rank_id (int): The rank id. - """ - # validate tensor name format - if not isinstance(tensor_name, str) or ':' not in tensor_name: - log.error("Invalid tensor name. Received: %s", tensor_name) - raise DebuggerParamValueError("Invalid tensor name.") - node_name, _ = tensor_name.rsplit(':', 1) - # check if the node name is in graph - self._multi_card_graph_stream.get_graph_handler_by_rank_id(rank_id).validate_node_name(node_name=node_name, - graph_name=graph_name) - - def get_tensor_graph(self, tensor_name, graph_name, rank_id=0): - """ - Get the graph related to specific tensor. - - Args: - tensor_name (str): The ui name of tensor. Format like {node_name}:{slot}. - graph_name (str): The graph name. - rank_id (int): The rank id. - - Returns: - dict, tensor graph, format is {'nodes': [Node object]}. - The Node object = { - 'graph_name': , - 'full_name': , - 'type': , - 'stack_info': [] - 'name': , - 'input': {: }, - 'output: {: }, - 'slots': []. - } - Edge object = { - 'data_type': , - 'edge_type': , - 'independent_layout': bool, - 'shape': list[], - 'slot_mapping': list[pair], - }. - """ - self.validate_tensor_name(tensor_name=tensor_name, graph_name=graph_name, rank_id=rank_id) - graph = self._multi_card_graph_stream.get_graph_handler_by_rank_id(rank_id).get_tensor_graph(tensor_name, - graph_name) - # add watchpoint hits info and statistics info for each tensor in tensor graph. - # record missing tensor basic info - nodes = graph.get('graph', {}).get('nodes', []) - missing_tensors = [] - for node in nodes: - node['graph_name'] = graph_name - for slot_info in node.get('slots', []): - self._add_watchpoint_hit_info(slot_info, node, graph_name, rank_id) - self._add_tensor_info(slot_info, node, missing_tensors, rank_id) - # query missing tensor values from client - self._ask_for_missing_tensor_value(missing_tensors, tensor_name, graph_name) - return graph - - def _add_watchpoint_hit_info(self, slot_info, node, graph_name, rank_id): - """ - Add watchpoint hit info for the tensor. - - Args: - slot_info (dict): Slot object. - node (dict): Node object. - graph_name (str): Graph name. - """ - tensor_name = ':'.join([node.get('name'), slot_info.get('slot')]) - if self._multi_card_hit_stream.check_rank_id(rank_id=rank_id): - slot_info.update( - self._multi_card_hit_stream.get_hit_handler_by_rank_id(rank_id).get_tensor_hit_infos(tensor_name, - graph_name)) - - def _add_tensor_info(self, slot_info, node, missing_tensors, rank_id): - """ - Add the tensor info and query for missed tensors. - - Args: - slot_info (dict): Slot object. - node (dict): Node object. - missing_tensors (list[TensorBasicInfo]): List of missing tensor infos. - """ - tensor_name = ':'.join([node.get('full_name'), slot_info.get('slot')]) - node_type = node.get('type') - tensor_info, cur_missing_tensors = self._multi_card_tensor_stream.get_tensor_handler_by_rank_id( - rank_id).get_tensor_info_for_tensor_graph(tensor_name, node_type, self._metadata_stream.step) - slot_info.update(tensor_info) - if cur_missing_tensors: - log.debug("Get missing tensor basic infos for %s", tensor_name) - missing_tensors.extend(cur_missing_tensors) - - def _ask_for_missing_tensor_value(self, missing_tensors, tensor_name, graph_name): - """ - Send view command to client to query for missing tensor values. - - Args: - missing_tensors (list[TensorBasicInfo]): List of missing tensor basic infos. - tensor_name (str): The ui name of tensor. Format like {node_name}:{slot}. - graph_name (str): The graph name. - """ - if not missing_tensors: - return - log.debug("Ask for tensor value for: %s", missing_tensors) - view_cmd = create_view_event_from_tensor_basic_info(missing_tensors) - self._put_command({'view_cmd': view_cmd, 'tensor_name': tensor_name, 'graph_name': graph_name, 'stats': True, - 'level': ViewCommandLevelEnum.STATS.value}) - log.debug("Send view cmd for tensor-graphs.") - - def get_tensor_watch_points(self, tensor_name, graph_name, rank_id=0): - """ - Get all watchpoints that the tensor hit. - - Args: - tensor_name (str): Tensor name from UI. - graph_name (str): The graph name. - rank_id (int): The rank id. - - Returns: - list, watchpoint hit infos. - """ - # validate tensor_name - self.validate_tensor_name(tensor_name=tensor_name, graph_name=graph_name, rank_id=rank_id) - # get watchpoint info that the tensor hit - if not self._multi_card_hit_stream.check_rank_id(rank_id=rank_id): - return [] - tensor_hit_info = self._multi_card_hit_stream.get_hit_handler_by_rank_id(rank_id).get_tensor_hit_infos( - tensor_name, graph_name) - watch_points = tensor_hit_info.get('watch_points', []) - return watch_points diff --git a/mindinsight/debugger/stream_operator/training_control_operator.py b/mindinsight/debugger/stream_operator/training_control_operator.py deleted file mode 100644 index 44bffee7..00000000 --- a/mindinsight/debugger/stream_operator/training_control_operator.py +++ /dev/null @@ -1,313 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""This module is aimed to deal with controlling commands.""" -import enum - -from mindinsight.debugger.common.exceptions.exceptions import DebuggerContinueError, DebuggerParamValueError, \ - DebuggerPauseError, DebuggerRecheckError, DebuggerStepNumError -from mindinsight.debugger.common.log import LOGGER as log -from mindinsight.debugger.common.utils import Streams, get_ack_reply, ServerStatus, RunLevel, is_scope_type, \ - DebuggerServerMode -from mindinsight.debugger.proto.debug_grpc_pb2 import RunCMD -from mindinsight.utils.exceptions import MindInsightException - - -@enum.unique -class ControlTypeEnum(enum.Enum): - """Control Type.""" - CONTINUE = 'continue' # continue to run training - PAUSE = 'pause' # suspend training - TERMINATE = 'terminate' # terminate training - RESET = 'reset' # reset the step_id in offline debugger - - -class TrainingControlOperator: - """Control training operator.""" - # max step number should be less than int32 - _MAX_STEP_NUM = 2 ** 31 - 1 - - def __init__(self, cache_store): - self._cache_store = cache_store - self._watchpoint_stream = cache_store.get_stream_handler(Streams.WATCHPOINT) - self._multi_card_graph_stream = cache_store.get_stream_handler(Streams.GRAPH) - self._metadata_stream = cache_store.get_stream_handler(Streams.METADATA) - - @staticmethod - def validate_mode(mode): - """Validate mode.""" - enum_members = [item.value for item in ControlTypeEnum] - if mode not in enum_members: - log.error("Invalid control mode %s", mode) - raise DebuggerParamValueError("Invalid control mode.") - - def control(self, mode, params): - """ - Control the training process. - - Args: - mode (str): Acceptable control command, including `continue`, - `pause` and `terminate`. - params (dict): The control params. - - - level (str): The control granularity, `node` level or `step` level. - Default: `step`. - - steps (int): Specify the steps that training should run. - Used when `level` is `step`. - - name (str): Specify the name of the node. Used when `level` is `node`. - - graph_name (str): The graph name. - - Returns: - dict, the response. - """ - if mode == ControlTypeEnum.CONTINUE.value: - reply = self.continue_training(params) - elif mode == ControlTypeEnum.RESET.value: - step_id = params['steps'] - reply = self.reset_training_step(step_id) - else: - mode_mapping = { - ControlTypeEnum.PAUSE.value: self.pause_training, - ControlTypeEnum.TERMINATE.value: self.terminate_training - } - reply = mode_mapping.get(mode)() - return reply - - def continue_training(self, params): - """ - Send RunCMD to MindSpore. - - Args: - params (dict): The control params. - - Returns: - dict, metadata info. - """ - metadata_stream = self._metadata_stream - if metadata_stream.state != ServerStatus.WAITING.value: - log.error("MindSpore is not ready to run. Current state is: %s", metadata_stream.state) - raise DebuggerContinueError( - "MindSpore is not ready to run or is running currently." - ) - metadata_stream.state = ServerStatus.SENDING.value - try: - self._validate_continue_params(params) - event = self._construct_run_event(params) - # whether need to send recheck before continue, especially for initialization watchpoint - recheck_flag = bool(self._metadata_stream.step == 0 and self._watchpoint_stream.is_recheckable()) - self._send_watchpoints() - if recheck_flag: - self._cache_store.put_command(self._construct_run_event({'level': 'recheck'})) - log.info("Send recheck command for initialization watchpoints before continue command.") - self._cache_store.put_command(event) - except MindInsightException as err: - log.error("Failed to send run event.") - log.exception(err) - metadata_stream.state = ServerStatus.WAITING.value - raise DebuggerContinueError("Failed to send run command.") - else: - metadata_stream.enable_recheck = False - log.debug("Send the RunCMD to command queue.") - return metadata_stream.get(['state', 'enable_recheck']) - - def _validate_continue_params(self, params): - """ - Validate continue params. - - Args: - params (dict): The control params. - - - level (str): The control granularity, `node`, `step` or `recheck` level. - Default: `step`. - - steps (int): Specify the steps that training should run. - Used when `level` is `step`. - - name (str): Specify the name of the node. Used when `level` is `node`. - - graph_name (str): The graph name. - - Raises: - DebuggerParamValueError: Params are invalid. - DebuggerStepNumError: Step number are invalid. - """ - # validate level - level = params.get('level', 'step') - if level not in [RunLevel.NODE.value, RunLevel.STEP.value, RunLevel.RECHECK.value]: - log.error("Invalid Value. `level` should be `step`, `node` or `recheck`. Got %s", level) - raise DebuggerParamValueError("level` should be `step`, `node` or `recheck`.") - - # validate steps - step_num = params.get('steps', 1) - if not isinstance(step_num, int) or not (step_num == -1 or 0 < step_num <= self._MAX_STEP_NUM): - log.error("Invalid step value. Step number should be integer and in [1, 2^31 - 1] or -1.") - raise DebuggerStepNumError - - # validate node name - if level == RunLevel.NODE.value: - node_name = params.get('name') - graph_name = params.get('graph_name') - rank_id = params.get('rank_id', 0) - self._validate_continue_node_name(node_name, graph_name, rank_id) - - def _validate_continue_node_name(self, node_name, graph_name, rank_id): - """Validate if the node is a leaf node.""" - if not node_name: - return - node_type = self._multi_card_graph_stream.get_graph_handler_by_rank_id(rank_id).get_node_type(node_name, - graph_name) - if is_scope_type(node_type): - log.error("Scope type node has no tensor history.") - raise DebuggerParamValueError("Invalid leaf node name.") - - def _construct_run_event(self, params): - """ - Construct run cmd from input control params. - - Args: - params (dict): The control params. - - - level (str): The control granularity, `node`, `step` or `recheck` level. - Default: `step`. - - steps (int): Specify the steps that training should run. - Used when `level` is `step`. - - name (str): Specify the name of the node. Used when `level` is `node`. - - graph_name (str): The graph name. - - Returns: - EventReply, control event with run command. - """ - level = params.get('level', 'step') - # construct run command events - event = get_ack_reply() - if level == 'step': - steps = params.get('steps', 1) - run_cmd = RunCMD(run_level='step', run_steps=steps) - elif level == 'node': - name = params.get('name', '') - graph_name = params.get('graph_name') - if name: - rank_id = params.get('rank_id', 0) - name = self._multi_card_graph_stream.get_graph_handler_by_rank_id(rank_id).get_full_name(name, - graph_name) - run_cmd = RunCMD(run_level='node', node_name=name) - else: - run_cmd = RunCMD(run_level='recheck') - - event.run_cmd.CopyFrom(run_cmd) - log.debug("Construct run event. %s", event) - return event - - def _send_watchpoints(self): - """Send watchpoints to client.""" - set_commands = self._watchpoint_stream.get_pending_commands() - if not set_commands: - return - for set_cmd in set_commands: - event = get_ack_reply() - event.set_cmd.CopyFrom(set_cmd) - self._cache_store.put_command(event) - log.debug("Send SetCMD to MindSpore. %s", event) - - def pause_training(self): - """ - Pause the training. - - Returns: - dict, metadata info. - """ - metadata_stream = self._metadata_stream - if metadata_stream.state != ServerStatus.RUNNING.value: - log.error("The MindSpore is not running.") - raise DebuggerPauseError("The MindSpore is not running.") - metadata_stream.state = ServerStatus.SENDING.value - event = get_ack_reply() - event.run_cmd.CopyFrom(RunCMD(run_level='step', run_steps=0)) - self._cache_store.clean_command() - self._cache_store.put_command(event) - metadata_stream.enable_recheck = False - log.debug("Send the Pause command") - return metadata_stream.get(['state', 'enable_recheck']) - - def terminate_training(self): - """ - Terminate the training. - - Returns: - dict, metadata info. - """ - metadata_stream = self._metadata_stream - metadata_stream.state = ServerStatus.SENDING.value - self._cache_store.clean_data() - self._cache_store.clean_command() - event = get_ack_reply() - event.exit = True - self._cache_store.put_command(event) - metadata_stream.enable_recheck = False - log.debug("Send the ExitCMD.") - return metadata_stream.get(['state', 'enable_recheck']) - - def recheck(self): - """ - Recheck all watchpoints. - - Returns: - dict, metadata info. - """ - metadata_stream = self._metadata_stream - # validate backend status is able to recheck watchpoint - if not metadata_stream.enable_recheck: - log.error("Recheck is not available.") - raise DebuggerRecheckError("Recheck is not available.") - metadata_stream.state = ServerStatus.SENDING.value - metadata_stream.enable_recheck = False - # send updated watchpoint and recheck command - try: - event = self._construct_run_event({'level': 'recheck'}) - self._send_watchpoints() - self._cache_store.put_command(event) - except MindInsightException as err: - log.error("Failed to send recheck event.") - log.exception(err) - metadata_stream.state = ServerStatus.WAITING.value - metadata_stream.enable_recheck = True - raise DebuggerContinueError("Failed to send recheck command.") - else: - log.debug("Send the recheck to command queue.") - return metadata_stream.get(['state', 'enable_recheck']) - - def reset_training_step(self, step_id): - """ - Reset the training step. - - Args: - step_id (int): The target step_id. - - Returns: - dict, metadata info. - """ - metadata_stream = self._metadata_stream - if metadata_stream.debugger_type == DebuggerServerMode.ONLINE.value: - log.error("'step_id' can not be changed manually in online debugger.") - return metadata_stream.get(['state', 'enable_recheck', 'step']) - if step_id > metadata_stream.max_step_num: - log.error("Invalid step_id, step_id should be less than %d.", metadata_stream.max_step_num) - raise DebuggerParamValueError("Invalid step_id.") - metadata_stream.state = ServerStatus.SENDING.value - metadata_stream.step = step_id - self._cache_store.get_stream_handler(Streams.TENSOR).set_step(step_id) - self._cache_store.clean_data() - self._cache_store.clean_command() - metadata_stream.enable_recheck = True - metadata_stream.state = ServerStatus.WAITING.value - self._cache_store.get_stream_handler(Streams.WATCHPOINT).set_outdated() - log.debug("Send the Change_training_step CMD.") - return metadata_stream.get(['state', 'enable_recheck', 'step']) diff --git a/mindinsight/debugger/stream_operator/watchpoint_operator.py b/mindinsight/debugger/stream_operator/watchpoint_operator.py deleted file mode 100644 index 02db43ae..00000000 --- a/mindinsight/debugger/stream_operator/watchpoint_operator.py +++ /dev/null @@ -1,325 +0,0 @@ -# Copyright 2020 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""This module is aimed to deal with watchpoint commands.""" -from queue import Queue - -from mindinsight.debugger.common.exceptions.exceptions import DebuggerParamValueError, \ - DebuggerCreateWatchPointError, DebuggerUpdateWatchPointError, \ - DebuggerDeleteWatchPointError, DebuggerConditionUnavailableError -from mindinsight.debugger.common.log import LOGGER as log -from mindinsight.debugger.common.utils import ServerStatus, \ - Streams, is_cst_type, is_scope_type -from mindinsight.debugger.conditionmgr.condition import ConditionIdEnum, ConditionContext -from mindinsight.debugger.conditionmgr.recommender import get_basic_node_info -from mindinsight.debugger.stream_handler.watchpoint_handler import validate_watch_condition - - -class WatchpointOperator: - """Watchpoint Operator.""" - - def __init__(self, cache_store, condition_mgr): - self._watchpoint_stream = cache_store.get_stream_handler(Streams.WATCHPOINT) - self._multi_card_graph_stream = cache_store.get_stream_handler(Streams.GRAPH) - self._metadata_stream = cache_store.get_stream_handler(Streams.METADATA) - self._device_stream = cache_store.get_stream_handler(Streams.DEVICE) - self._condition_mgr = condition_mgr - - def create_watchpoint(self, params): - """ - Create watchpoint. - - Args: - - watch_condition (dict): The watch condition. The format is like: - - .. code-block:: - - { - "id": "tensor_too_large", - "params": [{ - "name": "abs_mean_gt", - "value": 1.1 - }] - } - - - id (str): Id of condition. - - params (list[dict]): The list of param for this condition. - - watch_nodes (list[str]): The list of node names. - - watch_point_id (int): The id of watchpoint. - - search_pattern (dict): The search pattern. - - graph_name (str): The relative graph_name of the watched node. - - Returns: - dict, the id of new watchpoint and metadata info. - """ - watch_condition = params.get('watch_condition') - log.info("Received create watchpoint request. WatchCondition: %s", watch_condition) - metadata_stream = self._metadata_stream - if metadata_stream.state != ServerStatus.WAITING.value: - log.error("Failed to create watchpoint as the MindSpore is not in waiting state.") - raise DebuggerCreateWatchPointError( - "Failed to create watchpoint as the MindSpore is not in waiting state.") - self._validate_watch_condition(watch_condition) - - validate_watch_condition(self._condition_mgr, watch_condition) - condition_id = watch_condition.get('id') - condition = self._condition_mgr.get_condition(condition_id) - condition_context = ConditionContext(metadata_stream.backend, metadata_stream.step) - if not condition.is_available(condition_context): - log.error("Failed to create watchpoint as the condition is not available.") - raise DebuggerConditionUnavailableError( - "Failed to create watchpoint as the condition is not available.") - - watch_nodes = get_basic_node_info(condition.supported_target_type.value, self._multi_card_graph_stream) - watchpoint_stream = self._watchpoint_stream - watch_point_id = watchpoint_stream.create_watchpoint(condition_mgr=self._condition_mgr, - watch_condition=watch_condition, - watch_nodes=watch_nodes, - watch_point_id=params.get('watch_point_id'), - device_amount=self._device_stream.device_amount) - log.info("Create watchpoint %d", watch_point_id) - - metadata_stream.enable_recheck = watchpoint_stream.is_recheckable() - res = metadata_stream.get(['state', 'enable_recheck']) - res['id'] = watch_point_id - return res - - def _validate_watch_condition(self, watch_condition): - """Validate watch condition.""" - metadata_stream = self._metadata_stream - if metadata_stream.backend == 'GPU' and watch_condition.get('id') == ConditionIdEnum.OPERATOR_OVERFLOW.value: - log.error("GPU doesn't support overflow watch condition.") - raise DebuggerParamValueError("GPU doesn't support overflow watch condition.") - - def update_watchpoint(self, params): - """ - Update watchpoint. - - Args: - params (dict): Params for update watchpoint. - - - watch_point_id (int): The id of watchpoint. - - watch_nodes (list[str]): The list of node names. - - mode (int): The update operator on nodes. 0 for remove nodes from watch nodes. - 1 for add nodes to watch nodes. - - search_pattern (dict): The search pattern. - - graph_name (str): The relative graph_name of the watched node. - - rank_id (int): The rank id. - - Returns: - dict, the metadata info. - """ - metadata_stream = self._metadata_stream - if metadata_stream.state != ServerStatus.WAITING.value: - log.error("Failed to update watchpoint as the MindSpore is not in waiting state.") - raise DebuggerUpdateWatchPointError( - "Failed to update watchpoint as the MindSpore is not in waiting state." - ) - # validate parameter - watchpoint_stream = self._watchpoint_stream - watch_point_id = params.get('watch_point_id') - watch_nodes = params.get('watch_nodes') - if not watch_nodes or not watch_point_id: - log.error("Invalid parameter for update watchpoint.") - raise DebuggerParamValueError("Invalid parameter for update watchpoint.") - watchpoint_stream.validate_watchpoint_id(watch_point_id) - # get node basic info for watch nodes - watch_nodes = self._get_watch_node_with_basic_info( - node_names=params.get('watch_nodes'), - search_pattern=params.get('search_pattern'), - graph_name=params.get('graph_name'), - rank_id=params.get('rank_id', 0)) - watchpoint_stream.update_watchpoint(watch_point_id, watch_nodes, params.get('mode'), params.get('rank_id', 0)) - metadata_stream.enable_recheck = watchpoint_stream.is_recheckable() - log.info("Update watchpoint with id: %d", watch_point_id) - return metadata_stream.get(['state', 'enable_recheck']) - - def _get_watch_node_with_basic_info(self, node_names, search_pattern=None, graph_name=None, rank_id=0): - """ - Get watch node with basic info. - - Args: - node_names (list[str]): A list of node names. - search_pattern (dict): Get watch node with search pattern. Default: None - graph_name (str): The relative graph_name of the watched node. Default: None. - rank_id (int): The rank id. - - Returns: - list[NodeBasicInfo], a list of node basic infos. - """ - if not node_names: - return [] - graph_name = self._multi_card_graph_stream.get_graph_handler_by_rank_id(rank_id).validate_graph_name(graph_name) - if search_pattern is not None: - watch_nodes = self._get_watch_nodes_by_search(node_names, search_pattern, graph_name, rank_id) - else: - watch_nodes = self._get_node_basic_infos(node_names, graph_name=graph_name, rank_id=rank_id) - return watch_nodes - - def _get_watch_nodes_by_search(self, node_names, search_pattern, graph_name, rank_id): - """ - Get watched leaf nodes by search name. - - Args: - node_names (list[str]): A list of node names. - search_pattern (dict): Get watch node with search pattern. - - - name (str): The name pattern. - - node_category (str): The node_category. - graph_name (str): The relative graph_name of the watched node. - - Returns: - list[NodeBasicInfo], a list of node basic infos. - """ - search_pattern['graph_name'] = graph_name - search_nodes = self._multi_card_graph_stream.get_graph_handler_by_rank_id(rank_id).search_nodes(search_pattern) - watch_node_names = set() - for name in node_names: - names = self._get_watch_names_by_search(search_nodes, name) - watch_node_names.update(names) - watch_node_info = self._get_node_basic_infos(watch_node_names, graph_name=graph_name) - log.debug("Update nodes: %s", watch_node_info) - - return watch_node_info - - def _get_watch_names_by_search(self, search_nodes, target_node_name): - """ - Get watch names according to search results. - - Args: - search_nodes (dict): Search result. - The format is like {'nodes': []}. The format is like - {'name': , 'type': , 'nodes': []} - target_node_name (str): Node name for UI. - - Returns: - set[str], collection of names. - """ - names = set() - tmp_queue = Queue() - tmp_queue.put(search_nodes) - while not tmp_queue.empty(): - cur_node = tmp_queue.get() - for node in cur_node.get('nodes'): - node_name = node.get('name') - if not target_node_name.startswith(node_name) or is_cst_type(node.get('type')): - continue - if target_node_name == node_name: - self._add_leaf_node_collection(node, names) - return names - tmp_queue.put(node) - # the target node name is not in search nodes. - log.debug("node %s is not in search nodes.") - names.add(target_node_name) - return names - - def _add_leaf_node_collection(self, node, names): - """ - Get leaf node collection in search node object. - - Args: - node (dict): Search Node object. - names (set): Set of node names. - """ - # if the node is leaf node - if not node.get('nodes'): - names.add(node.get('name')) - return - # traverse the search node object - for sub_node in node.get('nodes'): - self._add_leaf_node_collection(sub_node, names) - - def delete_watchpoint(self, watch_point_id=None): - """ - Delete watchpoint. - - Args: - watch_point_id (Union[None, int]): The id of watchpoint. - If None, delete all watchpoints. Default: None. - - Returns: - dict, the metadata info. - """ - metadata_stream = self._metadata_stream - if metadata_stream.state != ServerStatus.WAITING.value: - log.error("Failed to delete watchpoint as the MindSpore is not in waiting state.") - raise DebuggerDeleteWatchPointError( - "Failed to delete watchpoint as the MindSpore is not in waiting state." - ) - watchpoint_stream = self._watchpoint_stream - watchpoint_stream.delete_watchpoint(watch_point_id) - metadata_stream.enable_recheck = watchpoint_stream.is_recheckable() - log.info("Delete watchpoint with id: %s", watch_point_id) - return metadata_stream.get(['state', 'enable_recheck']) - - def _get_node_basic_infos(self, node_names, graph_name=None, rank_id=0): - """ - Get watch node info according to node names. - - Args: - node_names (Union[set[str], list[str]]): A collection of node names. - graph_name (str): The relative graph_name of the watched node. Default: None. - - Returns: - list[NodeBasicInfo], a list of basic watch nodes info. - """ - if not node_names: - return [] - graph_stream = self._multi_card_graph_stream.get_graph_handler_by_rank_id(rank_id) - node_infos = [] - for node_name in node_names: - node_info = graph_stream.get_node_basic_info(node_name, graph_name) - if not is_cst_type(node_info.type): - node_infos.append(node_info) - - return node_infos - - @staticmethod - def add_set_cmd_detail(set_cmd, watchpoint_stream, multi_card_graph_stream): - """Add watch node and watch condition into set_cmd.""" - watchpoint = watchpoint_stream.get_watchpoint_by_id(set_cmd.id) - watch_nodes_for_devices = watchpoint.get_watch_nodes() - leaf_watch_nodes_for_devices = {} - for rank_id, watch_nodes in watch_nodes_for_devices.items(): - graph_stream = multi_card_graph_stream.get_graph_handler_by_rank_id(rank_id) - leaf_watch_nodes = WatchpointOperator.expand_to_leaf_nodes(graph_stream, watch_nodes) - leaf_watch_nodes_for_devices[rank_id] = leaf_watch_nodes - watchpoint.add_set_cmd_detail(set_cmd, leaf_watch_nodes_for_devices) - - @staticmethod - def expand_to_leaf_nodes(graph_stream, watch_nodes): - """ - Get all leaf node basic info according to watch nodes. - - Args: - graph_stream (GraphHandler): Graph handler. - watch_nodes (list[NodeBasicInfo]): The list of watch node basic infos. - - Returns: - list[NodeBasicInfo], expanded leaf basic node infos. - """ - leaf_watch_nodes = [] - for node in watch_nodes: - if is_scope_type(node.type): - pure_node_name = '' - if len(node.name.split('/')) > 1: - graph_name, pure_node_name = node.name.split('/', 1) - else: - graph_name = node.name - search_node_infos = graph_stream.get_node_basic_info_by_scope(pure_node_name, graph_name=graph_name) - search_node_infos = [node_info for node_info in search_node_infos if not is_cst_type(node_info.type)] - leaf_watch_nodes.extend(search_node_infos) - else: - leaf_watch_nodes.append(node) - return leaf_watch_nodes diff --git a/mindinsight/parser/README.md b/mindinsight/parser/README.md deleted file mode 100644 index ef4ad668..00000000 --- a/mindinsight/parser/README.md +++ /dev/null @@ -1,81 +0,0 @@ -# DumpParser Introduction - -[查看中文](./README_CN.md) - -## API - -### mindinsight.parser.dump.DumpParser - -Dump Parser. - -Args: - -- dump_dir (str) - Dump directory path. - -#### convert_all_data_to_host() - -Convert all data to host format. - -Returns: - -- list, failed tensors. - -#### get_tensor_files(qs, use_regex=False, rank_ids=None, iterations=None) - -Get tensor files. - -Args: - -- qs (str): Query string. -- use_regex (bool): Indicates if query is regex. -- rank_ids (list): Selected rank IDs. -- iterations (list): Selected iterations. - -Returns: - -- dict, paths of tensor files. The format is like: `{[op_full_name]: OpPathManager}`. Call `OpPathManager.to_dict()`, the result is format like: - -```json -{'rank_[rank_id]': - {[iteration_id]: - { - 'input': list[file_path], - 'output': list[file_path] - } - } -} -``` - -### export_xlsx(output_dir=None) - -Export to excel file. - -Args: - -- output_dir (str): Output directory to save the excel file. Default is None. - -Returns: - -- str, excel file path. - -## Usage - -```python -from mindinsight.parser.dump import DumpParser - -# initialize DumpParser -dump_dir = '/path/to/dump/dir' -parser = DumpParser(dump_dir) - -# convert async dump files into host format -parser.convert_all_data_to_host() - -# filter operator nodes with keywords and return related tensor files info -qs = 'BatchNorm' -rank_ids = [1, 2] -tensor_mapping = parser.get_tensor_files(qs, rank_ids=rank_ids) - -# export graph node info to report file with excel format -output_dir = '/path/to/output/dir' -parser.export_xlsx(output_dir=output_dir) -``` diff --git a/mindinsight/parser/README_CN.md b/mindinsight/parser/README_CN.md deleted file mode 100644 index 4e259abf..00000000 --- a/mindinsight/parser/README_CN.md +++ /dev/null @@ -1,81 +0,0 @@ -# DumpParser介绍 - -[View English](./README.md) - -## 接口定义 - -### mindinsight.parser.dump.DumpParser - -Dump数据解析器。 - -参数: - -- dump_dir (str) - Dump数据目录路径。 - -#### convert_all_data_to_host() - -批量转换异步dump数据为host侧格式。 - -返回值: - -- list, 转换失败的tensor文件信息。 - -#### get_tensor_files(qs, use_regex=False, rank_ids=None, iterations=None) - -查询tensor文件信息。 - -参数: - -- qs (str): 查询关键字。 -- use_regex (bool): 标识查询关键字是否为正则表达式。 -- rank_ids (list): 选择指定的rank_ids。 -- iterations (list): 选择指定的迭代。 - -返回值: - -- dict, tensor文件路径信息, 结构为: `{[op_full_name]: OpPathManager}`. 调用`OpPathManager.to_dict()`, 返回结果结构如下: - -```json -{'rank_[rank_id]': - {[iteration_id]: - { - 'input': list[file_path], - 'output': list[file_path] - } - } -} -``` - -### export_xlsx(output_dir=None) - -导出excel文件。 - -参数: - -- output_dir (str): excel文件的输出目录路径。默认值为None。 - -返回值: - -- str, excel文件路径。 - -## 使用举例 - -```python -from mindinsight.parser.dump import DumpParser - -# 实例化DumpParser -dump_dir = '/path/to/dump/dir' -parser = DumpParser(dump_dir) - -# 批量转换异步dump数据为host侧格式 -parser.convert_all_data_to_host() - -# 根据关键词信息匹配算子节点,并返回算子的关联tensor文件信息 -qs = 'BatchNorm' -rank_ids = [1, 2] -tensor_mapping = parser.get_tensor_files(qs, rank_ids=rank_ids) - -# 导出计算图节点的汇总报告 -output_dir = '/path/to/output/dir' -parser.export_xlsx(output_dir=output_dir) -``` diff --git a/mindinsight/parser/__init__.py b/mindinsight/parser/__init__.py deleted file mode 100644 index 6228b713..00000000 --- a/mindinsight/parser/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ diff --git a/mindinsight/parser/dump.py b/mindinsight/parser/dump.py deleted file mode 100644 index b12e4c67..00000000 --- a/mindinsight/parser/dump.py +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -"""Graph API module.""" - -import os - -from mindinsight.debugger.dump.convert import DumpRootDirConverter, FileMapping -from mindinsight.debugger.dump.parser import Parser -from mindinsight.debugger.stream_cache.data_loader import DataLoader -from mindinsight.domain.graph.query import StackQuery - - -class DumpParser(Parser): - """ - Dump Parser. - - Args: - dump_dir (str): Dump directory path. - """ - - def __init__(self, dump_dir): - loader = DataLoader(dump_dir) - super(DumpParser, self).__init__(loader) - - def get_tensor_files(self, qs, use_regex=False, rank_ids=None, iterations=None): - """ - Get tensor files. - - Args: - qs (str): Query string. - use_regex (bool): Indicates if query is regex. - rank_ids (list): Selected rank IDs. - iterations (list): Selected iterations. - - Returns: - dict, paths of tensor files. The format is like: {[op_full_name]: OpPathManager}. - Call OpPathManager.to_dict(), the result is format like: - {'rank_[rank_id]': - {[iteration_id]: - { - 'input': list[file_path], - 'output': list[file_path] - } - } - } - """ - operators = [] - if rank_ids is None: - operators = self._operators - else: - for operator in self._operators: - if operator.rank_id in rank_ids: - operators.append(operator) - - query = StackQuery(operators) - operators = query.filter(qs, use_regex=use_regex).all() - file_paths = {} - file_mapping = FileMapping(self._loader) - for operator in operators: - op_pattern = os.path.basename(operator.full_name) - res = file_mapping.find_tensor_file(op_pattern, rank_ids=rank_ids, iterations=iterations) - file_paths[operator.full_name] = res - return file_paths - - def convert_all_data_to_host(self): - """ - Convert all data to host format. - - Returns: - list, failed tensors. - """ - conversion = DumpRootDirConverter(self._loader) - failed_lines = conversion.convert() - return failed_lines diff --git a/mindinsight/scripts/start.py b/mindinsight/scripts/start.py index 554ff28a..a79753ef 100644 --- a/mindinsight/scripts/start.py +++ b/mindinsight/scripts/start.py @@ -18,7 +18,6 @@ import argparse import os import re import sys -import socket from importlib import import_module import psutil @@ -180,8 +179,6 @@ class Command(BaseCommand): try: self.check_port() - self.check_debugger_port() - self.check_offline_debugger_setting() except (PortNotAvailableError, SettingValueError) as error: self.console.error(error.message) self.logfile.error(error.message) @@ -241,37 +238,3 @@ class Command(BaseCommand): log.info(str(error)) return log_base_dir - - def check_debugger_port(self): - """Check if the debugger_port is available""" - if not settings.ENABLE_DEBUGGER: - return - ip = settings.HOST - debugger_port = settings.DEBUGGER_PORT - port = settings.PORT - if debugger_port == port: - raise PortNotAvailableError("The ports for debugger and web page are both %s," - "please use another port as debugger-port." % debugger_port) - s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - try: - s.connect((ip, debugger_port)) - s.shutdown(2) - raise PortNotAvailableError(f'Debugger-port {ip}:{debugger_port} is not available for MindInsight') - except socket.error: - return - - def check_offline_debugger_setting(self): - """Check if the offline debugger setting is legal""" - mem_limit = settings.OFFLINE_DEBUGGER_MEM_LIMIT - session_num = settings.MAX_OFFLINE_DEBUGGER_SESSION_NUM - if not isinstance(mem_limit, int) or isinstance(mem_limit, bool) or \ - mem_limit < MIN_MEM_LIMIT_VALUE or mem_limit > MAX_MEM_LIMIT_VALUE: - raise SettingValueError("Offline debugger memory limit should be integer ranging from {} to {} MB, but got" - " {}. Please check the environment variable MINDINSIGHT_OFFLINE_DEBUGGER_MEM_LIMIT" - .format(MIN_MEM_LIMIT_VALUE, MAX_MEM_LIMIT_VALUE, mem_limit)) - if not isinstance(session_num, int) or isinstance(session_num, bool) or \ - session_num < MIN_SESSION_NUM or session_num > MAX_SESSION_NUM: - raise SettingValueError("Max offline debugger session number should be integer ranging from {} to {}, but " - "got {}. Please check the environment variable " - "MINDINSIGHT_MAX_OFFLINE_DEBUGGER_SESSION_NUM" - .format(MIN_SESSION_NUM, MAX_SESSION_NUM, session_num)) diff --git a/tests/ut/scripts/test_start.py b/tests/ut/scripts/test_start.py deleted file mode 100644 index f9ce1099..00000000 --- a/tests/ut/scripts/test_start.py +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright 2021 Huawei Technologies Co., Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================ -""" -Function: - Test start script. -Usage: - pytest tests/ut/script/test_start.py -""" -import pytest - -from mindinsight.conf import settings -from mindinsight.scripts.start import Command -from mindinsight.utils.exceptions import SettingValueError - - -class TestStartScript: - """Test start script.""" - - @pytest.mark.parametrize('value', [6143, 2147483648, 2.1, True, False, 'str']) - def test_offline_debugger_mem_limit_value(self, value): - """Test offline debugger mem limit value.""" - cmd = Command() - settings.OFFLINE_DEBUGGER_MEM_LIMIT = value - with pytest.raises(SettingValueError) as exc: - cmd.check_offline_debugger_setting() - expected_msg = f"[SettingValueError] code: 5054000D, msg: Offline debugger memory limit " \ - f"should be integer ranging from 6144 to 2147483647 MB, but got %s. Please check the " \ - f"environment variable MINDINSIGHT_OFFLINE_DEBUGGER_MEM_LIMIT" % value - assert expected_msg == str(exc.value) - settings.OFFLINE_DEBUGGER_MEM_LIMIT = 16 * 1024 - - @pytest.mark.parametrize('value', [0, 3, 1.1, True, False, 'str']) - def test_max_offline_debugger_session_num_value(self, value): - """Test offline debugger mem limit type.""" - cmd = Command() - settings.MAX_OFFLINE_DEBUGGER_SESSION_NUM = value - with pytest.raises(SettingValueError) as exc: - cmd.check_offline_debugger_setting() - expected_msg = f"[SettingValueError] code: 5054000D, msg: Max offline debugger session number " \ - f"should be integer ranging from 1 to 2, but got %s. Please check the environment " \ - f"variable MINDINSIGHT_MAX_OFFLINE_DEBUGGER_SESSION_NUM" % value - assert expected_msg == str(exc.value) - settings.MAX_OFFLINE_DEBUGGER_SESSION_NUM = 2 -- Gitee