From 7abccc07242055f6b005304e8d94a83f6287f035 Mon Sep 17 00:00:00 2001 From: yelihua Date: Wed, 17 Jun 2020 10:24:56 +0800 Subject: [PATCH] add summary info for step trace graph and change the name. --- mindinsight/backend/profiler/profile_api.py | 2 +- mindinsight/profiler/analyser/step_trace_analyser.py | 9 +++++---- tests/st/func/profiler/test_analyse.py | 1 - 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mindinsight/backend/profiler/profile_api.py b/mindinsight/backend/profiler/profile_api.py index a20e351..1fd0849 100644 --- a/mindinsight/backend/profiler/profile_api.py +++ b/mindinsight/backend/profiler/profile_api.py @@ -134,7 +134,7 @@ def get_training_trace_graph(): 'mode': 'step', 'step_id': graph_type }}) - + graph_info['summary'] = analyser.summary return jsonify(graph_info) diff --git a/mindinsight/profiler/analyser/step_trace_analyser.py b/mindinsight/profiler/analyser/step_trace_analyser.py index 865c36e..e611e36 100644 --- a/mindinsight/profiler/analyser/step_trace_analyser.py +++ b/mindinsight/profiler/analyser/step_trace_analyser.py @@ -192,10 +192,11 @@ class StepTraceAnalyser(BaseAnalyser): fp_point = row_info_dict.get('fp_point', 0) bp_point = row_info_dict.get('bp_point', 0) points = [ - self._construct_time_point('', 0, row_info_dict.get('iteration_interval', 0)), - self._construct_time_point('fp_and_bp', fp_point - start_point, - row_info_dict.get('fp_and_bp', 0)), - self._construct_time_point('', bp_point - start_point, row_info_dict.get('tail', 0)), + self._construct_time_point( + 'iteration_interval', 0, row_info_dict.get('iteration_interval', 0)), + self._construct_time_point( + 'fp_and_bp', fp_point - start_point, row_info_dict.get('fp_and_bp', 0)), + self._construct_time_point('tail', bp_point - start_point, row_info_dict.get('tail', 0)) ] return points diff --git a/tests/st/func/profiler/test_analyse.py b/tests/st/func/profiler/test_analyse.py index 6e91b45..9686784 100644 --- a/tests/st/func/profiler/test_analyse.py +++ b/tests/st/func/profiler/test_analyse.py @@ -98,7 +98,6 @@ class TestProfilerAnalyse(TestCase): {'name': 'stream_540_parallel_0', 'start': 118.3705, 'duration': 49.281}, {'name': '', 'start': 167.6515, 'duration': 37.7294}] - @pytest.mark.level0 @pytest.mark.env_single @pytest.mark.platform_x86_cpu -- GitLab