[Bugfix]pass TP size to diffusion config (#2867)
Signed-off-by: natureofnature <wzliu@connect.hku.hk>
This commit is contained in:
1 parent
359e474db4
commit
bfb730ed50
5 files changed
+108
-19
No files matched your search
@@ -776,6 +776,18 @@ class OmniDiffusionConfig:
|
||||
if "diffusers_call_kwargs" in kwargs and kwargs["diffusers_call_kwargs"] is None:
|
||||
kwargs["diffusers_call_kwargs"] = {}
|
||||
|
||||
# Forward top-level parallel knobs (e.g. --tensor-parallel-size from CLI)
|
||||
# into parallel_config so the diffusion engine sees them.
|
||||
par = kwargs.get("parallel_config", {})
|
||||
if isinstance(par, Mapping):
|
||||
par = dict(par)
|
||||
if par.get("tensor_parallel_size") is None:
|
||||
par.pop("tensor_parallel_size", None)
|
||||
tensor_parallel_size = kwargs.get("tensor_parallel_size")
|
||||
if tensor_parallel_size is not None and "tensor_parallel_size" not in par:
|
||||
par["tensor_parallel_size"] = tensor_parallel_size
|
||||
kwargs["parallel_config"] = par
|
||||
|
||||
# Filter kwargs to only include valid fields
|
||||
valid_fields = {f.name for f in fields(cls)}
|
||||
filtered_kwargs = {k: v for k, v in kwargs.items() if k in valid_fields}
|
||||
|
||||
@@ -112,6 +112,13 @@ _PARENT_ARGS_KEEP: frozenset[str] = frozenset(
|
||||
"worker_extension_cls",
|
||||
"allowed_local_media_path",
|
||||
"allowed_media_domains",
|
||||
# Legacy stage-config YAMLs may intentionally leave parallel or
|
||||
# distributed knobs unspecified at the stage level and rely on
|
||||
# top-level CLI values to fill them in during the per-stage merge.
|
||||
# Keep these fields so stages that omit them can inherit CLI values,
|
||||
# while stages with explicit YAML values still win because the legacy
|
||||
# stage-config loader prefers stage-local engine args.
|
||||
"tensor_parallel_size",
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user