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
a413c725
Unverified
Commit
a413c725
authored
Dec 12, 2022
by
Sourab Mangrulkar
Committed by
GitHub
Dec 12, 2022
Browse files
fsdp fix (#20719)
parent
17c742bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
src/transformers/trainer.py
src/transformers/trainer.py
+1
-2
No files found.
src/transformers/trainer.py
View file @
a413c725
...
...
@@ -1424,9 +1424,8 @@ class Trainer:
cpu_offload
=
cpu_offload
,
auto_wrap_policy
=
auto_wrap_policy
,
mixed_precision
=
mixed_precision_policy
,
device_id
=
self
.
args
.
device
,
)
if
FSDPOption
.
OFFLOAD
not
in
self
.
args
.
fsdp
:
model
.
to
(
self
.
args
.
device
)
elif
is_sagemaker_dp_enabled
():
model
=
nn
.
parallel
.
DistributedDataParallel
(
model
,
device_ids
=
[
int
(
os
.
getenv
(
"SMDATAPARALLEL_LOCAL_RANK"
))]
...
...
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