Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6c1cf8e
build: migrate CUTLASS MoE tests to explicit kernel components
Funatiq Oct 6, 2026
3ae98ab
Narrow sequence and DiT Torch operator dependencies
Funatiq Oct 6, 2026
dfb911b
Give Torch decoding operators a component-local consumer
Funatiq Oct 7, 2026
7007897
Narrow Torch GEMM and quantization backend dependencies
Funatiq Oct 7, 2026
34d8a10
Make Torch attention independently linkable with explicit backends
Funatiq Oct 7, 2026
3954cc0
Give Torch MoE an isolated consumer and shared cuBLAS implementation
Funatiq Oct 7, 2026
8b24c32
Make Torch distributed operators a direct component consumer
Funatiq Oct 7, 2026
d164dfe
Make the KV cache host-memory NUMA test component local
Funatiq Nov 30, 2026
ddb977f
[None][fix] Keep aggregate kernel dependencies private to the facade
Funatiq Dec 1, 2026
4e6a58f
[None][fix] Declare the Kimi Modeling V2 communication kernel dependency
Funatiq Dec 1, 2026
e91a394
[None][fix] Complete explicit kernel component dependencies
Funatiq Dec 2, 2026
9b4ca73
[None][build] Make kernel retention and ownership contracts explicit
Funatiq Dec 2, 2026
042416d
[None][build] Share Torch family dependencies with the product
Funatiq Dec 2, 2026
8264a71
[None][build] Accept kernel targets in native family dependencies
Funatiq Dec 2, 2026
40ed923
[None][test] Strengthen Torch registration family checks
Funatiq Dec 2, 2026
a45fda4
[None][refactor] Remove unused MoE permutation activation argument
Funatiq Dec 2, 2026
9eead6c
[None][doc] Explain component kernel and operator contribution steps
Funatiq Dec 2, 2026
96abcc4
[None][fix] Validate native dependencies across sibling directories
Funatiq Dec 2, 2026
90946c3
[None][fix] Preserve VisualGen CUDA host compiler overrides
Funatiq Dec 2, 2026
205db74
[None][test] Isolate the VisualGen cuBLAS dependency stub
Funatiq Dec 3, 2026
17d3d69
[None][build] Co-own remaining Torch registration inventories
Funatiq Dec 3, 2026
f8b00ea
[None][fix] Preserve shipped conv1d and group RMSNorm codegen settings
Funatiq Dec 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -528,5 +528,14 @@
/tests/unittest/_torch/modeling_v2/models/glm5_next @zhaoyangwang-nvidia @kaiyux
/tests/integration/defs/accuracy/modeling_v2/glm5_next/ @zhaoyangwang-nvidia @kaiyux

# Component registration inventories follow their operator-family owners.
/cpp/tests/unit_tests/thop/torchGemmQuantRegistrationTest.cpp @NVIDIA/trt-llm-runtime-devs @NVIDIA/trt-llm-kernels-devs
/cpp/tests/unit_tests/thop/torchSequenceRegistrationTest.cpp @NVIDIA/trt-llm-runtime-devs @NVIDIA/trt-llm-kernels-devs
/cpp/tests/unit_tests/thop/torchDecodingRegistrationTest.cpp @NVIDIA/trt-llm-runtime-devs @NVIDIA/trt-llm-kernels-devs
/cpp/tests/unit_tests/thop/torchDistributedRegistrationTest.cpp @NVIDIA/trt-llm-runtime-devs @NVIDIA/trt-llm-kernels-devs
/cpp/tests/unit_tests/thop/torchMoeRegistrationTest.cpp @NVIDIA/trt-llm-runtime-devs @NVIDIA/trt-llm-moe-devs
/cpp/tests/unit_tests/thop/torchAttentionRegistrationTest.cpp @NVIDIA/trt-llm-runtime-devs @NVIDIA/trt-llm-kernels-devs @NVIDIA/trt-llm-torch-attention-devs
/cpp/tests/unit_tests/thop/torchVisualGenRegistrationTest.cpp @NVIDIA/trt-llm-runtime-devs @NVIDIA/trt-llm-visualgen-devs

