Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log REMOTE_CACHE_VERSION #2538

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading