Skip to content

Commit 95ffdd7

Browse files
fbgheithfacebook-github-bot
authored andcommitted
Log REMOTE_CACHE_VERSION (pytorch#2538)
Summary: X-link: pytorch/pytorch#140174 title Differential Revision: D65667421
1 parent abaca22 commit 95ffdd7

File tree

1 file changed

+14
-0
lines changed
  • userbenchmark/dynamo/dynamobench/_dynamo

1 file changed

+14
-0
lines changed

userbenchmark/dynamo/dynamobench/_dynamo/utils.py

+14
Original file line numberDiff line numberDiff line change
@@ -412,13 +412,26 @@ def dynamo_timed(
412412
structured_logging_overhead_s = (
413413
torch._logging.get_structured_logging_overhead()
414414
)
415+
416+
# REMOTE_CACHE_VERSION is fbcode specific
417+
# TODO: move REMOTE_CACHE_VERSION to the OSS side
418+
remote_cache_version: Optional[int] = None
419+
try:
420+
from torch._environment import is_fbcode
421+
if is_fbcode():
422+
from torch._inductor.fb.remote_cache import REMOTE_CACHE_VERSION
423+
remote_cache_version = REMOTE_CACHE_VERSION
424+
except Exception:
425+
pass
426+
415427
metrics = CompilationMetrics(
416428
compile_id=compile_id,
417429
inductor_compile_time_s=inductor_compile_time,
418430
code_gen_time_s=code_gen_time,
419431
fail_type=fail_type,
420432
fail_reason=fail_reason,
421433
remote_cache_time_saved_s=remote_cache_time_saved,
434+
remote_cache_version=remote_cache_version,
422435
structured_logging_overhead_s=structured_logging_overhead_s,
423436
is_forward=False, # is_forward
424437
num_triton_bundles=codecache_metrics.get(
@@ -898,6 +911,7 @@ class CompilationMetrics:
898911
# a compiled frame
899912
has_guarded_code: Optional[bool] = None
900913
remote_cache_time_saved_s: Optional[float] = None
914+
remote_cache_version: Optional[int] = None
901915
structured_logging_overhead_s: Optional[float] = None
902916
config_suppress_errors: Optional[bool] = None
903917
config_inline_inbuilt_nn_modules: Optional[bool] = None

0 commit comments

Comments
 (0)