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
apex
Commits
e5213b28
Commit
e5213b28
authored
Apr 15, 2019
by
Michael Carilli
Browse files
Scaler not needed for prepare_backward*fused
parent
5ae6008d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
apex/amp/_process_optimizer.py
apex/amp/_process_optimizer.py
+2
-2
No files found.
apex/amp/_process_optimizer.py
View file @
e5213b28
...
@@ -217,7 +217,7 @@ def post_backward_no_master_weights(self, scaler):
...
@@ -217,7 +217,7 @@ def post_backward_no_master_weights(self, scaler):
post_backward_models_are_masters
(
scaler
,
params
,
stashed_grads
)
post_backward_models_are_masters
(
scaler
,
params
,
stashed_grads
)
def
prepare_backward_with_master_weights_fused
(
self
,
scaler
):
def
prepare_backward_with_master_weights_fused
(
self
):
stash
=
self
.
_amp_stash
stash
=
self
.
_amp_stash
if
not
stash
.
lazy_init_called
:
if
not
stash
.
lazy_init_called
:
...
@@ -250,7 +250,7 @@ def post_backward_with_master_weights_fused(self, scaler):
...
@@ -250,7 +250,7 @@ def post_backward_with_master_weights_fused(self, scaler):
self
.
_amp_stash
.
grad_norms
=
norm_groups
self
.
_amp_stash
.
grad_norms
=
norm_groups
def
prepare_backward_no_master_weights_fused
(
self
,
scaler
):
def
prepare_backward_no_master_weights_fused
(
self
):
stash
=
self
.
_amp_stash
stash
=
self
.
_amp_stash
if
not
stash
.
lazy_init_called
:
if
not
stash
.
lazy_init_called
:
...
...
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