From ac31b897b9c4ea6839f76089dbdab2c9cb4dc502 Mon Sep 17 00:00:00 2001 From: Disty0 Date: Mon, 18 May 2026 17:53:27 +0300 Subject: [PATCH] PyTorch ignores the global re_compile limit now --- modules/sdnq/common.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/sdnq/common.py b/modules/sdnq/common.py index c8b30521d..91e73e047 100644 --- a/modules/sdnq/common.py +++ b/modules/sdnq/common.py @@ -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