Reduce needless torch.compile recompiles

This commit is contained in:
kijai
2025-10-22 13:29:13 +03:00
parent aa610cde2b
commit 67fcf0ba52
4 changed files with 28 additions and 21 deletions
+1
View File
@@ -505,6 +505,7 @@ def compile_model(transformer, compile_args=None):
if hasattr(torch, '_dynamo') and hasattr(torch._dynamo, 'config'):
torch._dynamo.config.cache_size_limit = compile_args["dynamo_cache_size_limit"]
torch._dynamo.config.force_parameter_static_shapes = compile_args["force_parameter_static_shapes"]
torch._dynamo.config.allow_unspec_int_on_nn_module = True
try:
torch._dynamo.config.recompile_limit = compile_args["dynamo_recompile_limit"]
except Exception as e: