Skip to content

Commit

Permalink
Fix bug involving missing compilation_metrics fields in tlparse logs …
Browse files Browse the repository at this point in the history
…(#142423)

Summary:
The line of code that's compiling the set of compilation_metrics to include in the corresponding tlparse log is missing the "legacy" and "common" fields populated above. Fix is to make sure we consider all fields in the compilation_metrics object.

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

Reviewed By: clee2000

Differential Revision: D67035496

Pulled By: masnesral

fbshipit-source-id: f39c97b97fae00ab5d2882ba106784a33defbdc1
  • Loading branch information
masnesral authored and facebook-github-bot committed Dec 10, 2024
1 parent 34038d5 commit 2ffd75a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion userbenchmark/dynamo/dynamobench/_dynamo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,10 @@ def safe_str(item: Any) -> str:
name = "bwd_compilation_metrics"
torch._logging.trace_structured(
name,
lambda: {k: list(v) if isinstance(v, set) else v for k, v in metrics.items()},
lambda: {
k: list(v) if isinstance(v, set) else v
for k, v in dataclasses.asdict(compilation_metrics).items()
},
# NB: Because compilation metrics *includes* the logging overhead time,
# we can't both *measure* the logging overhead of compilation metrics
# without making it inconsistent with compilation metrics itself, so
Expand Down

0 comments on commit 2ffd75a

Please sign in to comment.