From 2e11853d04c3773929c1292bcb931b8cd241a0da Mon Sep 17 00:00:00 2001 From: Zangwei Date: Fri, 1 Apr 2022 21:38:05 +0800 Subject: [PATCH] [NFC] polish colossalai/communication/ring.py code style (#630) --- colossalai/communication/ring.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/colossalai/communication/ring.py b/colossalai/communication/ring.py index 2a2e8bff0..3e1a8998f 100644 --- a/colossalai/communication/ring.py +++ b/colossalai/communication/ring.py @@ -34,15 +34,13 @@ def ring_forward(tensor_send_next: torch.Tensor, parallel_mode: ParallelMode): dtype=tensor_send_next.dtype) # send to next rank - send_next_op = torch.distributed.P2POp( - torch.distributed.isend, tensor_send_next, - gpc.get_next_global_rank(parallel_mode)) + send_next_op = torch.distributed.P2POp(torch.distributed.isend, tensor_send_next, + gpc.get_next_global_rank(parallel_mode)) ops.append(send_next_op) # receive from prev rank - recv_prev_op = torch.distributed.P2POp( - torch.distributed.irecv, tensor_recv_prev, - gpc.get_prev_global_rank(parallel_mode)) + recv_prev_op = torch.distributed.P2POp(torch.distributed.irecv, tensor_recv_prev, + gpc.get_prev_global_rank(parallel_mode)) ops.append(recv_prev_op) if current_rank % 2 == 0: