in dualpipe/dualpipe.py [0:0]
def _recv_backward(self, phase: int) -> None:
if self.forward_only:
return
phase ^= self.is_in_second_half
is_last_stage = (self.is_first_rank and phase == 1) or (self.is_last_rank and phase == 0)
if is_last_stage:
return
self.current_recv_b_chunk_id[phase] += 1
tensors = comm.append_irecv(self.comm_ops, self.next_rank if phase == 0 else self.prev_rank, self.group)
self.output_grad_chunks[phase].append(tensors)