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
476be08c
Unverified
Commit
476be08c
authored
Jul 18, 2023
by
Zach Mueller
Committed by
GitHub
Jul 18, 2023
Browse files
Check for accelerate env var when doing CPU only (#24890)
Check for use-cpu
parent
a982c022
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/training_args.py
src/transformers/training_args.py
+1
-1
No files found.
src/transformers/training_args.py
View file @
476be08c
...
...
@@ -1720,7 +1720,7 @@ class TrainingArguments:
self
.
distributed_state
=
None
if
not
self
.
use_ipex
and
"ACCELERATE_USE_IPEX"
not
in
os
.
environ
:
os
.
environ
[
"ACCELERATE_USE_IPEX"
]
=
"false"
if
self
.
use_cpu
:
if
self
.
use_cpu
or
os
.
environ
.
get
(
"ACCELERATE_USE_CPU"
,
False
)
:
self
.
distributed_state
=
PartialState
(
cpu
=
True
,
backend
=
self
.
ddp_backend
)
self
.
_n_gpu
=
0
elif
is_sagemaker_mp_enabled
():
...
...
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