From 35a938c3ae1999ff5cdb37cff92ce220a68c0139 Mon Sep 17 00:00:00 2001 From: Cheng Date: Sat, 28 Feb 2026 12:51:24 +0900 Subject: [PATCH] Skip Hopper-only kernels in CI --- .github/actions/build-cuda-release/action.yml | 2 +- mlx/backend/cuda/CMakeLists.txt | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/actions/build-cuda-release/action.yml b/.github/actions/build-cuda-release/action.yml index 0ed7719d5d..e306095bb0 100644 --- a/.github/actions/build-cuda-release/action.yml +++ b/.github/actions/build-cuda-release/action.yml @@ -20,7 +20,7 @@ runs: run: | pip install auditwheel build patchelf setuptools python setup.py clean --all - MLX_BUILD_STAGE=2 python -m build -w + MLX_DISABLE_SM90A_KERNELS=1 MLX_BUILD_STAGE=2 python -m build -w auditwheel repair dist/mlx_cuda*.whl \ --plat manylinux_2_35_${{ inputs.arch }} \ diff --git a/mlx/backend/cuda/CMakeLists.txt b/mlx/backend/cuda/CMakeLists.txt index 1b95116e0e..223be22f77 100644 --- a/mlx/backend/cuda/CMakeLists.txt +++ b/mlx/backend/cuda/CMakeLists.txt @@ -158,8 +158,10 @@ message(STATUS "CUDA architectures: ${MLX_CUDA_ARCHITECTURES}") set_target_properties(mlx PROPERTIES CUDA_ARCHITECTURES "${MLX_CUDA_ARCHITECTURES}") -if(("90a" IN_LIST MLX_CUDA_ARCHITECTURES) OR ("90a-real" IN_LIST - MLX_CUDA_ARCHITECTURES)) +# Skip Hopper-only kernels when not building for sm90a. +if(NOT DEFINED ENV{MLX_DISABLE_SM90A_KERNELS} + AND (("90a" IN_LIST MLX_CUDA_ARCHITECTURES) OR ("90a-real" IN_LIST + MLX_CUDA_ARCHITECTURES))) target_compile_definitions(mlx PRIVATE MLX_CUDA_SM90A_ENABLED) endif()