Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
b7b729b3
Unverified
Commit
b7b729b3
authored
May 26, 2023
by
Wang, Yi
Committed by
GitHub
May 26, 2023
Browse files
no_cuda does not take effect in non distributed environment (#23795)
Signed-off-by:
Wang, Yi
<
yi.a.wang@intel.com
>
parent
d61d7476
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
src/transformers/training_args.py
src/transformers/training_args.py
+3
-1
No files found.
src/transformers/training_args.py
View file @
b7b729b3
...
@@ -1684,7 +1684,9 @@ class TrainingArguments:
...
@@ -1684,7 +1684,9 @@ class TrainingArguments:
)
)
device
=
torch
.
device
(
"mps"
)
device
=
torch
.
device
(
"mps"
)
self
.
_n_gpu
=
1
self
.
_n_gpu
=
1
elif
self
.
no_cuda
:
device
=
torch
.
device
(
"cpu"
)
self
.
_n_gpu
=
0
else
:
else
:
# if n_gpu is > 1 we'll use nn.DataParallel.
# 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`
# If you only want to use a specific subset of GPUs use `CUDA_VISIBLE_DEVICES=0`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment