diff --git a/sgl-kernel/CMakeLists.txt b/sgl-kernel/CMakeLists.txt index f646cc873..72cac8ec9 100644 --- a/sgl-kernel/CMakeLists.txt +++ b/sgl-kernel/CMakeLists.txt @@ -86,6 +86,7 @@ option(SGL_KERNEL_ENABLE_SM100A "Enable SM100A" OFF) option(SGL_KERNEL_ENABLE_SM90A "Enable SM90A" OFF) option(SGL_KERNEL_ENABLE_BF16 "Enable BF16" ON) option(SGL_KERNEL_ENABLE_FP8 "Enable FP8" ON) +option(SGL_KERNEL_ENABLE_FP4 "Enable FP4" OFF) if ("${CUDA_VERSION}" VERSION_GREATER_EQUAL "12.8" OR SGL_KERNEL_ENABLE_SM100A) list(APPEND SGL_KERNEL_CUDA_FLAGS @@ -118,6 +119,12 @@ if (SGL_KERNEL_ENABLE_FP8) ) endif() +if (SGL_KERNEL_ENABLE_FP4) + list(APPEND SGL_KERNEL_CUDA_FLAGS + "-DENABLE_NVFP4=1" + ) +endif() + string(REPLACE "-D__CUDA_NO_HALF_OPERATORS__" "" CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS}") string(REPLACE "-D__CUDA_NO_HALF_CONVERSIONS__" "" CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS}") string(REPLACE "-D__CUDA_NO_BFLOAT16_CONVERSIONS__" "" CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS}") diff --git a/sgl-kernel/Makefile b/sgl-kernel/Makefile index 2eb9ddc55..e8e0910cd 100644 --- a/sgl-kernel/Makefile +++ b/sgl-kernel/Makefile @@ -45,7 +45,8 @@ format: check-deps ## Format all source files @pre-commit run --all-files FILES_TO_UPDATE = python/sgl_kernel/version.py \ - pyproject.toml + pyproject.toml \ + pyproject_rocm.toml update: ## Update version numbers across project files. Usage: make update @if [ -z "$(filter-out $@,$(MAKECMDGOALS))" ]; then \ diff --git a/sgl-kernel/pyproject.toml b/sgl-kernel/pyproject.toml index 2169f5118..393dc6d0f 100644 --- a/sgl-kernel/pyproject.toml +++ b/sgl-kernel/pyproject.toml @@ -8,7 +8,7 @@ build-backend = "scikit_build_core.build" [project] name = "sgl-kernel" -version = "0.0.5.post3" +version = "0.0.5.post4" description = "Kernel Library for SGLang" readme = "README.md" requires-python = ">=3.9" diff --git a/sgl-kernel/pyproject_rocm.toml b/sgl-kernel/pyproject_rocm.toml index 850f4ca20..db9c4a526 100644 --- a/sgl-kernel/pyproject_rocm.toml +++ b/sgl-kernel/pyproject_rocm.toml @@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta" [project] name = "sgl-kernel" -version = "0.0.5.post3" +version = "0.0.5.post4" description = "Kernel Library for SGLang" readme = "README.md" requires-python = ">=3.9" diff --git a/sgl-kernel/python/sgl_kernel/version.py b/sgl-kernel/python/sgl_kernel/version.py index 7be236d9a..15dc84979 100644 --- a/sgl-kernel/python/sgl_kernel/version.py +++ b/sgl-kernel/python/sgl_kernel/version.py @@ -1 +1 @@ -__version__ = "0.0.5.post3" +__version__ = "0.0.5.post4"