Skip to content

Commit

Permalink
respect multigpu envs, e.g. cuda:2 designation should work
Browse files Browse the repository at this point in the history
  • Loading branch information
karpathy committed Aug 19, 2022
1 parent 013af92 commit 055e7ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion makemore.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ def create_datasets(input_file):
loss.backward()
torch.nn.utils.clip_grad_norm_(model.parameters(), 1.0)
optimizer.step()
if args.device == 'cuda':
if args.device.startswith('cuda'):
torch.cuda.synchronize()
t1 = time.time()

Expand Down

0 comments on commit 055e7ee

Please sign in to comment.