From f39fea8e237f4a9c324daf4a8c5da782f9e47be8 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Mon, 6 Jan 2025 12:05:05 -0800 Subject: [PATCH] Reformat code --- .../python/tools/transformers/profile_result_processor.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/onnxruntime/python/tools/transformers/profile_result_processor.py b/onnxruntime/python/tools/transformers/profile_result_processor.py index 185f9306f4c91..8de073175a348 100644 --- a/onnxruntime/python/tools/transformers/profile_result_processor.py +++ b/onnxruntime/python/tools/transformers/profile_result_processor.py @@ -75,7 +75,6 @@ def parse_kernel_results(sess_time, threshold=0): Args: sess_time (List[Dict]): profile data - kernel_time_only (bool, optional): Only include items for kernel time. Defaults to False. threshold (int, optional): Minimum ratio of duration among all. Defaults to 0. Returns: @@ -119,7 +118,7 @@ def parse_kernel_results(sess_time, threshold=0): # Output items with run time ratio > thresholds, and sorted by duration in the descending order. lines = [] - lines.append(f"\nTop expensive kernels with Time% >= {threshold*100:.2f}:") + lines.append(f"\nTop expensive kernels with Time% >= {threshold * 100:.2f}:") lines.append("-" * 64) lines.append("Total(μs)\tTime%\tCalls\tAvg(μs)\tKernel") for kernel_name, duration in sorted(kernel_time.items(), key=lambda x: x[1], reverse=True): @@ -220,7 +219,7 @@ def parse_node_results(sess_time, kernel_time_only=False, threshold=0): ) # Output items with run time ratio > thresholds, and sorted by duration in the descending order. - lines.append(f"\nTop expensive nodes with Time% >= {threshold*100:.2f}:") + lines.append(f"\nTop expensive nodes with Time% >= {threshold * 100:.2f}:") lines.append("-" * 64) lines.append("Total(μs)\tTime%\tAvg(μs)\tCalls\tProvider\tNode") for node_name, duration in sorted(node_time.items(), key=lambda x: x[1], reverse=True): @@ -242,8 +241,6 @@ def group_node_results(sess_time): Args: sess_time (List[Dict]): profile data - kernel_time_only (bool): Only include items for kernel time. - use_gpu (bool): GPU is used in profiling or not. Returns: List[str]: lines of string for output. @@ -337,7 +334,6 @@ def group_node_results(sess_time): return lines - def process_results(profile_file, args): profile_records = load_profile_json(profile_file)