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
cad2c80a
"vscode:/vscode.git/clone" did not exist on "a9cb3a25dfb689e45a49a8998d8e1c31171f190a"
Commit
cad2c80a
authored
Mar 23, 2022
by
Lawrence McAfee
Browse files
added timers for reduce-grads/gather-params.
parent
80c91145
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
megatron/training.py
megatron/training.py
+6
-0
No files found.
megatron/training.py
View file @
cad2c80a
...
...
@@ -419,7 +419,9 @@ def train_step(forward_step_func, data_iterator,
torch
.
cuda
.
empty_cache
()
# Reduce gradients.
timers
(
'reduce-model-grads'
).
start
()
optimizer
.
reduce_model_grads
(
args
,
timers
)
timers
(
'reduce-model-grads'
).
stop
()
# Vision gradients.
if
args
.
vision_pretraining
and
args
.
vision_pretraining_type
==
"dino"
:
...
...
@@ -434,7 +436,9 @@ def train_step(forward_step_func, data_iterator,
# Gather params.
if
update_successful
:
timers
(
'gather-model-params'
).
start
()
optimizer
.
gather_model_params
(
args
,
timers
)
timers
(
'gather-model-params'
).
stop
()
# Vision momentum.
if
args
.
vision_pretraining
and
args
.
vision_pretraining_type
==
"dino"
:
...
...
@@ -527,6 +531,8 @@ def training_log(loss_dict, total_loss_dict, learning_rate, iteration,
add_to_logging
(
'optimizer-inner-step'
)
add_to_logging
(
'optimizer-copy-main-to-model-params'
)
add_to_logging
(
'optimizer'
)
add_to_logging
(
'reduce-model-grads'
)
add_to_logging
(
'gather-model-params'
)
add_to_logging
(
'batch-generator'
)
# Calculate batch size.
...
...
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