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
fengzch-das
nunchaku
Commits
6292da93
Commit
6292da93
authored
Nov 10, 2024
by
sxtyzhangzk
Committed by
Zhekai Zhang
Nov 10, 2024
Browse files
[major] fix cutlass on msvc
parent
a9f1b7af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
setup.py
setup.py
+9
-2
No files found.
setup.py
View file @
6292da93
...
...
@@ -8,8 +8,11 @@ class CustomBuildExtension(BuildExtension):
for
ext
in
self
.
extensions
:
if
not
"cxx"
in
ext
.
extra_compile_args
:
ext
.
extra_compile_args
[
"cxx"
]
=
[]
if
not
"nvcc"
in
ext
.
extra_compile_args
:
ext
.
extra_compile_args
[
"nvcc"
]
=
[]
if
self
.
compiler
.
compiler_type
==
"msvc"
:
ext
.
extra_compile_args
[
"cxx"
]
+=
ext
.
extra_compile_args
[
"msvc"
]
ext
.
extra_compile_args
[
"nvcc"
]
+=
ext
.
extra_compile_args
[
"nvcc_msvc"
]
else
:
ext
.
extra_compile_args
[
"cxx"
]
+=
ext
.
extra_compile_args
[
"gcc"
]
super
().
build_extensions
()
...
...
@@ -45,7 +48,7 @@ if __name__ == "__main__":
return
[]
GCC_FLAGS
=
[
"-DENABLE_BF16=1"
,
"-DBUILD_NUNCHAKU=1"
,
"-fvisibility=hidden"
,
"-g"
,
"-std=c++20"
,
"-UNDEBUG"
,
"-Og"
]
MSVC_FLAGS
=
[
"/DENABLE_BF16=1"
,
"/DBUILD_NUNCHAKU=1"
,
"/std:c++20"
,
"/UNDEBUG"
]
MSVC_FLAGS
=
[
"/DENABLE_BF16=1"
,
"/DBUILD_NUNCHAKU=1"
,
"/std:c++20"
,
"/UNDEBUG"
,
"/Zc:__cplusplus"
]
NVCC_FLAGS
=
[
"-DENABLE_BF16=1"
,
"-DBUILD_NUNCHAKU=1"
,
...
...
@@ -71,6 +74,10 @@ if __name__ == "__main__":
"--generate-line-info"
,
"--ptxas-options=--allow-expensive-optimizations=true"
,
]
# https://github.com/NVIDIA/cutlass/pull/1479#issuecomment-2052300487
NVCC_MSVC_FLAGS
=
[
"-Xcompiler"
,
"/Zc:__cplusplus"
]
nunchaku_extension
=
CUDAExtension
(
name
=
"nunchaku._C"
,
...
...
@@ -100,7 +107,7 @@ if __name__ == "__main__":
*
ncond
(
"src/kernels/flash_attn/flash_api.cpp"
),
*
ncond
(
"src/kernels/flash_attn/flash_api_adapter.cpp"
),
],
extra_compile_args
=
{
"gcc"
:
GCC_FLAGS
,
"msvc"
:
MSVC_FLAGS
,
"nvcc"
:
NVCC_FLAGS
},
extra_compile_args
=
{
"gcc"
:
GCC_FLAGS
,
"msvc"
:
MSVC_FLAGS
,
"nvcc"
:
NVCC_FLAGS
,
"nvcc_msvc"
:
NVCC_MSVC_FLAGS
},
include_dirs
=
INCLUDE_DIRS
,
)
...
...
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