Skip to content

Commit

Permalink
Explicitly set ddp device
Browse files Browse the repository at this point in the history
  • Loading branch information
ramtingh authored Feb 4, 2023
1 parent 3fd4c0c commit 9da1627
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
ddp_rank = int(os.environ['RANK'])
ddp_local_rank = int(os.environ['LOCAL_RANK'])
device = f'cuda:{ddp_local_rank}'
torch.cuda.set_device(device)
master_process = ddp_rank == 0 # this process will do logging, checkpointing etc.
seed_offset = ddp_rank # each process gets a different seed
else:
Expand Down

0 comments on commit 9da1627

Please sign in to comment.