PyTorch ignores the global re_compile limit now

This commit is contained in:
Disty0
2026-05-18 17:53:27 +03:00
parent e3b1eb71a1
commit ac31b897b9
+3
View File
@@ -397,11 +397,14 @@ if use_torch_compile:
torch._dynamo.config.recompile_limit = max(8192, getattr(torch._dynamo.config, "recompile_limit", 0))
torch._dynamo.config.cache_size_limit = max(8192, getattr(torch._dynamo.config, "cache_size_limit", 0))
torch._dynamo.config.accumulated_recompile_limit = max(8192, getattr(torch._dynamo.config, "accumulated_recompile_limit", 0))
torch._dynamo.config.accumulated_cache_size_limit = max(8192, getattr(torch._dynamo.config, "accumulated_cache_size_limit", 0))
def compile_func(fn, **kwargs):
if kwargs.get("fullgraph", None) is None:
kwargs["fullgraph"] = True
if kwargs.get("dynamic", None) is None:
kwargs["dynamic"] = False
if kwargs.get("recompile_limit", None) is None:
kwargs["recompile_limit"] = 8192
if os.environ.get("SDNQ_COMPILE_KWARGS", None) is not None:
for key, value in json.loads(os.environ.get("SDNQ_COMPILE_KWARGS")).items():
kwargs[key] = value