Skip to content

Commit

Permalink
Log more compilation time breakdown (#119865)
Browse files Browse the repository at this point in the history
Summary:
Fixes #ISSUE_NUMBER

X-link: pytorch/pytorch#119865
Approved by: https://github.com/ezyang

Reviewed By: huydhn

Differential Revision: D53837723

Pulled By: yanboliang

fbshipit-source-id: d97eb59354fa025750acc2cc9290532eabd190ec
  • Loading branch information
yanboliang authored and facebook-github-bot committed Feb 16, 2024
1 parent f5b2e50 commit e194d21
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions userbenchmark/dynamo/dynamobench/_dynamo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,10 @@ def time_wrapper(*args, **kwargs):
frame_key = str(curr_frame)
if frame_key not in frame_phase_timing:
frame_phase_timing[frame_key] = {}
assert (
phase_name not in frame_phase_timing[frame_key]
), f"Duplicate phase name {phase_name} for frame {frame_key}"
frame_phase_timing[frame_key][phase_name] = time_spent
if phase_name not in frame_phase_timing[frame_key]:
frame_phase_timing[frame_key][phase_name] = time_spent
else:
frame_phase_timing[frame_key][phase_name] += time_spent
return r

return time_wrapper
Expand Down Expand Up @@ -621,6 +621,8 @@ class CompilationMetrics:
graph_input_count: Optional[int]
entire_frame_compile_time_s: Optional[float]
backend_compile_time_s: Optional[float]
inductor_compile_time_s: Optional[float]
code_gen_time_s: Optional[float]
fail_type: Optional[str]
fail_reason: Optional[str]
fail_user_frame_filename: Optional[str]
Expand Down

0 comments on commit e194d21

Please sign in to comment.