1
0
mirror of https://github.com/osmarks/nanogpt-experiments.git synced 2025-10-18 17:17:40 +00:00

Merge pull request #116 from ramtingh/master

Minor change to allow using ddp with exclusive process mode
This commit is contained in:
Andrej
2023-02-04 07:42:32 -08:00
committed by GitHub

View File

@@ -85,6 +85,7 @@ if ddp:
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: