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
28cd66e1
Commit
28cd66e1
authored
Aug 28, 2020
by
mohammad
Committed by
Deepak Narayanan
Nov 12, 2020
Browse files
fp32 working
parent
b4b0d739
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
megatron/training.py
megatron/training.py
+2
-1
No files found.
megatron/training.py
View file @
28cd66e1
...
@@ -238,10 +238,11 @@ def backward_step(optimizer, model, loss):
...
@@ -238,10 +238,11 @@ def backward_step(optimizer, model, loss):
# Backward pass.
# Backward pass.
timers
(
'backward-backward'
).
start
()
timers
(
'backward-backward'
).
start
()
optimizer
.
zero_grad
(
set_grads_to_None
=
True
)
if
args
.
fp16
:
if
args
.
fp16
:
optimizer
.
zero_grad
(
set_grads_to_None
=
True
)
optimizer
.
backward
(
loss
,
update_master_grads
=
False
)
optimizer
.
backward
(
loss
,
update_master_grads
=
False
)
else
:
else
:
optimizer
.
zero_grad
()
loss
.
backward
()
loss
.
backward
()
timers
(
'backward-backward'
).
stop
()
timers
(
'backward-backward'
).
stop
()
...
...
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