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
ColossalAI
Commits
1d625fcd
Unverified
Commit
1d625fcd
authored
May 09, 2022
by
ver217
Committed by
GitHub
May 09, 2022
Browse files
[setup] support more cuda architectures (#920)
* support more cuda archs * polish code
parent
5d8f1262
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
setup.py
setup.py
+8
-9
No files found.
setup.py
View file @
1d625fcd
import
os
import
os
import
subprocess
import
subprocess
import
sys
import
re
from
setuptools
import
find_packages
,
setup
from
setuptools
import
find_packages
,
setup
# ninja build does not work unless include_dirs are abs path
# ninja build does not work unless include_dirs are abs path
...
@@ -138,13 +137,13 @@ if build_cuda_ext:
...
@@ -138,13 +137,13 @@ if build_cuda_ext:
'nvcc'
:
append_nvcc_threads
([
'-O3'
,
'--use_fast_math'
]
+
version_dependent_macros
+
extra_cuda_flags
)
'nvcc'
:
append_nvcc_threads
([
'-O3'
,
'--use_fast_math'
]
+
version_dependent_macros
+
extra_cuda_flags
)
})
})
cc_flag
=
[]
for
arch
in
torch
.
cuda
.
get_arch_list
():
cc_flag
=
[
'-gencode'
,
'arch=compute_70,code=sm_70'
]
res
=
re
.
search
(
r
'sm_(\d+)'
,
arch
)
_
,
bare_metal_major
,
_
=
get_cuda_bare_metal_version
(
CUDA_HOME
)
if
res
:
if
int
(
bare_metal_major
)
>=
11
:
arch_cap
=
res
[
1
]
cc_flag
.
append
(
'-gencode'
)
if
int
(
arch_cap
)
>=
60
:
cc_flag
.
app
end
(
'arch=compute_80,code=sm_80'
)
cc_flag
.
ext
end
(
[
'-gencode'
,
f
'arch=compute_
{
arch_cap
}
,code=
{
arch
}
'
]
)
extra_cuda_flags
=
[
'-lineinfo'
]
extra_cuda_flags
=
[
'-lineinfo'
]
...
...
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