diff --git a/python/paddle/profiler/profiler_statistic.py b/python/paddle/profiler/profiler_statistic.py old mode 100644 new mode 100755 index 5593632991e24..e39871c7365ba --- a/python/paddle/profiler/profiler_statistic.py +++ b/python/paddle/profiler/profiler_statistic.py @@ -642,81 +642,6 @@ def format_ratio(ratio, indent=0): append('') append('') - ###### Print Model Summary Report ###### - model_perspective_items = statistic_data.event_summary.model_perspective_items - if model_perspective_items: - headers = [ - 'Name', 'Calls', 'CPU Total / Avg / Max / Min / Ratio(%)', - 'GPU Total / Avg / Max / Min / Ratio(%)' - ] - row_format_list = [""] - header_sep_list = [""] - line_length_list = [-SPACING_SIZE] - name_column_width = 15 - add_column(name_column_width) - add_column(6) - add_column(40) - add_column(40) - - row_format = row_format_list[0] - header_sep = header_sep_list[0] - line_length = line_length_list[0] - - # construct table string - append(add_title(line_length, "Model Summary")) - append('Time unit: {}'.format(time_unit)) - append(header_sep) - append(row_format.format(*headers)) - append(header_sep) - accmulation_time = 0 - row_values = [ - 'Total Time', '-', '{} / - / - / - / {}'.format( - format_time( - total_time, unit=time_unit), format_ratio(1)), - '- / - / - / -/ -' - ] - append(row_format.format(*row_values)) - for name in ['Dataloader', 'Forward', 'Backward', 'Optimization']: - if name in model_perspective_items: - item = model_perspective_items[name] - row_values = [ - ' {}'.format(name), item.call, - '{} / {} / {} / {} / {}'.format( - format_time( - item.cpu_time, unit=time_unit), - format_time( - item.avg_cpu_time, unit=time_unit), - format_time( - item.max_cpu_time, unit=time_unit), - format_time( - item.min_cpu_time, unit=time_unit), - format_ratio(float(item.cpu_time) / total_time)), - '{} / {} / {} / {} / {}'.format( - format_time( - item.gpu_time, unit=time_unit), - format_time( - item.avg_gpu_time, unit=time_unit), - format_time( - item.max_gpu_time, unit=time_unit), - format_time( - item.min_gpu_time, unit=time_unit), - format_ratio(float(item.gpu_time) / total_time)) - ] - append(row_format.format(*row_values)) - accmulation_time += item.cpu_time - - other_time = total_time - accmulation_time - row_values = [ - ' Others', '-', '{} / - / - / - / {}'.format( - format_time( - other_time, unit=time_unit), - format_ratio(float(other_time) / total_time)), - '- / - / - / - / -' - ] - append(row_format.format(*row_values)) - append(header_sep) - append('') - append('') ###### Print Operator Summary Report ###### if statistic_data.event_summary.items: headers = [