Skip to content

Commit

Permalink
Log REMOTE_CACHE_VERSION (#2538)
Browse files Browse the repository at this point in the history
Summary:

X-link: pytorch/pytorch#140174

title

Differential Revision: D65667421
  • Loading branch information
fbgheith authored and facebook-github-bot committed Nov 11, 2024
1 parent abaca22 commit 95ffdd7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions userbenchmark/dynamo/dynamobench/_dynamo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,13 +412,26 @@ def dynamo_timed(
structured_logging_overhead_s = (
torch._logging.get_structured_logging_overhead()
)

# REMOTE_CACHE_VERSION is fbcode specific
# TODO: move REMOTE_CACHE_VERSION to the OSS side
remote_cache_version: Optional[int] = None
try:
from torch._environment import is_fbcode
if is_fbcode():
from torch._inductor.fb.remote_cache import REMOTE_CACHE_VERSION
remote_cache_version = REMOTE_CACHE_VERSION
except Exception:
pass

metrics = CompilationMetrics(
compile_id=compile_id,
inductor_compile_time_s=inductor_compile_time,
code_gen_time_s=code_gen_time,
fail_type=fail_type,
fail_reason=fail_reason,
remote_cache_time_saved_s=remote_cache_time_saved,
remote_cache_version=remote_cache_version,
structured_logging_overhead_s=structured_logging_overhead_s,
is_forward=False, # is_forward
num_triton_bundles=codecache_metrics.get(
Expand Down Expand Up @@ -898,6 +911,7 @@ class CompilationMetrics:
# a compiled frame
has_guarded_code: Optional[bool] = None
remote_cache_time_saved_s: Optional[float] = None
remote_cache_version: Optional[int] = None
structured_logging_overhead_s: Optional[float] = None
config_suppress_errors: Optional[bool] = None
config_inline_inbuilt_nn_modules: Optional[bool] = None
Expand Down

0 comments on commit 95ffdd7

Please sign in to comment.