Repository navigation
fix(kda): preserve SM90 CP transitions in FP32 - #127
Merged
Merged
Conversation
Keep the CP-only affine transition in a register-resident FP32 fragment while publishing a BF16 Tensor Core operand mirror. Add public and transition-sensitive long-context regressions. Signed-off-by: shuyan.ycf <shuyan.ycf@antgroup.com>
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.
Summary
Root cause and implementation
The pre-scan formed both the local state and the CP-only affine transition through BF16 shared memory. Repeated segment composition can amplify transition rounding when the effective decay is close to non-contracting.
Four compute warps now jointly own the complete 128x128 transition as a distributed FP32 accumulator. Each tile publishes a BF16 mirror for the existing kd @ M Tensor Core product, while the canonical recurrence and final m_seg export stay FP32. This keeps the change local to CP transition composition; serial state semantics are unchanged.
Accuracy
Public issue reproducer, CP relative-L2 vs serial:
The divergence stays bounded as the split count increases.
On a transition-sensitive 16K FP64-oracle regression, split-16 CP error improves from approximately 1.45e-1 / 5.60e-1 to 5.48e-2 / 1.40e-2 for output/final-state relative L2.
Performance and resources
64K forced split-16 measurements on the SM90 validation environment:
The pre-scan uses 255 registers, 0 bytes local memory, no spills, and the same shared-memory footprint.
Validation
Related to #126