Turn off remote caching in unit tests unless explicitly on (#133258)

Summary: This PR turns off remote caching in unit tests unless the unit test explicitly turns it on.

Test Plan: existing tests

Differential Revision: D61152154

Pull Request resolved: https://github.com/pytorch/pytorch/pull/133258
Approved by: https://github.com/masnesral
This commit is contained in:
Oguz Ulgen
2024-08-13 02:49:43 +00:00
committed by PyTorch MergeBot
parent 1e9bedf688
commit fa36eba77d
3 changed files with 10 additions and 0 deletions

View File

@ -419,6 +419,10 @@ def should_use_remote_fx_graph_cache():
return config.fx_graph_remote_cache
if not config.is_fbcode():
return False
if torch._utils_internal.is_fb_unit_test():
return False
try:
from torch._inductor.fb.remote_cache import REMOTE_CACHE_VERSION
except ModuleNotFoundError:

View File

@ -1026,6 +1026,8 @@ def should_use_remote_autotune_cache(inductor_meta):
return inductor_meta.get("autotune_remote_cache")
if not inductor_meta.get("is_fbcode"):
return False
if torch._utils_internal.is_fb_unit_test():
return False
if inductor_meta.get("is_hip"):
return False

View File

@ -184,6 +184,10 @@ def justknobs_getval_int(name: str) -> int:
return 0
def is_fb_unit_test() -> bool:
return False
@functools.lru_cache(None)
def max_clock_rate():
if not torch.version.hip: