Explorar el Código

fixing the cuda id

Hamid Shojanazeri hace 1 año
padre
commit
a7156dfb5d
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      utils/train_utils.py

+ 1 - 1
utils/train_utils.py

@@ -199,7 +199,7 @@ def evaluation(model,train_config, eval_dataloader, local_rank, tokenizer):
                 if train_config.enable_fsdp:
                     batch[key] = batch[key].to(local_rank)
                 else:
-                    batch[key] = batch[key].to('cuda')
+                    batch[key] = batch[key].to('cuda:0')
             # Ensure no gradients are computed for this scope to save memory
             with torch.no_grad():
                 # Forward pass and compute loss