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
e3a97163
Unverified
Commit
e3a97163
authored
Sep 07, 2023
by
Zach Mueller
Committed by
GitHub
Sep 07, 2023
Browse files
Fix err with FSDP (#25991)
* Fix err * Use version check
parent
fa6107c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
src/transformers/trainer.py
src/transformers/trainer.py
+9
-8
No files found.
src/transformers/trainer.py
View file @
e3a97163
...
@@ -3910,15 +3910,16 @@ class Trainer:
...
@@ -3910,15 +3910,16 @@ class Trainer:
fsdp_plugin
.
limit_all_gathers
=
self
.
args
.
fsdp_config
.
get
(
fsdp_plugin
.
limit_all_gathers
=
self
.
args
.
fsdp_config
.
get
(
"limit_all_gathers"
,
fsdp_plugin
.
limit_all_gathers
"limit_all_gathers"
,
fsdp_plugin
.
limit_all_gathers
)
)
fsdp_plugin
.
activation_checkpointing
=
self
.
args
.
fsdp_config
.
get
(
if
is_accelerate_available
(
"0.23.0"
):
"activation_checkpointing"
,
fsdp_plugin
.
activation_checkpointing
fsdp_plugin
.
activation_checkpointing
=
self
.
args
.
fsdp_config
.
get
(
)
"activation_checkpointing"
,
fsdp_plugin
.
activation_checkpointing
if
fsdp_plugin
.
activation_checkpointing
and
self
.
args
.
gradient_checkpointing
:
raise
ValueError
(
"The activation_checkpointing in FSDP config and the gradient_checkpointing in training arg "
"can't be set to True simultaneously. Please use FSDP's activation_checkpointing logic "
"when using FSDP."
)
)
if
fsdp_plugin
.
activation_checkpointing
and
self
.
args
.
gradient_checkpointing
:
raise
ValueError
(
"The activation_checkpointing in FSDP config and the gradient_checkpointing in training arg "
"can't be set to True simultaneously. Please use FSDP's activation_checkpointing logic "
"when using FSDP."
)
if
self
.
is_deepspeed_enabled
:
if
self
.
is_deepspeed_enabled
:
if
getattr
(
self
.
args
,
"hf_deepspeed_config"
,
None
)
is
None
:
if
getattr
(
self
.
args
,
"hf_deepspeed_config"
,
None
)
is
None
:
...
...
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