mirror of
https://github.com/osmarks/nanogpt-experiments.git
synced 2024-12-18 06:00:29 +00:00
Explicitly set ddp device
This commit is contained in:
parent
3fd4c0c5ef
commit
9da1627c7f
1
train.py
1
train.py
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user