Conversation
Signed-off-by: Kai Xu <kaix@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
This was referenced Sep 23, 2026
This was referenced Sep 23, 2026
kaix-nv
added this pull request to stack #2521
September 23, 2026 01:22
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## kaix/linear-attention-qat-m1 #2519 +/- ##
================================================================
- Coverage 70.50% 70.28% -0.23%
================================================================
Files 610 618 +8
Lines 68036 68339 +303
================================================================
+ Hits 47969 48029 +60
- Misses 20067 20310 +243
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
Stack / merge order: #2497 foundation → #2519 decode + INT8 → #2503 GDN/KDA prefill → #2507 approximate inverse.
All entries remain drafts. #2506 (KDA prefill) and #2509 (original decode) are superseded and closed.
What does this PR do?
Type of change: New feature.
Add GDN/KDA decode-aware QAT without depending on configurable prefill operands
or approximate inverse. An explicit prefix length selects exact chunk prefill
followed by token-state writes, optional KDA log-retention rounding, or
encoded-update replay. Both Torch and Triton paths propagate gradients through
initial states, replay anchors, and continuation.
Recurrent states and replay anchors support FP8 E4M3 and signed symmetric dynamic
INT8. INT8 uses per-head
[Dk, block_v]scales, zero point zero,[-127,127]codes, nearest-even rounding, and identity STE. The existing GDN chunk kernel
also accepts INT8; replay key/update factors keep their separate FP8 setting.
FP8 remains the default. Quantizer format and execution policy survive save/restore.
This is the first delivery after the shared GDN foundation (#2497). Prefill
operand emulation and approximate inverse are follow-on patches, in that order.
Usage
Use
*gdn_state_quantizerfor Megatron GDN. Keep the phase context active throughactivation-checkpoint backward. The prefix solve is exact in this delivery.
Testing
On RTX A6000/SM86, Torch 2.9.1+cu128, Triton 3.5.1, FLA 0.5.1:
and activation checkpointing.
three recorded Git trees exactly.
The INT8 long-trajectory tests caught and fixed FP32 scale evaluation drift:
Triton now uses the same rounded reciprocal multiplication as Torch scalar
division. Tolerances were not relaxed. Tests cover 257-token trajectories,
nonzero initial states, grouped heads, packed tails, both readouts, split carry,
all state scale widths, and first-order input/state gradients.
Megatron tests were added for INT8 and decode at TP=1/2, but local collection
was blocked by the absent
megatronpackage. Native FP8/Hopper requalification,INT8 model-quality comparisons, and vLLM serving/cache integration are pending.
Keep this PR in draft until its remaining qualification is complete.
Before your PR is "Ready for review"
Additional Information
All encoded values remain floating tensors. INT8 fake QDQ does not claim integer
cache storage, serving acceleration, or model-quality recovery. vLLM cache and
multi-GPU calibration integration remain required follow-up work in the decode delivery.