Repository navigation
[None][perf] Build FlashMLA without relocatable device code - #22028
ruocheng-nv wants to merge 1 commit into
Conversation
The flash_mla_cpp_tllm target was built with CUDA_SEPARABLE_COMPILATION, i.e. nvcc -rdc=true. Nothing in FlashMLA needs cross-TU device linking (its own setup.py builds without -rdc), and -rdc makes ptxas spill in the attention kernels: sm90 sparse prefill (d_qk 512) 0 -> 2044 B spill stores, 296 B stack sm90 sparse fp8 decode (h64) 0 -> 220 B sm100 sparse prefill (h128) 0 -> 44 B sm100 sparse decode (h64) 0 -> 12 B H200, flash_mla_sparse_fwd with 13312 queries x 64 heads x 2176 top-k rows (d_qk 512): 17.07 ms -> 7.85 ms, outputs bit-identical. Same FlashMLA commit and nvcc; only the -rdc flag differs. Signed-off-by: Ruocheng Jia <ruochengj@nvidia.com>
|
No actionable comments were generated in the recent review. WalkthroughThe FlashMLA CMake target now disables CUDA separable compilation and no longer enables device-symbol resolution. The adjacent comment about generating ChangesFlashMLA build configuration
Estimated code review effort: 1 (Trivial) | ~3 minutes Change: Bug fix Suggested labels: Merge Risk:
|
Description
Split out of #21178 at review request so attention owners can review the FlashMLA build change on its own; #21178
keeps the CUTLASS MoE kernel changes.
flash_mla_cpp_tllmwas built withCUDA_SEPARABLE_COMPILATION ON(nvcc -rdc=true). Nothing in FlashMLA needscross-TU device linking (its own
setup.pybuilds without-rdc), and-rdcmakes ptxas spill in the attentionkernels:
H200,
flash_mla_sparse_fwdwith 13312 queries x 64 heads x 2176 top-k rows (d_qk 512): 17.07 -> 7.85 ms per call,outputs bit-identical. Same FlashMLA commit and nvcc; only
-rdcdiffers. The change applies to every FlashMLA kernelbuilt in this target (SM90 and SM100).
Test Coverage
unittest/_torch/attentionon H100/B200 (outputs bit-identical).PR Checklist
Dev Engineer Review
flash_mla_cpp_tllmnow disables CUDA separable compilation. The change removes the device-linking configuration and follows FlashMLA’s whole-program compilation model. The stated intent is to avoid ptxas register spills in attention kernels. No API changes are shown. Verify that the target builds and runs correctly on supported CUDA architectures.QA Engineer Review
No test changes.
Per-File QA Perspective
cpp/tensorrt_llm/flash_mla/CMakeLists.txt: Verify that the extension builds and its attention kernels run correctly with relocatable device code disabled. No test files or test lists changed.