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
f777e6b3
Commit
f777e6b3
authored
Jul 05, 2021
by
zihanl
Browse files
update finetune_utils.py
parent
5aa3d5e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
tasks/finetune_utils.py
tasks/finetune_utils.py
+5
-0
No files found.
tasks/finetune_utils.py
View file @
f777e6b3
...
...
@@ -177,6 +177,7 @@ def _train(model, optimizer, lr_scheduler, forward_step,
report_memory_flag
=
True
# For each remaining epoch
args
.
consumed_train_samples
=
0
timers
(
'interval-time'
).
start
()
for
epoch
in
range
(
start_epoch
,
args
.
epochs
):
print_rank_0
(
'working on epoch {} ...'
.
format
(
epoch
+
1
))
...
...
@@ -196,6 +197,10 @@ def _train(model, optimizer, lr_scheduler, forward_step,
# Train for one step.
out
=
train_step
(
forward_step
,
batch
,
model
,
optimizer
,
lr_scheduler
)
args
.
consumed_train_samples
+=
mpu
.
get_data_parallel_world_size
()
*
\
args
.
micro_batch_size
*
\
get_num_microbatches
()
losses_dict
,
skipped_iter
,
grad_norm
,
num_zeros_in_grad
=
out
iteration
+=
1
...
...
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