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
47c269b6
Unverified
Commit
47c269b6
authored
Feb 26, 2022
by
Masaki Kozuki
Committed by
GitHub
Feb 26, 2022
Browse files
build fused grad accum w/ wgrad only if cuda>10 (#1312)
parent
ddc08039
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
28 deletions
+28
-28
setup.py
setup.py
+28
-28
No files found.
setup.py
View file @
47c269b6
...
...
@@ -298,42 +298,42 @@ if "--cuda_ext" in sys.argv:
)
# Check, if CUDA11 is installed for compute capability 8.0
cc_flag
=
[]
_
,
bare_metal_major
,
bare_metal_minor
=
get_cuda_bare_metal_version
(
CUDA_HOME
)
if
int
(
bare_metal_major
)
>=
11
:
cc_flag
=
[]
cc_flag
.
append
(
"-gencode"
)
cc_flag
.
append
(
"arch=compute_80,code=sm_80"
)
if
int
(
bare_metal_minor
)
>
0
:
cc_flag
.
append
(
"-gencode"
)
cc_flag
.
append
(
"arch=compute_86,code=sm_86"
)
ext_modules
.
append
(
CUDAExtension
(
name
=
"fused_weight_gradient_mlp_cuda"
,
include_dirs
=
[
os
.
path
.
join
(
this_dir
,
"csrc"
)],
sources
=
[
"csrc/megatron/fused_weight_gradient_dense.cpp"
,
"csrc/megatron/fused_weight_gradient_dense_cuda.cu"
,
"csrc/megatron/fused_weight_gradient_dense_16bit_prec_cuda.cu"
,
],
extra_compile_args
=
{
"cxx"
:
[
"-O3"
]
+
version_dependent_macros
,
"nvcc"
:
append_nvcc_threads
(
[
"-O3"
,
"-gencode"
,
"arch=compute_70,code=sm_70"
,
"-U__CUDA_NO_HALF_OPERATORS__"
,
"-U__CUDA_NO_HALF_CONVERSIONS__"
,
"--expt-relaxed-constexpr"
,
"--expt-extended-lambda"
,
"--use_fast_math"
,
]
+
version_dependent_macros
+
cc_flag
),
},
ext_modules
.
append
(
CUDAExtension
(
name
=
"fused_weight_gradient_mlp_cuda"
,
include_dirs
=
[
os
.
path
.
join
(
this_dir
,
"csrc"
)],
sources
=
[
"csrc/megatron/fused_weight_gradient_dense.cpp"
,
"csrc/megatron/fused_weight_gradient_dense_cuda.cu"
,
"csrc/megatron/fused_weight_gradient_dense_16bit_prec_cuda.cu"
,
],
extra_compile_args
=
{
"cxx"
:
[
"-O3"
]
+
version_dependent_macros
,
"nvcc"
:
append_nvcc_threads
(
[
"-O3"
,
"-gencode"
,
"arch=compute_70,code=sm_70"
,
"-U__CUDA_NO_HALF_OPERATORS__"
,
"-U__CUDA_NO_HALF_CONVERSIONS__"
,
"--expt-relaxed-constexpr"
,
"--expt-extended-lambda"
,
"--use_fast_math"
,
]
+
version_dependent_macros
+
cc_flag
),
},
)
)
)
if
"--permutation_search"
in
sys
.
argv
:
sys
.
argv
.
remove
(
"--permutation_search"
)
...
...
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