-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
61 lines (53 loc) · 1.61 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import os
from pathlib import Path
from setuptools import find_packages, setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
cwd = Path(os.path.dirname(os.path.abspath(__file__)))
nvcc_flags = [
"-std=c++17", # NOTE: CUTLASS requires c++17
"-gencode=arch=compute_90a,code=sm_90a",
"-O3",
"-U__CUDA_NO_HALF_OPERATORS__",
"-U__CUDA_NO_HALF_CONVERSIONS__",
"-U__CUDA_NO_BFLOAT16_OPERATORS__",
"-U__CUDA_NO_BFLOAT16_CONVERSIONS__",
"-U__CUDA_NO_BFLOAT162_OPERATORS__",
"-U__CUDA_NO_BFLOAT162_CONVERSIONS__",
"--expt-relaxed-constexpr",
"--expt-extended-lambda",
"--use_fast_math",
# "--source-in-ptx",
# "--generate-line-info",
]
ext_modules = [
CUDAExtension(
"fp8_gmm_backend",
["csrc/ops.cu", "csrc/fp8_gmm.cu", "csrc/multi_pointwise.cu", "csrc/multi_pad_fusion.cu"],
libraries=["cuda"],
include_dirs=[
f"{cwd}/third_party/cutlass/include/",
f"{cwd}/third_party/cutlass/tools/util/include/",
f"{cwd}/csrc",
],
extra_compile_args={
"cxx": ["-fopenmp", "-fPIC", "-Wno-strict-aliasing", "-O3"],
"nvcc": nvcc_flags,
},
)
]
extra_deps = {}
extra_deps["dev"] = [
"absl-py",
]
extra_deps["all"] = set(dep for deps in extra_deps.values() for dep in deps)
setup(
name="fp8_gmm",
version="0.0.1",
author="Vincent Wang",
author_email="[email protected]",
description="FP8 Grouped GEMM",
packages=find_packages(),
ext_modules=ext_modules,
cmdclass={"build_ext": BuildExtension},
extras_require=extra_deps,
)