not all torch versions have this

This commit is contained in:
kijai
2025-10-23 21:12:45 +03:00
parent 41168b1e82
commit b3ad381a65
+5 -1
View File
@@ -505,7 +505,11 @@ 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:
if hasattr(torch._dynamo.config, 'allow_unspec_int_on_nn_module'):
torch._dynamo.config.allow_unspec_int_on_nn_module = compile_args["allow_unspec_int_on_nn_module"]
except Exception as e:
log.warning(f"Could not set allow_unspec_int_on_nn_module: {e}")
try:
torch._dynamo.config.recompile_limit = compile_args["dynamo_recompile_limit"]
except Exception as e: