[diffusion] fix: fix rank used in parallel executor when enable_cfg_parallel is false (#18975)
Co-authored-by: daiweitao <dwti614707404@163.com>
This commit is contained in:
@@ -8,6 +8,7 @@ from sglang.multimodal_gen.runtime.distributed import get_sp_group
|
|||||||
from sglang.multimodal_gen.runtime.distributed.parallel_state import (
|
from sglang.multimodal_gen.runtime.distributed.parallel_state import (
|
||||||
get_cfg_group,
|
get_cfg_group,
|
||||||
get_classifier_free_guidance_rank,
|
get_classifier_free_guidance_rank,
|
||||||
|
get_world_rank,
|
||||||
)
|
)
|
||||||
from sglang.multimodal_gen.runtime.pipelines_core import Req
|
from sglang.multimodal_gen.runtime.pipelines_core import Req
|
||||||
from sglang.multimodal_gen.runtime.pipelines_core.executors.pipeline_executor import (
|
from sglang.multimodal_gen.runtime.pipelines_core.executors.pipeline_executor import (
|
||||||
@@ -60,7 +61,10 @@ class ParallelExecutor(PipelineExecutor):
|
|||||||
"""
|
"""
|
||||||
Execute all pipeline stages respecting their declared parallelism type.
|
Execute all pipeline stages respecting their declared parallelism type.
|
||||||
"""
|
"""
|
||||||
|
if server_args.enable_cfg_parallel:
|
||||||
rank = get_classifier_free_guidance_rank()
|
rank = get_classifier_free_guidance_rank()
|
||||||
|
else:
|
||||||
|
rank = get_world_rank()
|
||||||
cfg_group = get_cfg_group()
|
cfg_group = get_cfg_group()
|
||||||
|
|
||||||
# TODO: decide when to gather on main when CFG_PARALLEL -> MAIN_RANK_ONLY
|
# TODO: decide when to gather on main when CFG_PARALLEL -> MAIN_RANK_ONLY
|
||||||
|
|||||||
Reference in New Issue
Block a user