From e21fc78dbd0576a6bada7f6657786604d42d63f7 Mon Sep 17 00:00:00 2001 From: Prozac614 Date: Thu, 19 Feb 2026 20:12:24 +0800 Subject: [PATCH] [diffusion] fix: fix rank used in parallel executor when enable_cfg_parallel is false (#18975) Co-authored-by: daiweitao --- .../runtime/pipelines_core/executors/parallel_executor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/sglang/multimodal_gen/runtime/pipelines_core/executors/parallel_executor.py b/python/sglang/multimodal_gen/runtime/pipelines_core/executors/parallel_executor.py index 7f04525a7..6a3ffcf9d 100644 --- a/python/sglang/multimodal_gen/runtime/pipelines_core/executors/parallel_executor.py +++ b/python/sglang/multimodal_gen/runtime/pipelines_core/executors/parallel_executor.py @@ -8,6 +8,7 @@ from sglang.multimodal_gen.runtime.distributed import get_sp_group from sglang.multimodal_gen.runtime.distributed.parallel_state import ( get_cfg_group, get_classifier_free_guidance_rank, + get_world_rank, ) from sglang.multimodal_gen.runtime.pipelines_core import Req 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. """ - rank = get_classifier_free_guidance_rank() + if server_args.enable_cfg_parallel: + rank = get_classifier_free_guidance_rank() + else: + rank = get_world_rank() cfg_group = get_cfg_group() # TODO: decide when to gather on main when CFG_PARALLEL -> MAIN_RANK_ONLY