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
7fd2d686
Unverified
Commit
7fd2d686
authored
Sep 11, 2023
by
Hang
Committed by
GitHub
Sep 11, 2023
Browse files
only main process should call _save on deepspeed zero3 (#25959)
only main process should call _save when deepspeed zero3
parent
95b37495
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
src/transformers/trainer.py
src/transformers/trainer.py
+2
-1
No files found.
src/transformers/trainer.py
View file @
7fd2d686
...
@@ -2850,7 +2850,8 @@ class Trainer:
...
@@ -2850,7 +2850,8 @@ class Trainer:
" stage3_gather_16bit_weights_on_model_save=false. Saving the full checkpoint instead, use"
" stage3_gather_16bit_weights_on_model_save=false. Saving the full checkpoint instead, use"
" zero_to_fp32.py to recover weights"
" zero_to_fp32.py to recover weights"
)
)
self
.
_save
(
output_dir
,
state_dict
=
{})
if
self
.
args
.
should_save
:
self
.
_save
(
output_dir
,
state_dict
=
{})
# remove the dummy state_dict
# remove the dummy state_dict
remove_dummy_checkpoint
(
self
.
args
.
should_save
,
output_dir
,
[
WEIGHTS_NAME
,
SAFE_WEIGHTS_NAME
])
remove_dummy_checkpoint
(
self
.
args
.
should_save
,
output_dir
,
[
WEIGHTS_NAME
,
SAFE_WEIGHTS_NAME
])
self
.
model_wrapped
.
save_checkpoint
(
output_dir
)
self
.
model_wrapped
.
save_checkpoint
(
output_dir
)
...
...
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