mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2026-05-30 11:17:09 +08:00
Merge pull request #459 from urlesistiana/patch_1
change "dynamic" in TorchCompileModelAdvanced to list with 3 options
This commit is contained in:
commit
987b9a28e4
@ -868,7 +868,10 @@ class TorchCompileModelAdvanced:
|
|||||||
"backend": (["inductor","cudagraphs"], {"default": "inductor"}),
|
"backend": (["inductor","cudagraphs"], {"default": "inductor"}),
|
||||||
"fullgraph": ("BOOLEAN", {"default": False, "tooltip": "Enable full graph mode"}),
|
"fullgraph": ("BOOLEAN", {"default": False, "tooltip": "Enable full graph mode"}),
|
||||||
"mode": (["default", "max-autotune", "max-autotune-no-cudagraphs", "reduce-overhead"], {"default": "default"}),
|
"mode": (["default", "max-autotune", "max-autotune-no-cudagraphs", "reduce-overhead"], {"default": "default"}),
|
||||||
"dynamic": ("BOOLEAN", {"default": False, "tooltip": "Enable dynamic mode"}),
|
"dynamic": (
|
||||||
|
["auto", "true", "false"],
|
||||||
|
{"default": "auto", "tooltip": "Use dynamic shape tracing."},
|
||||||
|
),
|
||||||
"compile_transformer_blocks_only": ("BOOLEAN", {"default": True, "tooltip": "Compile only transformer blocks, faster compile and less error prone"}),
|
"compile_transformer_blocks_only": ("BOOLEAN", {"default": True, "tooltip": "Compile only transformer blocks, faster compile and less error prone"}),
|
||||||
"dynamo_cache_size_limit": ("INT", {"default": 64, "min": 0, "max": 1024, "step": 1, "tooltip": "torch._dynamo.config.cache_size_limit"}),
|
"dynamo_cache_size_limit": ("INT", {"default": 64, "min": 0, "max": 1024, "step": 1, "tooltip": "torch._dynamo.config.cache_size_limit"}),
|
||||||
"debug_compile_keys": ("BOOLEAN", {"default": False, "tooltip": "Print the compile keys used for torch.compile"}),
|
"debug_compile_keys": ("BOOLEAN", {"default": False, "tooltip": "Print the compile keys used for torch.compile"}),
|
||||||
@ -904,6 +907,12 @@ class TorchCompileModelAdvanced:
|
|||||||
if not compile_key_list:
|
if not compile_key_list:
|
||||||
compile_key_list =["diffusion_model"]
|
compile_key_list =["diffusion_model"]
|
||||||
|
|
||||||
|
dynamic_kv = {"true": True, "false": False, "auto": None}
|
||||||
|
try:
|
||||||
|
dynamic = dynamic_kv[dynamic]
|
||||||
|
except KeyError:
|
||||||
|
raise ValueError(f"Invalid dynamic arg {dynamic}")
|
||||||
|
|
||||||
set_torch_compile_wrapper(model=m, keys=compile_key_list, backend=backend, mode=mode, dynamic=dynamic, fullgraph=fullgraph)
|
set_torch_compile_wrapper(model=m, keys=compile_key_list, backend=backend, mode=mode, dynamic=dynamic, fullgraph=fullgraph)
|
||||||
except:
|
except:
|
||||||
raise RuntimeError("Failed to compile model")
|
raise RuntimeError("Failed to compile model")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user