Unverified Commit b7b729b3 authored by Wang, Yi's avatar Wang, Yi Committed by GitHub
Browse files

no_cuda does not take effect in non distributed environment (#23795)


Signed-off-by: default avatarWang, Yi <yi.a.wang@intel.com>
parent d61d7476
......@@ -1684,7 +1684,9 @@ class TrainingArguments:
)
device = torch.device("mps")
self._n_gpu = 1
elif self.no_cuda:
device = torch.device("cpu")
self._n_gpu = 0
else:
# if n_gpu is > 1 we'll use nn.DataParallel.
# If you only want to use a specific subset of GPUs use `CUDA_VISIBLE_DEVICES=0`
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment