Skip to content

Commit

Permalink
Pull jik876#25 Solve imbalanced gpu memory at multi-gpu distributed t…
Browse files Browse the repository at this point in the history
…raining
  • Loading branch information
shivahr committed Jan 14, 2022
1 parent 6d0412f commit 95b50d7
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 @@ -27,6 +27,7 @@ def train(rank, a, h):
world_size=h.dist_config['world_size'] * h.num_gpus, rank=rank)

torch.cuda.manual_seed(h.seed)
torch.cuda.set_device(rank)
device = torch.device('cuda:{:d}'.format(rank))

generator = Generator(h).to(device)
Expand Down

0 comments on commit 95b50d7

Please sign in to comment.