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
wuxk1
Megatron-LM
Commits
74ba3797
Commit
74ba3797
authored
Jun 08, 2022
by
Lawrence McAfee
Browse files
fixed load_checkpoint().
parent
b178e6fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
megatron/checkpointing.py
megatron/checkpointing.py
+4
-1
No files found.
megatron/checkpointing.py
View file @
74ba3797
...
...
@@ -367,7 +367,10 @@ def load_checkpoint(model, optimizer, opt_param_scheduler, load_arg='load', stri
# Load the checkpoint.
try
:
model_state_dict
=
torch
.
load
(
model_checkpoint_name
,
map_location
=
'cpu'
)
optim_state_dict
=
torch
.
load
(
optim_checkpoint_name
,
map_location
=
'cpu'
)
if
args
.
use_distributed_optimizer
:
optim_state_dict
=
torch
.
load
(
optim_checkpoint_name
,
map_location
=
'cpu'
)
else
:
optim_state_dict
=
model_state_dict
except
ModuleNotFoundError
:
from
megatron.fp16_deprecated
import
loss_scaler
# For backward compatibility.
...
...
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