Skip to content

Commit

Permalink
Enable bwd compilation metrics (#128973)
Browse files Browse the repository at this point in the history
Summary:
Fixes #ISSUE_NUMBER

X-link: pytorch/pytorch#128973
Approved by: https://github.com/dshi7

Reviewed By: fbgheith

Differential Revision: D58798131

Pulled By: yanboliang

fbshipit-source-id: 03c5b35f5dbdfa16c54300e22daa902d5be904fa
  • Loading branch information
yanboliang authored and facebook-github-bot committed Jun 20, 2024
1 parent a3af772 commit 1f0fecd
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions userbenchmark/dynamo/dynamobench/_dynamo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,18 +714,15 @@ def record_compilation_metrics(
name = "compilation_metrics"
else:
name = "bwd_compilation_metrics"
# Currently only record fwd compilation metrics, will add bwd compilation metrics
# after the internal Scuba logging changes finish.
if isinstance(compilation_metrics, CompilationMetrics):
torch._logging.trace_structured(
name,
lambda: {
k: list(v) if isinstance(v, set) else v
for k, v in dataclasses.asdict(compilation_metrics).items()
},
)
if config.log_compilation_metrics:
log_compilation_event(compilation_metrics)
torch._logging.trace_structured(
name,
lambda: {
k: list(v) if isinstance(v, set) else v
for k, v in dataclasses.asdict(compilation_metrics).items()
},
)
if config.log_compilation_metrics:
log_compilation_event(compilation_metrics)


def set_compilation_metrics_limit(new_size: int) -> None:
Expand Down

0 comments on commit 1f0fecd

Please sign in to comment.