File size: 806 Bytes
fd6abd3 | 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 | from setuptools import setup
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
setup(
name='gpt_oss_kernels',
ext_modules=[
CUDAExtension('gpt_oss_kernels', [
'kernels/flash_attention_hopper.cu',
'kernels/flash_attention_hopper_bwd.cu',
'kernels/mxfp4_quant.cu',
'kernels/flash_attention.cpp',
], extra_compile_args={
'cxx': ['-O3', '-std=c++17'],
'nvcc': [
'-O3', '-std=c++17',
'-arch=sm_90a', # Hopper
'-DCUDA_ENABLE_TMA=1',
'-D__CUDA_BF16_H__',
'-lineinfo',
'-maxrregcount=255',
'--ptxas-options=-v'
]
})
],
cmdclass={'build_ext': BuildExtension}
) |