Skip to content

Commit

Permalink
fix a bug in mnist_ddp example
Browse files Browse the repository at this point in the history
  • Loading branch information
tocean committed Dec 13, 2023
1 parent b1434fb commit 42ac3c2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/mnist_ddp.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ def main():

if args.local_rank == 0:
dataset1 = datasets.MNIST('./data', train=True, download=True, transform=transform)
torch.cuda.synchronize()

torch.distributed.barrier()

if args.local_rank > 0:
dataset1 = datasets.MNIST('./data', train=True, download=False, transform=transform)

Expand Down

0 comments on commit 42ac3c2

Please sign in to comment.