# Uncomment only on release branches (e.g. release/0.19):
# * @NVIDIA/trt-llm-release-branch-approval
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Python and C++ codebase with a PyTorch execution path.
| Task | Command |
|------|---------|
| Unit tests | `pytest tests/unittest/` |
| C++ component tests | `cmake --build cpp/build_RelWithDebInfo --target common-tests` (also `runtime-tests`, `executor-tests`, `batch-manager-tests`, `kernel-tests`) |
| C++ component tests | `cmake --build cpp/build_RelWithDebInfo --target common-tests` (also `runtime-tests`, `executor-tests`, `batch-manager-tests`, `kernel-tests`, `thop-tests`) |
| C++ test scheduling | `ctest --test-dir cpp/build_RelWithDebInfo -L common --output-on-failure` (build the selected tests first) |
| Specific test | `pytest tests/unittest/llmapi/test_llm_args.py` |
| Pattern match | `pytest tests/unittest -k "test_llm_args"` |
Expand Down
40 changes: 27 additions & 13 deletions cpp/cmake/modules/modeling_v2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ SOURCES Paths or globs relative to the unit's csrc/ directory: the
Source properties the family's CMakeLists.txt sets with
set_source_files_properties (e.g. COMPILE_OPTIONS) apply to shared
and target sources alike.
DEPS From a closed list: cublas, cublaslt, cuda_driver, flashmla,
internal_cutlass, nccl, trtllm_gen_fmha_interface. On aarch64
DEPS Existing tllm::kernel_<name> component targets, or predefined keys:
cublas, cublaslt, cuda_driver, flashmla, internal_cutlass,
kernel_communication, nccl, trtllm_gen_fmha_interface. On aarch64
builds with Clang, flashmla makes nvcc use GCC as the host compiler:
for the family's targets when a target declares it, for every
family's shared code when shared code does (see
Expand All @@ -72,14 +73,6 @@ not empty.

include_guard(GLOBAL)

set(_MODELING_V2_KNOWN_DEPS
cublas
cublaslt
cuda_driver
flashmla
internal_cutlass
nccl
trtllm_gen_fmha_interface)
set(_MODELING_V2_KNOWN_REQUIRES MULTI_DEVICE NVSHMEM)

# --- Naming ------------------------------------------------------------------
Expand Down Expand Up @@ -302,8 +295,21 @@ function(_modeling_v2_expand_sources out base)
endfunction()

