Skip to content

Commit

Permalink
Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
jchen351 committed Jan 6, 2025
1 parent e9d853d commit f39fea8
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand All @@ -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.
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit f39fea8

Please sign in to comment.