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
1fa1a073
Commit
1fa1a073
authored
Oct 30, 2018
by
Michael Carilli
Browse files
Warning message for FusedAdam import if unavailable
parent
e0bc5d62
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
apex/__init__.py
apex/__init__.py
+4
-1
apex/parallel/__init__.py
apex/parallel/__init__.py
+1
-2
apex/parallel/distributed.py
apex/parallel/distributed.py
+1
-1
No files found.
apex/__init__.py
View file @
1fa1a073
...
@@ -3,4 +3,7 @@
...
@@ -3,4 +3,7 @@
from
.
import
fp16_utils
from
.
import
fp16_utils
from
.
import
parallel
from
.
import
parallel
from
.
import
amp
from
.
import
amp
from
.
import
optimizers
try
:
from
.
import
optimizers
except
ImportError
:
print
(
"Warning: apex was installed without --cuda_ext. FusedAdam will be unavailable."
)
apex/parallel/__init__.py
View file @
1fa1a073
...
@@ -3,10 +3,9 @@ import torch
...
@@ -3,10 +3,9 @@ import torch
from
.distributed
import
DistributedDataParallel
,
Reducer
from
.distributed
import
DistributedDataParallel
,
Reducer
try
:
try
:
import
syncbn
import
syncbn
print
(
"using fused syncBN"
)
from
.optimized_sync_batchnorm
import
SyncBatchNorm
from
.optimized_sync_batchnorm
import
SyncBatchNorm
except
ImportError
:
except
ImportError
:
print
(
"
using non-fused syncBN, try install apex with 'python setup.py install --cuda_ext' to enable fused syncBN for better performance
"
)
print
(
"
Warning: apex was installed without --cuda_ext. Fused syncbn kernels will be unavailable. Python fallbacks will be used instead.
"
)
from
.sync_batchnorm
import
SyncBatchNorm
from
.sync_batchnorm
import
SyncBatchNorm
def
convert_syncbn_model
(
module
):
def
convert_syncbn_model
(
module
):
...
...
apex/parallel/distributed.py
View file @
1fa1a073
...
@@ -4,7 +4,7 @@ try:
...
@@ -4,7 +4,7 @@ try:
from
apex_C
import
flatten
from
apex_C
import
flatten
from
apex_C
import
unflatten
from
apex_C
import
unflatten
except
ImportError
:
except
ImportError
:
print
(
"
Apex was built
without --cpp_ext
; f
alling back to Python flatten and unflatten"
)
print
(
"
Warning: apex was installed
without --cpp_ext
. F
alling back to Python flatten and unflatten
.
"
)
from
torch._utils
import
_flatten_dense_tensors
as
flatten
from
torch._utils
import
_flatten_dense_tensors
as
flatten
from
torch._utils
import
_unflatten_dense_tensors
as
unflatten
from
torch._utils
import
_unflatten_dense_tensors
as
unflatten
import
torch.distributed
as
dist
import
torch.distributed
as
dist
...
...
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