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
3ff2178c
"vscode:/vscode.git/clone" did not exist on "2da2f1945ce5567e27d45df43acd4f65108d5c25"
Commit
3ff2178c
authored
May 10, 2020
by
rohithkrn
Browse files
disble multi tensor apply for O4, O5
parent
de3f3fea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
apex/amp/_process_optimizer.py
apex/amp/_process_optimizer.py
+1
-1
apex/amp/scaler.py
apex/amp/scaler.py
+1
-1
No files found.
apex/amp/_process_optimizer.py
View file @
3ff2178c
...
@@ -13,7 +13,7 @@ class AmpOptimizerState(object):
...
@@ -13,7 +13,7 @@ class AmpOptimizerState(object):
def
_master_params_to_model_params
(
self
):
def
_master_params_to_model_params
(
self
):
stash
=
self
.
_amp_stash
stash
=
self
.
_amp_stash
if
multi_tensor_applier
.
available
and
not
_amp_state
.
opt_properties
.
opt_level
not
in
{
"O4"
,
"O5"
}:
if
multi_tensor_applier
.
available
and
_amp_state
.
opt_properties
.
opt_level
not
in
{
"O4"
,
"O5"
}:
if
len
(
stash
.
all_fp16_params
)
>
0
:
if
len
(
stash
.
all_fp16_params
)
>
0
:
multi_tensor_applier
(
multi_tensor_applier
(
stash
.
multi_tensor_scale
,
stash
.
multi_tensor_scale
,
...
...
apex/amp/scaler.py
View file @
3ff2178c
...
@@ -63,7 +63,7 @@ class LossScaler(object):
...
@@ -63,7 +63,7 @@ class LossScaler(object):
self
.
_unskipped
=
0
self
.
_unskipped
=
0
self
.
_has_overflow
=
False
self
.
_has_overflow
=
False
self
.
_overflow_buf
=
torch
.
cuda
.
IntTensor
([
0
])
self
.
_overflow_buf
=
torch
.
cuda
.
IntTensor
([
0
])
if
multi_tensor_applier
.
available
:
if
multi_tensor_applier
.
available
and
_amp_state
.
opt_properties
.
opt_level
not
in
{
"O4"
,
"O5"
}
:
import
amp_C
import
amp_C
LossScaler
.
has_fused_kernel
=
multi_tensor_applier
.
available
LossScaler
.
has_fused_kernel
=
multi_tensor_applier
.
available
LossScaler
.
multi_tensor_scale_cuda
=
amp_C
.
multi_tensor_scale
LossScaler
.
multi_tensor_scale_cuda
=
amp_C
.
multi_tensor_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