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
eea4c0aa
Commit
eea4c0aa
authored
Apr 15, 2019
by
Michael Carilli
Browse files
fp16_groups is an attribute of _amp_stash
parent
e5213b28
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
apex/amp/_process_optimizer.py
apex/amp/_process_optimizer.py
+3
-3
No files found.
apex/amp/_process_optimizer.py
View file @
eea4c0aa
...
@@ -228,8 +228,8 @@ def prepare_backward_with_master_weights_fused(self):
...
@@ -228,8 +228,8 @@ def prepare_backward_with_master_weights_fused(self):
def
post_backward_with_master_weights_fused
(
self
,
scaler
):
def
post_backward_with_master_weights_fused
(
self
,
scaler
):
stash
=
self
.
_amp_stash
stash
=
self
.
_amp_stash
stash
.
scale
=
scaler
.
loss_scale
()
stash
.
scale
=
scaler
.
loss_scale
()
stash
.
grads
=
[[
param
.
grad
.
data
for
param
in
group
]
for
group
in
s
elf
.
fp16_groups
]
stash
.
grads
=
[[
param
.
grad
.
data
for
param
in
group
]
for
group
in
s
tash
.
fp16_groups
]
stash
.
output_params
=
[[
param
for
param
in
group
]
for
group
in
s
elf
.
fp16_groups
]
stash
.
output_params
=
[[
param
for
param
in
group
]
for
group
in
s
tash
.
fp16_groups
]
norm_groups
=
[]
norm_groups
=
[]
skip
=
False
skip
=
False
...
@@ -247,7 +247,7 @@ def post_backward_with_master_weights_fused(self, scaler):
...
@@ -247,7 +247,7 @@ def post_backward_with_master_weights_fused(self, scaler):
scaler
.
_overflow_buf
.
fill_
(
1.
)
scaler
.
_overflow_buf
.
fill_
(
1.
)
scaler
.
_has_overflow
=
True
scaler
.
_has_overflow
=
True
self
.
_amp_
stash
.
grad_norms
=
norm_groups
stash
.
grad_norms
=
norm_groups
def
prepare_backward_no_master_weights_fused
(
self
):
def
prepare_backward_no_master_weights_fused
(
self
):
...
...
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