Repository navigation
[FEAT][kernels]: implement TMA-accelerated Online Softmax Fused LogP for SM90+ - #26
Merged
Merged
Conversation
Flink-ddd
force-pushed
the
feat/tma-logp-sm90
branch
from
May 26, 2026 04:42
e8a0235 to
8e26c29
Compare
…Specialization for SM90+ Signed-off-by: vensen <[email protected]>
Flink-ddd
force-pushed
the
feat/tma-logp-sm90
branch
from
May 26, 2026 06:42
8e26c29 to
ec042ac
Compare
…odule Signed-off-by: vensen <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR introduces a highly optimized, hardware-aware fused LogP kernel utilizing TMA and Warp Specialization targeting NVIDIA Hopper (SM90) and Blackwell (SM100/SM120) architectures.
By eliminating the intermediate memory bottlenecks of the standard LogP computation in DPO/GRPO pipelines, this implementation drastically reduces global memory traffic and pushes the kernel performance closer to the hardware limit.
Key Technical Architectures
Warp 0 Producer: Dedicates to orchestration, issuing asynchronous cp.async.bulk.tensor.2d instructions to load logits tiles into Shared Memory via hardware mbarrier synchronization.
Warps 1-3 Consumers: Dedicates to math execution, performing high-performance block-level reductions asynchronously without stalling data transfers.
Instead of allocating massive Shared Memory for the entire vocabulary, which causes OOM on larger vocabularies, we implement an Online Softmax reduction. Logits are streamed in chunks of TILE_V=4096, calculating local maximums and running scaling factors dynamically.
Integrated into KernelRegistry. The registry dynamically checks the GPU compute capability at runtime. If cc >= 90, the TMA-accelerated fused kernel is automatically prioritized over FlashInfer and Triton fallbacks.
Closes #25