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
3a701586
Commit
3a701586
authored
Apr 14, 2020
by
Mohammad
Browse files
using None for resetting gradients
parent
8ceed7c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
megatron/training.py
megatron/training.py
+1
-1
No files found.
megatron/training.py
View file @
3a701586
...
...
@@ -227,7 +227,7 @@ def backward_step(optimizer, model, loss):
timers
=
get_timers
()
# Backward pass.
optimizer
.
zero_grad
()
optimizer
.
zero_grad
(
set_grads_to_None
=
True
)
if
args
.
fp16
:
optimizer
.
backward
(
loss
,
update_master_grads
=
False
)
else
:
...
...
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