2023-07-21 02:59:00 -06:00
|
|
|
from setuptools import setup
|
|
|
|
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
|
2024-09-30 02:54:32 -06:00
|
|
|
import torch
|
|
|
|
|
|
|
|
extra_cuda_cflags = []
|
|
|
|
extra_cflags = []
|
|
|
|
if torch.version.hip:
|
|
|
|
extra_cflags = ["-DLEGACY_HIPBLAS_DIRECT=ON"]
|
|
|
|
extra_cuda_cflags = ["-DLEGACY_HIPBLAS_DIRECT=ON"]
|
|
|
|
|
|
|
|
extra_compile_args = {
|
|
|
|
"cxx": extra_cflags,
|
|
|
|
"nvcc": extra_cuda_cflags,
|
|
|
|
}
|
2023-07-21 02:59:00 -06:00
|
|
|
|
|
|
|
setup(
|
|
|
|
name="exllama_kernels",
|
|
|
|
ext_modules=[
|
|
|
|
CUDAExtension(
|
|
|
|
name="exllama_kernels",
|
|
|
|
sources=[
|
|
|
|
"exllama_kernels/exllama_ext.cpp",
|
|
|
|
"exllama_kernels/cuda_buffers.cu",
|
|
|
|
"exllama_kernels/cuda_func/column_remap.cu",
|
|
|
|
"exllama_kernels/cuda_func/q4_matmul.cu",
|
2023-07-24 03:43:58 -06:00
|
|
|
"exllama_kernels/cuda_func/q4_matrix.cu",
|
2023-07-21 02:59:00 -06:00
|
|
|
],
|
2024-09-30 02:54:32 -06:00
|
|
|
extra_compile_args=extra_compile_args,
|
2023-07-21 02:59:00 -06:00
|
|
|
)
|
|
|
|
],
|
|
|
|
cmdclass={"build_ext": BuildExtension},
|
|
|
|
)
|