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
df6e3cd7
Commit
df6e3cd7
authored
Aug 18, 2021
by
mshoeybi
Browse files
set grads to none for the contig. buffers
parent
68797d90
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
megatron/training.py
megatron/training.py
+1
-2
No files found.
megatron/training.py
View file @
df6e3cd7
...
@@ -354,8 +354,7 @@ def train_step(forward_step_func, data_iterator,
...
@@ -354,8 +354,7 @@ def train_step(forward_step_func, data_iterator,
if
args
.
DDP_impl
==
'local'
and
args
.
use_contiguous_buffers_in_ddp
:
if
args
.
DDP_impl
==
'local'
and
args
.
use_contiguous_buffers_in_ddp
:
for
partition
in
model
:
for
partition
in
model
:
partition
.
zero_grad_buffer
()
partition
.
zero_grad_buffer
()
else
:
optimizer
.
zero_grad
()
optimizer
.
zero_grad
()
forward_backward_func
=
get_forward_backward_func
()
forward_backward_func
=
get_forward_backward_func
()
losses_reduced
=
forward_backward_func
(
losses_reduced
=
forward_backward_func
(
...
...
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