Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
zhaoyu6
sglang
Commits
dae79444
"vscode:/vscode.git/clone" did not exist on "3efa5bbbfd5868695da4d5d9ad23d81f48f1e5a8"
Unverified
Commit
dae79444
authored
Apr 14, 2025
by
Lianmin Zheng
Committed by
GitHub
Apr 14, 2025
Browse files
minor clean up of sgl-kernel/CMakeLists.txt (#5393)
parent
f6772f14
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
sgl-kernel/CMakeLists.txt
sgl-kernel/CMakeLists.txt
+15
-9
No files found.
sgl-kernel/CMakeLists.txt
View file @
dae79444
cmake_minimum_required
(
VERSION 3.26 FATAL_ERROR
)
cmake_minimum_required
(
VERSION 3.26 FATAL_ERROR
)
project
(
sgl-kernel LANGUAGES CXX CUDA
)
project
(
sgl-kernel LANGUAGES CXX CUDA
)
# CMake
cmake_policy
(
SET CMP0169 OLD
)
cmake_policy
(
SET CMP0169 OLD
)
include
(
${
CMAKE_CURRENT_LIST_DIR
}
/cmake/utils.cmake
)
include
(
${
CMAKE_CURRENT_LIST_DIR
}
/cmake/utils.cmake
)
# Python
find_package
(
Python COMPONENTS Interpreter Development.Module
${
SKBUILD_SABI_COMPONENT
}
REQUIRED
)
find_package
(
Python COMPONENTS Interpreter Development.Module
${
SKBUILD_SABI_COMPONENT
}
REQUIRED
)
# CXX
set
(
CMAKE_CXX_STANDARD 17
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-O3"
)
# Cuda
enable_language
(
CUDA
)
enable_language
(
CUDA
)
find_package
(
CUDAToolkit REQUIRED
)
find_package
(
CUDAToolkit REQUIRED
)
set_property
(
GLOBAL PROPERTY CUDA_SEPARABLE_COMPILATION ON
)
message
(
STATUS
"Detected CUDA_VERSION=
${
CUDA_VERSION
}
"
)
message
(
STATUS
"Detected CUDA_VERSION=
${
CUDA_VERSION
}
"
)
if
(
"
${
CUDA_VERSION
}
"
VERSION_GREATER_EQUAL
"12.8"
)
if
(
"
${
CUDA_VERSION
}
"
VERSION_GREATER_EQUAL
"12.8"
)
...
@@ -21,12 +28,11 @@ elseif ("${CUDA_VERSION}" VERSION_GREATER_EQUAL "11.8")
...
@@ -21,12 +28,11 @@ elseif ("${CUDA_VERSION}" VERSION_GREATER_EQUAL "11.8")
message
(
"CUDA_VERSION
${
CUDA_VERSION
}
>= 11.8"
)
message
(
"CUDA_VERSION
${
CUDA_VERSION
}
>= 11.8"
)
endif
()
endif
()
# Torch
find_package
(
Torch REQUIRED
)
find_package
(
Torch REQUIRED
)
# clean Torch Flag
# clean Torch Flag
clear_cuda_arches
(
CMAKE_FLAG
)
clear_cuda_arches
(
CMAKE_FLAG
)
set_property
(
GLOBAL PROPERTY CUDA_SEPARABLE_COMPILATION ON
)
include
(
FetchContent
)
include
(
FetchContent
)
# cutlass
# cutlass
...
@@ -82,9 +88,6 @@ include_directories(
...
@@ -82,9 +88,6 @@ include_directories(
${
repo-flashinfer_SOURCE_DIR
}
/csrc
${
repo-flashinfer_SOURCE_DIR
}
/csrc
)
)
set
(
CMAKE_CXX_STANDARD 17
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-O3"
)
set
(
SGL_KERNEL_CUDA_FLAGS
set
(
SGL_KERNEL_CUDA_FLAGS
"-DNDEBUG"
"-DNDEBUG"
"-DOPERATOR_NAMESPACE=sgl-kernel"
"-DOPERATOR_NAMESPACE=sgl-kernel"
...
@@ -104,9 +107,14 @@ set(SGL_KERNEL_CUDA_FLAGS
...
@@ -104,9 +107,14 @@ set(SGL_KERNEL_CUDA_FLAGS
"-DCUTLASS_TEST_ENABLE_CACHED_RESULTS=1"
"-DCUTLASS_TEST_ENABLE_CACHED_RESULTS=1"
"-DCUTLASS_DEBUG_TRACE_LEVEL=0"
"-DCUTLASS_DEBUG_TRACE_LEVEL=0"
"--expt-relaxed-constexpr"
"--expt-relaxed-constexpr"
"--expt-extended-lambda"
"--threads=32"
"-Xcompiler=-Wconversion"
"-Xcompiler=-Wconversion"
"-Xcompiler=-fno-strict-aliasing"
"-Xcompiler=-fno-strict-aliasing"
"--threads=16"
# uncomment to debug
# "--ptxas-options=-v"
# "--ptxas-options=--verbose,--register-usage-level=10,--warn-on-local-memory-usage"
)
)
option
(
SGL_KERNEL_ENABLE_SM100A
"Enable SM100A"
OFF
)
option
(
SGL_KERNEL_ENABLE_SM100A
"Enable SM100A"
OFF
)
...
@@ -114,10 +122,8 @@ option(SGL_KERNEL_ENABLE_SM90A "Enable SM90A" OFF)
...
@@ -114,10 +122,8 @@ option(SGL_KERNEL_ENABLE_SM90A "Enable SM90A" OFF)
option
(
SGL_KERNEL_ENABLE_BF16
"Enable BF16"
ON
)
option
(
SGL_KERNEL_ENABLE_BF16
"Enable BF16"
ON
)
option
(
SGL_KERNEL_ENABLE_FP8
"Enable FP8"
ON
)
option
(
SGL_KERNEL_ENABLE_FP8
"Enable FP8"
ON
)
option
(
SGL_KERNEL_ENABLE_FP4
"Enable FP4"
OFF
)
option
(
SGL_KERNEL_ENABLE_FP4
"Enable FP4"
OFF
)
option
(
SGL_KERNEL_ENABLE_FA3
"Enable FA3"
OFF
)
option
(
SGL_KERNEL_ENABLE_FA3
"Enable FA3"
OFF
)
if
(
"
${
CUDA_VERSION
}
"
VERSION_GREATER_EQUAL
"12.8"
OR SGL_KERNEL_ENABLE_SM100A
)
if
(
"
${
CUDA_VERSION
}
"
VERSION_GREATER_EQUAL
"12.8"
OR SGL_KERNEL_ENABLE_SM100A
)
list
(
APPEND SGL_KERNEL_CUDA_FLAGS
list
(
APPEND SGL_KERNEL_CUDA_FLAGS
"-gencode=arch=compute_100,code=sm_100"
"-gencode=arch=compute_100,code=sm_100"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment