diff --git a/.github/workflows/release-whl-kernel.yml b/.github/workflows/release-whl-kernel.yml index 516e3ea58..fd105f16d 100644 --- a/.github/workflows/release-whl-kernel.yml +++ b/.github/workflows/release-whl-kernel.yml @@ -47,6 +47,7 @@ jobs: ./build.sh "${{ matrix.python-version }}" "${{ matrix.cuda-version }}" ${{ matrix.arch == 'aarch64' && 'aarch64' || '' }} env: USE_CCACHE: 0 + CMAKE_EXTRA_ARGS: ${{ matrix.arch == 'aarch64' && '-DENABLE_BELOW_SM90=ON' || '' }} - name: Upload to PyPI working-directory: sgl-kernel diff --git a/sgl-kernel/Dockerfile b/sgl-kernel/Dockerfile index e5bc1c339..08063674a 100644 --- a/sgl-kernel/Dockerfile +++ b/sgl-kernel/Dockerfile @@ -96,6 +96,8 @@ COPY . /sgl-kernel/ # Optional: enable CMake/Ninja profiling (pass non-empty via --build-arg ENABLE_*) ARG ENABLE_CMAKE_PROFILE ARG ENABLE_BUILD_PROFILE +# Optional: cmake extra args for aarch64 full kernel build (pass non-empty via --build-arg CMAKE_EXTRA_ARGS) +ARG CMAKE_EXTRA_ARGS ARG ARCH=x86_64 ARG USE_CCACHE=1 @@ -128,6 +130,9 @@ RUN --mount=type=cache,id=sgl-kernel-ccache,target=/ccache \ echo "CMake profiling enabled - will save to /sgl-kernel/cmake-profile.json"; \ export CMAKE_ARGS="--profiling-output=/sgl-kernel/cmake-profile.json --profiling-format=google-trace"; \ fi; \ + # Merge Extra CMake options into CMAKE_ARGS \ + export CMAKE_ARGS="${CMAKE_ARGS:+${CMAKE_ARGS} }${CMAKE_EXTRA_ARGS:-}"; \ + echo "CMAKE_ARGS= [$CMAKE_ARGS]"; \ ${PYTHON_ROOT_PATH}/bin/python -m uv build --wheel -Cbuild-dir=build . --color=always --no-build-isolation; \ ./rename_wheels.sh; \ if [ -n "${ENABLE_BUILD_PROFILE:-}" ] && [ -f /sgl-kernel/build/.ninja_log ]; then \ diff --git a/sgl-kernel/build.sh b/sgl-kernel/build.sh index b29d4d64a..ea9be7df5 100755 --- a/sgl-kernel/build.sh +++ b/sgl-kernel/build.sh @@ -48,10 +48,12 @@ echo "Buildx cache: ${BUILDX_CACHE_DIR}" echo "Builder: ${BUILDER_NAME}" echo "----------------------------------------" -# Optional profiling build-args (empty string disables) BUILD_ARGS=() +# Optional profiling build-args (empty string disables) [ -n "${ENABLE_CMAKE_PROFILE:-}" ] && BUILD_ARGS+=(--build-arg ENABLE_CMAKE_PROFILE="${ENABLE_CMAKE_PROFILE}") [ -n "${ENABLE_BUILD_PROFILE:-}" ] && BUILD_ARGS+=(--build-arg ENABLE_BUILD_PROFILE="${ENABLE_BUILD_PROFILE}") +# Optional extra cmake build-args (empty string disables) +[ -n "${CMAKE_EXTRA_ARGS:-}" ] && BUILD_ARGS+=(--build-arg CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS}") docker buildx build \ --builder "${BUILDER_NAME}" \