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
197bcc48
Commit
197bcc48
authored
Dec 12, 2018
by
Michael Carilli
Browse files
Warning instead of error if nvcc is not found
parent
b56a2088
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
20 deletions
+24
-20
docs/source/index.rst
docs/source/index.rst
+1
-1
setup.py
setup.py
+23
-19
No files found.
docs/source/index.rst
View file @
197bcc48
...
...
@@ -19,7 +19,7 @@ Installation requires CUDA 9 or later, PyTorch 0.4 or later, and Python 3. Insta
cd apex
python setup.py install [--cuda_ext] [--cpp_ext]
.. toctree::
:maxdepth: 1
:caption: AMP: Automatic Mixed Precision
...
...
setup.py
View file @
197bcc48
...
...
@@ -32,25 +32,29 @@ if "--cpp_ext" in sys.argv:
if
"--cuda_ext"
in
sys
.
argv
:
from
torch.utils.cpp_extension
import
CUDAExtension
sys
.
argv
.
remove
(
"--cuda_ext"
)
ext_modules
.
append
(
CUDAExtension
(
name
=
'fused_adam_cuda'
,
sources
=
[
'apex/optimizers/csrc/fused_adam_cuda.cpp'
,
'apex/optimizers/csrc/fused_adam_cuda_kernel.cu'
],
extra_compile_args
=
{
'cxx'
:
[
'-O3'
,],
'nvcc'
:[
'-O3'
,
'--use_fast_math'
]}))
ext_modules
.
append
(
CUDAExtension
(
name
=
'syncbn'
,
sources
=
[
'csrc/syncbn.cpp'
,
'csrc/welford.cu'
]))
ext_modules
.
append
(
CUDAExtension
(
name
=
'fused_layer_norm_cuda'
,
sources
=
[
'apex/normalization/csrc/layer_norm_cuda.cpp'
,
'apex/normalization/csrc/layer_norm_cuda_kernel.cu'
],
extra_compile_args
=
{
'cxx'
:
[
'-O3'
,],
'nvcc'
:[
'-maxrregcount=50'
,
'-O3'
,
'--use_fast_math'
]}))
if
torch
.
utils
.
cpp_extension
.
CUDA_HOME
is
None
:
print
(
"Warning: nvcc is not available. Ignoring --cuda-ext"
)
else
:
ext_modules
.
append
(
CUDAExtension
(
name
=
'fused_adam_cuda'
,
sources
=
[
'apex/optimizers/csrc/fused_adam_cuda.cpp'
,
'apex/optimizers/csrc/fused_adam_cuda_kernel.cu'
],
extra_compile_args
=
{
'cxx'
:
[
'-O3'
,],
'nvcc'
:[
'-O3'
,
'--use_fast_math'
]}))
ext_modules
.
append
(
CUDAExtension
(
name
=
'syncbn'
,
sources
=
[
'csrc/syncbn.cpp'
,
'csrc/welford.cu'
]))
ext_modules
.
append
(
CUDAExtension
(
name
=
'fused_layer_norm_cuda'
,
sources
=
[
'apex/normalization/csrc/layer_norm_cuda.cpp'
,
'apex/normalization/csrc/layer_norm_cuda_kernel.cu'
],
extra_compile_args
=
{
'cxx'
:
[
'-O3'
,],
'nvcc'
:[
'-maxrregcount=50'
,
'-O3'
,
'--use_fast_math'
]}))
setup
(
name
=
'apex'
,
...
...
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