[builder] builder for scaled_upper_triang_masked_softmax (#2234)

This commit is contained in:
Jiarui Fang
2022-12-30 09:58:00 +08:00
committed by GitHub
parent 31fe84237b
commit db4cbdc7fb
6 changed files with 53 additions and 18 deletions

View File

@@ -154,10 +154,8 @@ if build_cuda_ext:
'--expt-extended-lambda'
]
ext_modules.append(
cuda_ext_helper('colossalai._C.scaled_upper_triang_masked_softmax',
['scaled_upper_triang_masked_softmax.cpp', 'scaled_upper_triang_masked_softmax_cuda.cu'],
extra_cuda_flags + cc_flag))
from colossalai.kernel.op_builder import ScaledSoftmaxBuilder
ext_modules.append(ScaledSoftmaxBuilder().builder('colossalai._C.scaled_upper_triang_masked_softmax'))
ext_modules.append(
cuda_ext_helper('colossalai._C.scaled_masked_softmax',