Add cutlass submodule for sgl-kernel (#2676)

This commit is contained in:
Ke Bao
2024-12-31 14:28:29 +08:00
committed by GitHub
parent 339c69a243
commit b4403985d0
4 changed files with 14 additions and 0 deletions

3
.gitmodules vendored
View File

@@ -0,0 +1,3 @@
[submodule "sgl-kernel/3rdparty/cutlass"]
path = sgl-kernel/3rdparty/cutlass
url = https://github.com/NVIDIA/cutlass.git

1
sgl-kernel/3rdparty/cutlass vendored Submodule

View File

@@ -8,6 +8,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CUDA_STANDARD 17)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
set(CUTLASS_DIR "3rdparty/cutlass")
# Set CUDA architectures
set(CMAKE_CUDA_ARCHITECTURES "75;80;86;89;90")
message(STATUS "Building for CUDA architectures: ${CMAKE_CUDA_ARCHITECTURES}")
@@ -38,6 +40,8 @@ target_include_directories(_kernels
${CMAKE_CURRENT_SOURCE_DIR}/src/sgl-kernel/csrc
${CUDA_INCLUDE_DIRS}
${TORCH_INCLUDE_DIRS}
${CUTLASS_DIR}/include
${CUTLASS_DIR}/tools/util/include
)
target_link_libraries(_kernels

View File

@@ -58,6 +58,11 @@ def update_wheel_platform_tag():
old_wheel.rename(new_wheel)
cutlass = root / "3rdparty" / "cutlass"
include_dirs = [
cutlass.resolve() / "include",
cutlass.resolve() / "tools" / "util" / "include",
]
nvcc_flags = [
"-O3",
"-Xcompiler",
@@ -82,6 +87,7 @@ ext_modules = [
"src/sgl-kernel/csrc/moe_align_kernel.cu",
"src/sgl-kernel/csrc/sgl_kernel_ops.cu",
],
include_dirs=include_dirs,
extra_compile_args={
"nvcc": nvcc_flags,
"cxx": cxx_flags,