Skip to content

Commit c002856

Browse files
authored
Merge pull request #916 from andwgu/master
Fix comment to use zero-indexed ranks
2 parents 01539f9 + 95cbc6c commit c002856

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

distributed/ddp/example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ def forward(self, x):
2525
def demo_basic(local_world_size, local_rank):
2626

2727
# setup devices for this process. For local_world_size = 2, num_gpus = 8,
28-
# rank 1 uses GPUs [0, 1, 2, 3] and
29-
# rank 2 uses GPUs [4, 5, 6, 7].
28+
# rank 0 uses GPUs [0, 1, 2, 3] and
29+
# rank 1 uses GPUs [4, 5, 6, 7].
3030
n = torch.cuda.device_count() // local_world_size
3131
device_ids = list(range(local_rank * n, (local_rank + 1) * n))
3232

0 commit comments

Comments
 (0)