[Feat] Enable expert parallel for diffusion MoE layers (#1323)
Signed-off-by: Semmer2 <semmer@live.cn>
This commit is contained in:
1 parent
4725593a4b
commit
6ac85d4607
11 files changed
+361
-18
No files matched your search
@@ -157,6 +157,7 @@ class AsyncOmni(OmniBase):
|
||||
ring_degree = kwargs.get("ring_degree") or 1
|
||||
sequence_parallel_size = kwargs.get("sequence_parallel_size")
|
||||
tensor_parallel_size = kwargs.get("tensor_parallel_size") or 1
|
||||
enable_expert_parallel = kwargs.get("enable_expert_parallel") or False
|
||||
cfg_parallel_size = kwargs.get("cfg_parallel_size") or 1
|
||||
vae_patch_parallel_size = kwargs.get("vae_patch_parallel_size") or 1
|
||||
use_hsdp = kwargs.get("use_hsdp", False)
|
||||
@@ -179,6 +180,7 @@ class AsyncOmni(OmniBase):
|
||||
pipeline_parallel_size=1,
|
||||
data_parallel_size=1,
|
||||
tensor_parallel_size=tensor_parallel_size,
|
||||
enable_expert_parallel=enable_expert_parallel,
|
||||
sequence_parallel_size=sequence_parallel_size,
|
||||
ulysses_degree=ulysses_degree,
|
||||
ring_degree=ring_degree,
|
||||
|
||||
@@ -100,6 +100,7 @@ class AsyncOmniDiffusion:
|
||||
if cfg is None:
|
||||
raise ValueError(f"Could not find config.json or model_index.json for model {od_config.model}")
|
||||
|
||||
od_config.tf_model_config = TransformerConfig.from_dict(cfg)
|
||||
model_type = cfg.get("model_type")
|
||||
architectures = cfg.get("architectures") or []
|
||||
# Bagel/NextStep models don't have a model_index.json, so we set the pipeline class name manually
|
||||
|
||||
@@ -98,7 +98,7 @@ class OmniDiffusion:
|
||||
|
||||
if od_config.model_class_name is None:
|
||||
od_config.model_class_name = pipeline_class
|
||||
od_config.tf_model_config = TransformerConfig()
|
||||
od_config.tf_model_config = TransformerConfig().from_dict(cfg)
|
||||
od_config.update_multimodal_support()
|
||||
|
||||
if cfg_kv_collect_func is not None:
|
||||
|
||||
Reference in new issue
Block a user