[Feature][Wan2.2] Speed up diffusion model startup by multi-thread weight loading (#1504)
Signed-off-by: samithuang <285365963@qq.com> Signed-off-by: Samit <285365963@qq.com>
This commit is contained in:
1 parent
a4b2e48718
commit
22a51a7cdb
6 files changed
+57
-22
No files matched your search
@@ -190,6 +190,8 @@ class AsyncOmni(OmniBase):
|
||||
"enforce_eager": kwargs.get("enforce_eager", False),
|
||||
"diffusion_load_format": kwargs.get("diffusion_load_format", "default"),
|
||||
"custom_pipeline_args": kwargs.get("custom_pipeline_args", None),
|
||||
"enable_multithread_weight_load": kwargs.get("enable_multithread_weight_load", True),
|
||||
"num_weight_load_threads": kwargs.get("num_weight_load_threads", 4),
|
||||
},
|
||||
"final_output": True,
|
||||
"final_output_type": "image",
|
||||
|
||||
@@ -272,6 +272,21 @@ class OmniServeCommand(CLISubcommand):
|
||||
help="Enable VAE tiling for memory optimization (useful for mitigating OOM issues).",
|
||||
)
|
||||
|
||||
# Parallel weight loading (faster diffusion startup)
|
||||
omni_config_group.add_argument(
|
||||
"--disable-multithread-weight-load",
|
||||
action="store_false",
|
||||
dest="enable_multithread_weight_load",
|
||||
default=True,
|
||||
help="Disable multi-threaded safetensors loading (default: enabled with 4 threads).",
|
||||
)
|
||||
omni_config_group.add_argument(
|
||||
"--num-weight-load-threads",
|
||||
type=int,
|
||||
default=4,
|
||||
help="Number of threads for parallel weight loading (default: 4).",
|
||||
)
|
||||
|
||||
# diffusion model offload parameters
|
||||
omni_config_group.add_argument(
|
||||
"--enable-cpu-offload",
|
||||
|
||||
Reference in new issue
Block a user