mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-04-21 06:42:10 +00:00
This change adds support for 2:4 sparsity when using Marlin quantization. The 2:4 kernel is used when: * The quantizer is `marlin`; * the quantizer checkpoint format is `marlin_24`. Fixes #2098.
23 lines
654 B
Python
23 lines
654 B
Python
from setuptools import setup
|
|
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
|
|
|
|
extra_compile_args = []
|
|
|
|
setup(
|
|
name="marlin_kernels",
|
|
ext_modules=[
|
|
CUDAExtension(
|
|
name="marlin_kernels",
|
|
sources=[
|
|
"marlin_kernels/gptq_marlin.cu",
|
|
"marlin_kernels/gptq_marlin_repack.cu",
|
|
"marlin_kernels/marlin_cuda_kernel.cu",
|
|
"marlin_kernels/sparse/marlin_24_cuda_kernel.cu",
|
|
"marlin_kernels/ext.cpp",
|
|
],
|
|
extra_compile_args=extra_compile_args,
|
|
),
|
|
],
|
|
cmdclass={"build_ext": BuildExtension},
|
|
)
|