mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Log fx graph cache bypass reasons (#134792)
Summary: Lets track when we bypass and why Test Plan: unit tests Differential Revision: D61994739 Pull Request resolved: https://github.com/pytorch/pytorch/pull/134792 Approved by: https://github.com/jamesjwu
This commit is contained in:
committed by
PyTorch MergeBot
parent
1595e755af
commit
2dadc2c8fc
@ -60,6 +60,7 @@ from torch._inductor.codegen.rocm.compile_command import (
|
||||
rocm_compile_command,
|
||||
rocm_compiler,
|
||||
)
|
||||
from torch._utils_internal import log_cache_bypass
|
||||
|
||||
|
||||
T = TypeVar("T")
|
||||
@ -1359,6 +1360,8 @@ class FxGraphCache:
|
||||
cache_state = "bypass"
|
||||
log.info("Bypassing FX Graph Cache because '%s'", e)
|
||||
cache_info["cache_bypass_reason"] = str(e)
|
||||
if remote:
|
||||
log_cache_bypass("bypass_fx_graph", str(e))
|
||||
cache_event_time = time_ns()
|
||||
if not compiled_graph:
|
||||
compiled_graph = compile_fx_fn(
|
||||
|
@ -132,6 +132,10 @@ def log_trace_structured_event(*args, **kwargs) -> None:
|
||||
pass
|
||||
|
||||
|
||||
def log_cache_bypass(*args, **kwargs) -> None:
|
||||
pass
|
||||
|
||||
|
||||
def log_torchscript_usage(api: str, **kwargs):
|
||||
_ = api
|
||||
return
|
||||
|
Reference in New Issue
Block a user