diff --git a/profiler/compare_tools/generation/op_comparison_generator.py b/profiler/compare_tools/generation/op_comparison_generator.py index 980b683896f79253e12de15c45975f30048c5e7f..1e48d7d0b4443bb64ff2706e3bb14526f9a875a0 100644 --- a/profiler/compare_tools/generation/op_comparison_generator.py +++ b/profiler/compare_tools/generation/op_comparison_generator.py @@ -96,7 +96,7 @@ class OpComparisonGenerator: diff = Constant.NA op_name = data[0].name if data[0] else data[1].name - summary_data = base_summary_data + comparison_summary_data + [diff, op_name, diff] + summary_data = base_summary_data + comparison_summary_data + [diff, op_name, Constant.NA] for index in range(len(headers)): value = summary_data[index] if headers[index] == Constant.DIFF: @@ -106,10 +106,11 @@ class OpComparisonGenerator: elif value != Constant.NA and value >= 0: ws.cell(row=row_index, column=index + 1).font = Font(name='Arial', color=Constant.RED_COLOR) if headers[index] == Constant.DIFF_FILTER: - if value != Constant.NA and value < 0: + diff_value = summary_data[headers.index(Constant.DIFF)] + if diff_value != Constant.NA and diff_value < 0: ws.cell(row=row_index, column=index + 1).fill = PatternFill("solid", fgColor=Constant.GREEN_COLOR) - elif value != Constant.NA and value >= 0: + elif diff_value != Constant.NA and diff_value >= 0: ws.cell(row=row_index, column=index + 1).fill = PatternFill("solid", fgColor=Constant.RED_COLOR) elif headers[index] != Constant.OP_NAME_FILTER: ws.cell(row=row_index, column=index + 1).fill = PatternFill("solid", diff --git a/profiler/compare_tools/utils/compare_event.py b/profiler/compare_tools/utils/compare_event.py index 1ce2d820d7fae4e6d9d779e6e99a30882b513f9c..a994d8d6fc511292a349da60e529647f65434d8e 100644 --- a/profiler/compare_tools/utils/compare_event.py +++ b/profiler/compare_tools/utils/compare_event.py @@ -47,4 +47,4 @@ class MemoryEvent: else: duration = Constant.NA name = self._event.get(Constant.NAME, "") if self._event.get(Constant.NAME, "") else self._name - return [name, self._event.get(Constant.SIZE, 0), duration] + return [name, duration, self._event.get(Constant.SIZE, 0)] diff --git a/profiler/compare_tools/utils/constant.py b/profiler/compare_tools/utils/constant.py index ff39744b6471315b18a6bed386a0c21baecc0f86..8c4d4a76810b708f276270c349f252ed57a7d01c 100644 --- a/profiler/compare_tools/utils/constant.py +++ b/profiler/compare_tools/utils/constant.py @@ -57,9 +57,10 @@ class Constant(object): TS = "ts" ALLOCATION_TIME = "Allocation Time(us)" RELEASE_TIME = "Release Time(us)" + MEMORY_DURATION = "Memory Duration(us)" MEMORY_OP_NAME = 'OP Name' NAME = "Name" - CMP_MEMORY_HEADER = [OP_NAME, INPUT_SHAPE + " / " + MEMORY_OP_NAME, INPUT_TYPE + " / " + RELEASE_TIME, SIZE] + CMP_MEMORY_HEADER = [OP_NAME, INPUT_SHAPE + " / " + MEMORY_OP_NAME, INPUT_TYPE + " / " + MEMORY_DURATION, SIZE] # compare type OPERATOR_COMPARE = "OperatorCompare"