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
2706edc4
Commit
2706edc4
authored
Mar 23, 2022
by
Lawrence McAfee
Browse files
renamed timers.
parent
cad2c80a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
megatron/training.py
megatron/training.py
+6
-6
No files found.
megatron/training.py
View file @
2706edc4
...
@@ -419,9 +419,9 @@ def train_step(forward_step_func, data_iterator,
...
@@ -419,9 +419,9 @@ def train_step(forward_step_func, data_iterator,
torch
.
cuda
.
empty_cache
()
torch
.
cuda
.
empty_cache
()
# Reduce gradients.
# Reduce gradients.
timers
(
'reduce-model-grads'
).
start
()
timers
(
'
backward-
reduce-model-grads'
).
start
()
optimizer
.
reduce_model_grads
(
args
,
timers
)
optimizer
.
reduce_model_grads
(
args
,
timers
)
timers
(
'reduce-model-grads'
).
stop
()
timers
(
'
backward-
reduce-model-grads'
).
stop
()
# Vision gradients.
# Vision gradients.
if
args
.
vision_pretraining
and
args
.
vision_pretraining_type
==
"dino"
:
if
args
.
vision_pretraining
and
args
.
vision_pretraining_type
==
"dino"
:
...
@@ -436,9 +436,9 @@ def train_step(forward_step_func, data_iterator,
...
@@ -436,9 +436,9 @@ def train_step(forward_step_func, data_iterator,
# Gather params.
# Gather params.
if
update_successful
:
if
update_successful
:
timers
(
'gather-model-params'
).
start
()
timers
(
'
backward-
gather-model-params'
).
start
()
optimizer
.
gather_model_params
(
args
,
timers
)
optimizer
.
gather_model_params
(
args
,
timers
)
timers
(
'gather-model-params'
).
stop
()
timers
(
'
backward-
gather-model-params'
).
stop
()
# Vision momentum.
# Vision momentum.
if
args
.
vision_pretraining
and
args
.
vision_pretraining_type
==
"dino"
:
if
args
.
vision_pretraining
and
args
.
vision_pretraining_type
==
"dino"
:
...
@@ -524,6 +524,8 @@ def training_log(loss_dict, total_loss_dict, learning_rate, iteration,
...
@@ -524,6 +524,8 @@ def training_log(loss_dict, total_loss_dict, learning_rate, iteration,
add_to_logging
(
'backward-send-backward-recv'
)
add_to_logging
(
'backward-send-backward-recv'
)
add_to_logging
(
'backward-params-all-reduce'
)
add_to_logging
(
'backward-params-all-reduce'
)
add_to_logging
(
'backward-embedding-all-reduce'
)
add_to_logging
(
'backward-embedding-all-reduce'
)
add_to_logging
(
'backward-reduce-model-grads'
)
add_to_logging
(
'backward-gather-model-params'
)
add_to_logging
(
'optimizer-copy-to-main-grad'
)
add_to_logging
(
'optimizer-copy-to-main-grad'
)
add_to_logging
(
'optimizer-unscale-and-check-inf'
)
add_to_logging
(
'optimizer-unscale-and-check-inf'
)
add_to_logging
(
'optimizer-clip-main-grad'
)
add_to_logging
(
'optimizer-clip-main-grad'
)
...
@@ -531,8 +533,6 @@ def training_log(loss_dict, total_loss_dict, learning_rate, iteration,
...
@@ -531,8 +533,6 @@ def training_log(loss_dict, total_loss_dict, learning_rate, iteration,
add_to_logging
(
'optimizer-inner-step'
)
add_to_logging
(
'optimizer-inner-step'
)
add_to_logging
(
'optimizer-copy-main-to-model-params'
)
add_to_logging
(
'optimizer-copy-main-to-model-params'
)
add_to_logging
(
'optimizer'
)
add_to_logging
(
'optimizer'
)
add_to_logging
(
'reduce-model-grads'
)
add_to_logging
(
'gather-model-params'
)
add_to_logging
(
'batch-generator'
)
add_to_logging
(
'batch-generator'
)
# Calculate batch size.
# 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