2023-06-08 06:51:52 -06:00
|
|
|
from setuptools import setup
|
|
|
|
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
|
2023-11-27 06:08:12 -07:00
|
|
|
import torch
|
|
|
|
|
|
|
|
extra_compile_args = ["-std=c++17"]
|
|
|
|
if not torch.version.hip:
|
|
|
|
extra_compile_args.append("-arch=compute_80")
|
2023-06-08 06:51:52 -06:00
|
|
|
|
|
|
|
setup(
|
|
|
|
name="custom_kernels",
|
|
|
|
ext_modules=[
|
|
|
|
CUDAExtension(
|
|
|
|
name="custom_kernels.fused_bloom_attention_cuda",
|
|
|
|
sources=["custom_kernels/fused_bloom_attention_cuda.cu"],
|
2023-11-27 06:08:12 -07:00
|
|
|
extra_compile_args=extra_compile_args,
|
2023-06-08 06:51:52 -06:00
|
|
|
),
|
|
|
|
CUDAExtension(
|
|
|
|
name="custom_kernels.fused_attention_cuda",
|
|
|
|
sources=["custom_kernels/fused_attention_cuda.cu"],
|
2023-11-27 06:08:12 -07:00
|
|
|
extra_compile_args=extra_compile_args,
|
2023-06-08 06:51:52 -06:00
|
|
|
),
|
|
|
|
],
|
|
|
|
cmdclass={"build_ext": BuildExtension},
|
|
|
|
)
|