function(_modeling_v2_check_deps)
set(_MODELING_V2_KNOWN_DEPS
cublas
cublaslt
cuda_driver
flashmla
internal_cutlass
kernel_communication
nccl
trtllm_gen_fmha_interface)
foreach(dep IN LISTS ARGN)
if(NOT dep IN_LIST _MODELING_V2_KNOWN_DEPS)
if(dep MATCHES "^tllm::kernel_[A-Za-z0-9_]+$")
if(NOT TARGET ${dep})
message(FATAL_ERROR "modeling_v2: unknown kernel component '${dep}'")
endif()
elseif(NOT dep IN_LIST _MODELING_V2_KNOWN_DEPS)
message(
FATAL_ERROR
"modeling_v2: unknown DEPS '${dep}' (known: ${_MODELING_V2_KNOWN_DEPS})"
Expand All @@ -315,7 +321,9 @@ endfunction()
# Compile-time usage requirements of DEPS on one OBJECT library.
function(_modeling_v2_apply_compile_deps object_lib)
foreach(dep IN LISTS ARGN)
if(dep STREQUAL "internal_cutlass")
if(dep MATCHES "^tllm::kernel_")
target_link_libraries(${object_lib} PRIVATE ${dep})
elseif(dep STREQUAL "internal_cutlass")
target_include_directories(
${object_lib}
PRIVATE
Expand All @@ -329,6 +337,8 @@ function(_modeling_v2_apply_compile_deps object_lib)
"${flashmla_SOURCE_DIR}/csrc/kerutils/include")
elseif(dep STREQUAL "trtllm_gen_fmha_interface")
target_link_libraries(${object_lib} PRIVATE trtllm_gen_fmha_interface)
elseif(dep STREQUAL "kernel_communication")
target_link_libraries(${object_lib} PRIVATE tllm::kernel_communication)
elseif(dep STREQUAL "nccl" AND ENABLE_MULTI_DEVICE)
target_include_directories(${object_lib} PRIVATE ${MPI_C_INCLUDE_DIRS})
endif()
Expand Down Expand Up @@ -368,12 +378,16 @@ endfunction()
function(_modeling_v2_link_libraries out)
set(libraries "")
foreach(dep IN LISTS ARGN)
if(dep STREQUAL "cublas")
if(dep MATCHES "^tllm::kernel_")
list(APPEND libraries ${dep})
elseif(dep STREQUAL "cublas")
list(APPEND libraries ${CUBLAS_LIB})
elseif(dep STREQUAL "cublaslt")
list(APPEND libraries ${CUBLASLT_LIB})
elseif(dep STREQUAL "cuda_driver")
list(APPEND libraries ${CUDA_DRV_LIB})
elseif(dep STREQUAL "kernel_communication")
list(APPEND libraries tllm::kernel_communication)
elseif(dep STREQUAL "nccl" AND ENABLE_MULTI_DEVICE)
list(APPEND libraries ${NCCL_LIB} ${MPI_C_LIBRARIES})
endif()
Expand Down
17 changes: 16 additions & 1 deletion cpp/cmake/modules/visual_gen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ include(modeling_v2)
# units in its own csrc/CMakeLists.txt. Scope determines the library and
# namespace.
function(add_visual_gen_native)
cmake_parse_arguments(PARSE_ARGV 0 arg "" "" "ARCHS;SOURCES")
cmake_parse_arguments(PARSE_ARGV 0 arg "" "" "ARCHS;SOURCES;DEPS")
if(arg_UNPARSED_ARGUMENTS
OR arg_KEYWORDS_MISSING_VALUES
OR NOT arg_ARCHS
Expand All @@ -32,6 +32,7 @@ function(add_visual_gen_native)
"add_visual_gen_native requires ARCHS and SOURCES in ${CMAKE_CURRENT_SOURCE_DIR}"
)
endif()
_modeling_v2_check_deps(${arg_DEPS})
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
file(RELATIVE_PATH directory "${visual_gen_source_dir}"
"${CMAKE_CURRENT_SOURCE_DIR}")
set(identifier "[A-Za-z][A-Za-z0-9_]*")
Expand Down Expand Up @@ -113,6 +114,19 @@ function(add_visual_gen_native)
add_dependencies(visual_gen_libs ${library})
endif()

_modeling_v2_link_libraries(dep_libraries ${arg_DEPS})
target_link_libraries(${library} PRIVATE ${dep_libraries})

_modeling_v2_host_compiler(host_compiler cuda_flags ${arg_DEPS})
if(host_compiler)
set(CMAKE_CUDA_HOST_COMPILER
"${host_compiler}"
PARENT_SCOPE)
set(CMAKE_CUDA_FLAGS
"${cuda_flags}"
PARENT_SCOPE)
endif()

set(kernels "")
set(bindings "")
foreach(source IN LISTS sources)
Expand Down Expand Up @@ -143,6 +157,7 @@ function(add_visual_gen_native)
else()
target_link_libraries(${objects} PRIVATE ${TORCH_LIBRARIES})
endif()
_modeling_v2_apply_compile_deps(${objects} ${arg_DEPS})
target_sources(${library} PRIVATE $<TARGET_OBJECTS:${objects}>)
endif()
endforeach()
Expand Down
23 changes: 4 additions & 19 deletions cpp/tensorrt_llm/CMakeLists.txt
Comment thread
Funatiq marked this conversation as resolved.
Resolved
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ set(TRTLLM_LINK_LIBS
${CUBLASLT_LIB}
${CURAND_LIB}
${CMAKE_DL_LIBS}
kernels_src
flash_mla_src
context_attention_src
decoder_attention_src
Expand Down Expand Up @@ -246,15 +245,8 @@ set(TRTLLM_LINK_LIBS
mhcKernels_src
${DECODER_SHARED_TARGET_0}
${DECODER_SHARED_TARGET_1})
if(USING_OSS_CUTLASS_LOW_LATENCY_GEMM)
set(TRTLLM_LINK_LIBS ${TRTLLM_LINK_LIBS} low_latency_gemm_src)
message(STATUS "USING_OSS_CUTLASS_LOW_LATENCY_GEMM")
endif()

if(USING_OSS_CUTLASS_FP4_GEMM)
set(TRTLLM_LINK_LIBS ${TRTLLM_LINK_LIBS} fp4_gemm_src)
message(STATUS "USING_OSS_CUTLASS_FP4_GEMM")
endif()
list(APPEND TRTLLM_LINK_LIBS tllm::kernel_low_latency_gemm
tllm::kernel_fp4_gemm)

if(USING_OSS_CUTLASS_MOE_GEMM)
set(TRTLLM_LINK_LIBS ${TRTLLM_LINK_LIBS} moe_gemm_src)
Expand Down Expand Up @@ -391,21 +383,14 @@ foreach(component ${TLLM_FACADE_COMPONENT_TARGETS} fp8_blockscale_gemm_src
PRIVATE $<LINK_LIBRARY:WHOLE_ARCHIVE,${component}>)
endforeach()

foreach(component IN LISTS TLLM_KERNEL_COMPONENT_TARGETS)
target_link_libraries(${SHARED_TARGET}
PRIVATE $<LINK_LIBRARY:WHOLE_ARCHIVE,${component}>)
set_property(TARGET ${SHARED_TARGET}
PROPERTY LINK_LIBRARY_OVERRIDE_${component} WHOLE_ARCHIVE)
endforeach()

# Components also link each other normally; retain all component exports here.
foreach(component IN LISTS TLLM_FACADE_COMPONENT_TARGETS)
set_property(TARGET ${SHARED_TARGET}
PROPERTY LINK_LIBRARY_OVERRIDE_${component} WHOLE_ARCHIVE)
endforeach()

# Link kernel_src and cutlass_src. static internal cutlass lib overridden.
target_link_libraries(${SHARED_TARGET} PUBLIC kernels_src cutlass_src)
# Keep aggregate dependencies private and retain the explicit facade exports.
tllm_link_kernel_facade(${SHARED_TARGET})

if(TARGET ${UCX_WRAPPER_TARGET})
add_dependencies(${SHARED_TARGET} ${UCX_WRAPPER_TARGET})
Expand Down
147 changes: 69 additions & 78 deletions cpp/tensorrt_llm/kernels/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ add_subdirectory(csa2SparseContext)
add_subdirectory(csa2SparseDecode)
add_subdirectory(fusedSampling)

file(GLOB_RECURSE SRC_CPP *.cpp)
file(GLOB_RECURSE SRC_CU *.cu)

list(REMOVE_ITEM SRC_CU "${CMAKE_CURRENT_SOURCE_DIR}/kvCachePartialCopy.cu")
add_library(tllm_kernel_kv_cache_copy STATIC kvCachePartialCopy.cu)
add_library(tllm::kernel_kv_cache_copy ALIAS tllm_kernel_kv_cache_copy)
target_link_libraries(tllm_kernel_kv_cache_copy PUBLIC tllm::common_cuda)
Expand All @@ -51,56 +47,6 @@ set_target_properties(
CUDA_RESOLVE_DEVICE_SYMBOLS ON)
add_cuda_architectures(tllm_kernel_kv_cache_copy 89)

# Exclude files in the cutlass_kernels, decoderMaskedMultiheadAttention and
# selectiveScan trtllmGenKernels folder
list(FILTER SRC_CPP EXCLUDE REGEX "cutlass_kernels/.*")
list(FILTER SRC_CU EXCLUDE REGEX "cutlass_kernels/.*")
# Everything under moe/ is that directory's own business: its backend
# sub-directories build their own targets, and moe/CMakeLists.txt hands the rest
# back as MOE_KERNELS_SRC, which joins kernels_src below. Anchored on
# "/kernels/" because the glob above yields absolute paths.
list(FILTER SRC_CPP EXCLUDE REGEX "/kernels/moe/.*")
list(FILTER SRC_CU EXCLUDE REGEX "/kernels/moe/.*")
list(FILTER SRC_CPP EXCLUDE REGEX "flashMLA/.*")
list(FILTER SRC_CU EXCLUDE REGEX "flashMLA/.*")
list(FILTER SRC_CPP EXCLUDE REGEX "contextFusedMultiHeadAttention/.*")
list(FILTER SRC_CU EXCLUDE REGEX "contextFusedMultiHeadAttention/.*")
list(FILTER SRC_CPP EXCLUDE REGEX "decoderMaskedMultiheadAttention/.*")
list(FILTER SRC_CU EXCLUDE REGEX "decoderMaskedMultiheadAttention/.*")
list(FILTER SRC_CPP EXCLUDE REGEX "trtllmGenKernels/.*")
list(FILTER SRC_CU EXCLUDE REGEX "trtllmGenKernels/.*")
list(FILTER SRC_CPP EXCLUDE REGEX "selectiveScan/.*")
list(FILTER SRC_CU EXCLUDE REGEX "selectiveScan/.*")
list(FILTER SRC_CPP EXCLUDE REGEX "userbuffers/.*")
list(FILTER SRC_CU EXCLUDE REGEX "userbuffers/.*")
list(FILTER SRC_CU EXCLUDE REGEX "fusedLayernormKernels/.*")
list(FILTER SRC_CU EXCLUDE REGEX "fusedGatedRMSNormQuant/.*")
list(FILTER SRC_CU EXCLUDE REGEX "mamba2MTPSSMCache/.*")
list(FILTER SRC_CPP EXCLUDE REGEX "kdaDecode/.*")
list(FILTER SRC_CU EXCLUDE REGEX "kdaDecode/.*")
list(FILTER SRC_CPP EXCLUDE REGEX "kimiK3AttnRes/.*")
list(FILTER SRC_CU EXCLUDE REGEX "kimiK3AttnRes/.*")
list(FILTER SRC_CPP EXCLUDE REGEX "mhcKernels/.*")
list(FILTER SRC_CU EXCLUDE REGEX "mhcKernels/.*")
list(FILTER SRC_CPP EXCLUDE REGEX "compressorKernels/.*")
list(FILTER SRC_CU EXCLUDE REGEX "compressorKernels/.*")
list(FILTER SRC_CPP EXCLUDE REGEX "csa2SparseContext/.*")
list(FILTER SRC_CU EXCLUDE REGEX "csa2SparseContext/.*")
list(FILTER SRC_CPP EXCLUDE REGEX "csa2SparseDecode/.*")
list(FILTER SRC_CU EXCLUDE REGEX "csa2SparseDecode/.*")
list(FILTER SRC_CPP EXCLUDE REGEX "fusedSampling/.*")
list(FILTER SRC_CU EXCLUDE REGEX "fusedSampling/.*")
# Marlin is built as its own architecture-scoped OBJECT library below.
list(FILTER SRC_CPP EXCLUDE REGEX "marlin/.*")
list(FILTER SRC_CU EXCLUDE REGEX "marlin/.*")
# The MiniMax-M3 decode attention kernels are built as their own
# architecture-scoped OBJECT library below.
list(FILTER SRC_CU EXCLUDE REGEX
"minimaxM3/(fusedDecodeAttn|attnMega|attnC1)\\.cu$")
# The MiniMax-M3 sm_107 decode kernels are built as their own sm_107-only OBJECT
# library below.
list(FILTER SRC_CU EXCLUDE REGEX "minimaxM3Sm107(Tp[248])?/.*")

# Lower CUDA optimization level when FAST_BUILD is enabled to speed up
# compilation. CMake by default adds -O3 to CMAKE_CUDA_FLAGS_RELEASE. We
# override it here before creating the target to avoid the "incompatible
Expand All @@ -115,25 +61,26 @@ if(FAST_BUILD)
endif()

include(kernelComponents.cmake)
include(residualKernelComponents.cmake)
Comment thread
Funatiq marked this conversation as resolved.
Resolved
set(TLLM_KERNEL_COMPONENT_TARGETS
${TLLM_KERNEL_COMPONENT_TARGETS}
PARENT_SCOPE)

# Marlin NVFP4: build Ada/Hopper kernels and the dense W4A16/repack kernels used
# on SM12x. Unsupported device passes emit empty kernel stubs.
file(GLOB_RECURSE MARLIN_SRC "marlin/*.cu" "marlin/*.cpp")
if(MARLIN_SRC)
add_library(marlin_src OBJECT ${MARLIN_SRC})
set_property(TARGET marlin_src PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET marlin_src PROPERTY CUDA_RESOLVE_DEVICE_SYMBOLS ON)
target_include_directories(
marlin_src
PRIVATE
$<TARGET_PROPERTY:${INTERNAL_CUTLASS_KERNELS_TARGET},INTERFACE_INCLUDE_DIRECTORIES>
)
target_link_libraries(marlin_src PRIVATE trtllm_gen_fmha_interface)
set_cuda_architectures(marlin_src 89 90 120f)
endif()
# Marlin builds Ada/Hopper and SM12x kernels; unsupported device passes emit
# empty stubs. kernels_src packages the objects for legacy aggregate consumers.
add_library(
marlin_src OBJECT
marlin/marlin_nvfp4_dispatch_utils.cpp marlin/marlin_nvfp4_gemm.cu
marlin/marlin_nvfp4_moe_gemm.cu marlin/marlin_repack.cu)
set_property(TARGET marlin_src PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET marlin_src PROPERTY CUDA_RESOLVE_DEVICE_SYMBOLS ON)
target_include_directories(
marlin_src
PRIVATE
$<TARGET_PROPERTY:${INTERNAL_CUTLASS_KERNELS_TARGET},INTERFACE_INCLUDE_DIRECTORIES>
)
target_link_libraries(marlin_src PRIVATE trtllm_gen_fmha_interface)
set_cuda_architectures(marlin_src 89 90 120f)

# MiniMax-M3 decode attention: block-scaled tcgen05 MMAs (.scale_vec::1X) exist
# on the arch-specific sm_100a / sm_103a targets only, not on the sm_100f family
Expand All @@ -148,11 +95,10 @@ set_cuda_architectures(minimax_m3_attn_src 100 103)

# MiniMax-M3 sm_107 decode kernels (minimaxM3Sm107Tp{2,4,8}/): written for
# sm_107 only (PDL griddepcontrol, sm_10x-only PTX), so they are compiled for
# the sm_10x entries of this build's architectures only (the same targets, e.g.
# the sm_100f family, that kernels_src compiles its sm_10x code for), not for
# the older ones. A build without an sm_10x architecture compiles them for
# sm_107a: their torch ops link against the host launchers, and only the sm_107
# targets launch them.
# the sm_10x entries of this build's architectures only, including the sm_100f
# family, not for the older ones. A build without an sm_10x architecture
# compiles them for sm_107a: their torch ops link against the host launchers,
# and only the sm_107 targets launch them.
file(GLOB MINIMAX_M3_SM107_SRC minimaxM3Sm107/*.cu minimaxM3Sm107Tp2/*.cu
minimaxM3Sm107Tp4/*.cu minimaxM3Sm107Tp8/*.cu)
add_library(minimax_m3_sm107_src OBJECT ${MINIMAX_M3_SM107_SRC})
Expand All @@ -173,17 +119,62 @@ endif()
set_property(TARGET minimax_m3_sm107_src PROPERTY CUDA_ARCHITECTURES
${MINIMAX_M3_SM107_ARCHS})

# Compatibility archive: specialized object libraries have one compilation
# owner, and ordinary kernel families are selected through component libraries.
add_library(
kernels_src STATIC
${SRC_CPP} ${SRC_CU} ${MOE_KERNELS_SRC}
$<$<TARGET_EXISTS:marlin_src>:$<TARGET_OBJECTS:marlin_src>>
$<TARGET_OBJECTS:minimax_m3_attn_src> $<TARGET_OBJECTS:minimax_m3_sm107_src>)
$<TARGET_OBJECTS:minimax_m3_attn_src>
$<TARGET_OBJECTS:minimax_m3_sm107_src>
$<TARGET_OBJECTS:moe_dynamic_eplb_src>
$<TARGET_OBJECTS:marlin_src>
$<TARGET_OBJECTS:causalConv1d_src>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These four OBJECT targets were built on main but never linked: the shipped causalConv1d/groupRmsNorm/dsv3/llama4 objects came from the kernels_src glob (default archs plus add_cuda_architectures(kernels_src 89), no per-directory flags). Packaging them here ships their own flags for the first time; see the notes at groupRmsNormKernels/CMakeLists.txt:21 and causalConv1d/CMakeLists.txt:22. llama4/dsv3 only have kernel bodies for sm_90+, so their 90a/100f SASS is unchanged; causalConv1d and groupRmsNorm do change.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed and fixed in f8b00eac92f. To be precise, the register caps did affect the standalone OBJECT targets, but those objects were not linked into the shipped libraries before this refactor. The shipped kernel copies instead came from the recursive kernels_src glob, without those target-private caps and with its explicit SM89 addition. I checked the tree immediately before 6c1cf8eb3a3: references to the two OBJECT targets were confined to their declarations/properties; that commit introduced their objects into the aggregate.

The fix removes the causalConv1d/group RMSNorm caps and adds conditional SM89 compilation to both owners, retaining single compilation ownership and object packaging. The generated compile commands differ only by the removed cap and added SM89; cuobjdump confirms SM89 cubins in both rebuilt objects. The affected eight-architecture Release native build with ENABLE_MULTI_DEVICE=1 and all 17 registration tests passed. Commit and pre-push hooks passed.

The historical linkage was confirmed from CMake declarations. I have not rebuilt historical main, compared SASS byte-for-byte, or run GPU performance tests.

$<TARGET_OBJECTS:groupRmsNormKernels_src>
$<TARGET_OBJECTS:dsv3_min_latency_kernels>
$<TARGET_OBJECTS:llama4_min_latency_kernels>)
set_property(TARGET kernels_src PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET kernels_src PROPERTY CUDA_RESOLVE_DEVICE_SYMBOLS ON)
target_include_directories(
kernels_src
PUBLIC
$<TARGET_PROPERTY:${INTERNAL_CUTLASS_KERNELS_TARGET},INTERFACE_INCLUDE_DIRECTORIES>
)
target_link_libraries(kernels_src PUBLIC trtllm_gen_fmha_interface)
tllm_link_kernel_aggregate(kernels_src)
# Specialized backend objects also require SM89 in the aggregate device link.
add_cuda_architectures(kernels_src 89)

include(kernelSourceOwnership.cmake)
get_property(
kernel_targets
DIRECTORY
PROPERTY BUILDSYSTEM_TARGETS)
set(kernel_ownership_options)
if(NOT ENABLE_MULTI_DEVICE)
list(APPEND kernel_ownership_options DISABLED_SOURCES
customAllReduceKernels.cu)
endif()
tllm_check_kernel_source_ownership(
${kernel_ownership_options}
TARGETS
${kernel_targets}
DELEGATED_DIRECTORIES
cutlass_kernels
contextFusedMultiHeadAttention
decoderMaskedMultiheadAttention
flashMLA
trtllmGenKernels
selectiveScan
userbuffers
fusedLayernormKernels
fusedGatedRMSNormQuant
mamba2MTPSSMCache
kdaDecode
kimiK3AttnRes
mhcKernels
compressorKernels
fusedSampling
csa2SparseContext
csa2SparseDecode
moe/loadBalance/dynamicEplb
moe/cutlass=cutlass_kernels
moe/trtllmGen
moe/cuteDsl)
Loading