From effd5b2da4f4817c93b9045a26d16d89d4afb410 Mon Sep 17 00:00:00 2001 From: Chulian Zhang <851104+zhangcl@users.noreply.github.com> Date: Thu, 24 Sep 2026 12:49:51 -0700 Subject: [PATCH] [https://nvbugs/6812347][fix] Include the SM107 trtllm-gen context FMHA kernels On Rubin (SM107), context attention fell back to the unfused path and tried to allocate a 97.6 GiB workspace, OOMing and then faulting. Release builds do not enable 107, which dropped the Sm107a trtllm-gen cubins and their kernelMetaInfo.h rows. Sm100f has no context kernel, so Rubin was left with none at all. Omit 107 from the prune list and clear EXCLUDE_SM_107 for this directory only. The cubins are prebuilt and loaded via cuModuleLoadData, so no SM107 device codegen is added. Signed-off-by: Chulian Zhang <851104+zhangcl@users.noreply.github.com> --- .../kernels/trtllmGenKernels/fmha/CMakeLists.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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