diff --git a/cpp/tensorrt_llm/kernels/trtllmGenKernels/fmha/CMakeLists.txt b/cpp/tensorrt_llm/kernels/trtllmGenKernels/fmha/CMakeLists.txt index daa5a3e1d974..5731ed4f0549 100644 --- a/cpp/tensorrt_llm/kernels/trtllmGenKernels/fmha/CMakeLists.txt +++ b/cpp/tensorrt_llm/kernels/trtllmGenKernels/fmha/CMakeLists.txt @@ -49,7 +49,15 @@ configure_file( file(GLOB_RECURSE SRC_CPP *.cpp) file(GLOB_RECURSE SRC_CU *.cu) -filter_source_cuda_architectures(SOURCE_LIST SRC_CPP ARCHS 100 103 107 100f) +# Archs listed here are pruned when the build does not enable them. Sm100f has +# no context FMHA kernel, so Rubin needs the prebuilt Sm107a cubins kept +# unconditionally: 107 is omitted below, and the globally-set EXCLUDE_SM_107 +# that would drop their metadata rows is cleared for this directory. +set(FMHA_PRUNABLE_ARCHS 100 103 100f) +remove_definitions(-DEXCLUDE_SM_107) + +filter_source_cuda_architectures(SOURCE_LIST SRC_CPP + ARCHS ${FMHA_PRUNABLE_ARCHS}) add_library(trtllm_gen_fmha_interface INTERFACE) target_include_directories( @@ -65,7 +73,8 @@ target_include_directories( include(tllm_cubin_archive) tllm_add_cubin_archive_sources( - trtllm_gen_fmha "${CMAKE_CURRENT_SOURCE_DIR}/cubin" ARCHS 100 103 107 100f) + trtllm_gen_fmha "${CMAKE_CURRENT_SOURCE_DIR}/cubin" + ARCHS ${FMHA_PRUNABLE_ARCHS}) set(TRTLLM_FMHA_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}") target_compile_definitions( trtllm_gen_fmha