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
956f44f1
Unverified
Commit
956f44f1
authored
Mar 14, 2024
by
Shubham Krishna
Committed by
GitHub
Mar 14, 2024
Browse files
Fix TPU checkpointing inside Trainer (#29657)
Manually call sync step
parent
c9e3c0b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
src/transformers/trainer.py
src/transformers/trainer.py
+1
-0
No files found.
src/transformers/trainer.py
View file @
956f44f1
...
@@ -3012,6 +3012,7 @@ class Trainer:
...
@@ -3012,6 +3012,7 @@ class Trainer:
logger
.
info
(
f
"Saving model checkpoint to
{
output_dir
}
"
)
logger
.
info
(
f
"Saving model checkpoint to
{
output_dir
}
"
)
model
=
self
.
model
model
=
self
.
model
xm
.
mark_step
()
model
.
to
(
"cpu"
)
model
.
to
(
"cpu"
)
if
xm
.
is_master_ordinal
():
if
xm
.
is_master_ordinal
():
...
...
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