fix: support PP2+CP8+TP8 (PP with context parallelism) (#19548)
This commit is contained in:
@@ -865,7 +865,7 @@ class SchedulerPPMixin:
|
||||
|
||||
def _pp_send_pyobj_to_next_stage(self: Scheduler, data, async_send: bool = False):
|
||||
p2p_work = []
|
||||
if self.attn_tp_rank == 0:
|
||||
if self.attn_tp_rank == 0 and self.attn_cp_rank == 0:
|
||||
dp_offset = self.attn_dp_rank * self.attn_tp_size
|
||||
p2p_work = point_to_point_pyobj(
|
||||
data,
|
||||
@@ -878,7 +878,7 @@ class SchedulerPPMixin:
|
||||
return p2p_work
|
||||
|
||||
def _pp_recv_pyobj_from_prev_stage(self: Scheduler):
|
||||
if self.attn_tp_rank == 0:
|
||||
if self.attn_tp_rank == 0 and self.attn_cp_rank == 0:
|
||||
dp_offset = self.attn_dp_rank * self.attn_tp_size
|
||||
data = point_to_point_pyobj(
|
||||
[],
|
||||
@@ -898,6 +898,14 @@ class SchedulerPPMixin:
|
||||
src=self.attn_tp_group.ranks[0],
|
||||
)
|
||||
|
||||
if self.attn_cp_size > 1:
|
||||
data = broadcast_pyobj(
|
||||
data,
|
||||
self.attn_cp_group.rank,
|
||||
self.attn_cp_cpu_group,
|
||||
src=self.attn_cp_group.ranks[0],
|
||||
)
|
||||
|
||||
return data
|
||||
|
||||
def _pp_prepare_tensor_dict(
|
||||
|
||||
Reference in New Issue
Block a user