[sgl-kernel] support hadamard (#11663)

This commit is contained in:
Fan Yin
2025-10-16 10:00:44 +08:00
committed by GitHub
parent 868403f642
commit 3289da5b41
7 changed files with 147 additions and 1 deletions

View File

@@ -60,6 +60,7 @@ FetchContent_Declare(
)
FetchContent_Populate(repo-deepgemm)
# fmt
FetchContent_Declare(
repo-fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt
@@ -113,6 +114,15 @@ FetchContent_Declare(
)
FetchContent_Populate(repo-mscclpp)
# fast-hadamard-transform
FetchContent_Declare(
repo-fast-hadamard-transform
GIT_REPOSITORY https://github.com/sgl-project/fast-hadamard-transform.git
GIT_TAG 48f3c13764dc2ec662ade842a4696a90a137f1bc
GIT_SHALLOW OFF
)
FetchContent_Populate(repo-fast-hadamard-transform)
# ccache option
option(ENABLE_CCACHE "Whether to use ccache" ON)
find_program(CCACHE_FOUND ccache)
@@ -138,6 +148,7 @@ include_directories(
${repo-flashinfer_SOURCE_DIR}/include
${repo-flashinfer_SOURCE_DIR}/csrc
${repo-mscclpp_SOURCE_DIR}/include
${repo-fast-hadamard-transform}/csrc
)
set(SGL_KERNEL_CUDA_FLAGS
@@ -329,6 +340,9 @@ set(SOURCES
"${repo-flashinfer_SOURCE_DIR}/csrc/renorm.cu"
"${repo-flashinfer_SOURCE_DIR}/csrc/sampling.cu"
"${repo-fast-hadamard-transform_SOURCE_DIR}/csrc/fast_hadamard_transform_cuda.cu"
"${repo-fast-hadamard-transform_SOURCE_DIR}/csrc/fast_hadamard_transform.cpp"
"${repo-flash-attention_SOURCE_DIR}/csrc/flash_attn/src/flash_fwd_sparse_hdim128_bf16_causal_sm80.cu"
"${repo-flash-attention_SOURCE_DIR}/csrc/flash_attn/src/flash_fwd_sparse_hdim128_bf16_sm80.cu"
"${repo-flash-attention_SOURCE_DIR}/csrc/flash_attn/src/flash_fwd_sparse_hdim128_fp16_causal_sm80.cu"