[Feature] Add DWDP (Distributed Weight Data Parallelism) for MoE prefill (#29778)
This commit is contained in:
@@ -226,6 +226,7 @@ def prepare_mlp_sync_batch_raw(
|
||||
require_mlp_tp_gather: bool,
|
||||
disable_overlap_schedule: bool,
|
||||
offload_tags: set[str],
|
||||
dwdp: bool = False,
|
||||
):
|
||||
# Check if other DP workers have running batches
|
||||
if (
|
||||
@@ -327,8 +328,8 @@ def prepare_mlp_sync_batch_raw(
|
||||
|
||||
# Decide whether to emit idle batch
|
||||
if skip_all_gather:
|
||||
# Skip idle batch when attn-dp=1
|
||||
need_idle_batch = dp_size > 1
|
||||
# Skip idle batch when attn-dp=1 (and always under DWDP: ranks run independently)
|
||||
need_idle_batch = not dwdp and dp_size > 1
|
||||
else:
|
||||
need_idle_batch = max(mlp_sync_info.global_num_tokens) > 0
|
||||
|
||||
@@ -386,6 +387,7 @@ class SchedulerDPAttnAdapter:
|
||||
require_mlp_tp_gather=require_mlp_tp_gather(self.server_args),
|
||||
disable_overlap_schedule=self.server_args.disable_overlap_schedule,
|
||||
offload_tags=self.offload_tags,
|
||||
dwdp=self.server_args.dwdp_size > 1,
|
||||
)
|
||||
|
||||
def maybe_prepare_mlp_sync_batch(
|
||||
|
||||
Reference in New Issue
Block a user