From dde0015b7456e1f8ac1d2a52325aade76faecf67 Mon Sep 17 00:00:00 2001 From: zhangyunshu Date: Thu, 2 Jul 2020 22:26:39 +0800 Subject: [PATCH] profiler: fixed timeline display on AllReduce --- mindinsight/profiler/analyser/step_trace_analyser.py | 5 +++-- mindinsight/profiler/profiling.py | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/mindinsight/profiler/analyser/step_trace_analyser.py b/mindinsight/profiler/analyser/step_trace_analyser.py index 58ea05e..91b9bc2 100644 --- a/mindinsight/profiler/analyser/step_trace_analyser.py +++ b/mindinsight/profiler/analyser/step_trace_analyser.py @@ -83,7 +83,7 @@ class StepTraceAnalyser(BaseAnalyser): row_info_dict = self._get_info_dict_from_row_data(row_info, 'systime') reduce_info = self._sort_reduce_by_time(row_info_dict) if reduce_info: - reduce_infos.append(reduce_info) + reduce_infos.extend(reduce_info) return reduce_infos @@ -282,8 +282,9 @@ class StepTraceAnalyser(BaseAnalyser): log.info("Reduce event missing value.") continue cur_stream_id = reduce_field.split('_', 2)[1] - reduce_info = [reduce_field, int(cur_stream_id), reduce_start, + reduce_meta = [reduce_field, int(cur_stream_id), reduce_start, reduce_duration, reduce_pid] + reduce_info.append(reduce_meta) return reduce_info diff --git a/mindinsight/profiler/profiling.py b/mindinsight/profiler/profiling.py index e52a300..e5d841d 100644 --- a/mindinsight/profiler/profiling.py +++ b/mindinsight/profiler/profiling.py @@ -236,6 +236,12 @@ class Profiler: def _analyse_timeline(self, aicpu_parser, optime_parser): """ Analyse and parse timeline info. + + Args: + aicpu_parser (DataPreProcessParser): The parser instance for AI CPU operator + execution time calculation. + optime_parser (OPComputeTimeParserParser): The parser instance for AI Core + operator execution time calculation. """ timeline_analyser = AnalyserFactory.instance().get_analyser( 'timeline', self._output_path, self._dev_id -- GitLab