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
OpenDAS
Megatron-LM
Commits
dfd428cb
Commit
dfd428cb
authored
Feb 18, 2021
by
Jared Casper
Browse files
Merge branch 'main_retriver_merge' into 'main'
ICT Retriever See merge request ADLR/megatron-lm!235
parents
68233932
3f3ba5e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
megatron/training.py
megatron/training.py
+6
-8
No files found.
megatron/training.py
View file @
dfd428cb
...
@@ -317,14 +317,12 @@ def setup_model_and_optimizer(model_provider_func):
...
@@ -317,14 +317,12 @@ def setup_model_and_optimizer(model_provider_func):
assert
args
.
DDP_impl
==
'local'
assert
args
.
DDP_impl
==
'local'
# get model without FP16 and/or TorchDDP wrappers
# get model without FP16 and/or TorchDDP wrappers
model
=
unwrap_model
(
model
)
if
args
.
iteration
==
0
and
len
(
unwrapped_model
)
==
1
\
for
module
in
model
:
and
hasattr
(
unwrapped_model
[
0
],
'init_state_dict_from_bert'
):
if
args
.
iteration
==
0
and
hasattr
(
module
,
print_rank_0
(
"Initializing ICT from pretrained BERT model"
)
'init_state_dict_from_bert'
):
unwrapped_model
[
0
].
init_state_dict_from_bert
()
print
(
"Initializing ICT from pretrained BERT model"
,
flush
=
True
)
if
args
.
fp16
:
module
.
init_state_dict_from_bert
()
optimizer
.
reload_model_params
()
if
args
.
fp16
:
optimizer
.
reload_model_params
()
return
model
,
optimizer
,
lr_scheduler
return
model
,
optimizer
,
lr_scheduler
...
...
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