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
9efb2809
Commit
9efb2809
authored
Apr 16, 2019
by
Michael Carilli
Browse files
Compatibility between skip_step and FusedAdam.step
parent
111ee132
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
apex/amp/handle.py
apex/amp/handle.py
+1
-1
No files found.
apex/amp/handle.py
View file @
9efb2809
...
@@ -122,7 +122,7 @@ def scale_loss(loss,
...
@@ -122,7 +122,7 @@ def scale_loss(loss,
# necessary because amp.scale_loss is already creating a temporary scope.
# necessary because amp.scale_loss is already creating a temporary scope.
def
patch_step
(
opt
,
loss_scaler
,
loss_id
):
def
patch_step
(
opt
,
loss_scaler
,
loss_id
):
opt_step
=
opt
.
step
opt_step
=
opt
.
step
def
skip_step
():
def
skip_step
(
scale
=
None
):
maybe_print
((
"Gradient overflow. Skipping step, loss scaler "
+
maybe_print
((
"Gradient overflow. Skipping step, loss scaler "
+
"{} reducing loss scale to {}"
).
format
(
loss_id
,
"{} reducing loss scale to {}"
).
format
(
loss_id
,
loss_scaler
.
loss_scale
()))
loss_scaler
.
loss_scale
()))
...
...
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