Conversation
|
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:
|
kaix-nv
force-pushed
the
kaix/linear-attention-decode-first
branch
from
September 23, 2026 19:34
94080d3 to
757f337
Compare
kaix-nv
removed this pull request from stack #2521
September 24, 2026 06:17
kaix-nv
added this pull request to stack #2542
September 24, 2026 06:18
kaix-nv
removed this pull request from stack #2542
September 24, 2026 06:31
kaix-nv
added this pull request to stack #2543
September 24, 2026 06:31
kaix-nv
force-pushed
the
kaix/linear-attention-decode-first
branch
from
September 24, 2026 18:17
757f337 to
492db57
Compare
kaix-nv
force-pushed
the
kaix/linear-attention-decode-first
branch
from
September 25, 2026 01:54
492db57 to
5fbb898
Compare
Signed-off-by: Kai Xu <kaix@nvidia.com>
kaix-nv
force-pushed
the
kaix/linear-attention-decode-first
branch
from
September 25, 2026 04:26
5fbb898 to
502a460
Compare
Signed-off-by: Kai Xu <kaix@nvidia.com>
kaix-nv
force-pushed
the
kaix/linear-attention-decode-first
branch
from
September 25, 2026 05:11
502a460 to
5e548c1
Compare
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.
Linear-attention PR stack — 5 PRs
All five PRs form a linear GitHub stack in the review order shown above. #2541 applies TensorQuantizer before native vLLM prefill/decode calls.
A separate vLLM prefill-GEMM PR will wait for an optimized fused kernel. #2506 and #2509 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.
The optional
int8_hadamard32state codec quantizes recurrent state in a Hadamard value basis. Token-state writes and replay-window refresh share one state-encoding path while preserving their separate rounding cadence and readout choices. The decode benchmark uses the same measurement helper as the later prefill and inverse examples.This PR introduces
QuantizeConfig.linear_attention, the module-selection rules, and execution-policy checkpoint metadata. #2497 supplies only standardquant_cfgstate/W handles with fixed execution behavior. Decode/replay settings live here; later PRs extend the same configuration for prefill arithmetic and solve approximation. Test oracles remain undertests/_test_utils/torch/quantization/; runtime prefix and quantization helpers stay in the library.The QAT entry point is
examples/llm_qat/linear_attention/train.py. Usage and numerical contracts live with the example; historical study reports remain beside the scripts in the PRs that introduce them. The training example writes metrics without saving a trained checkpoint, and its source manifest hashes the current implementation files.Usage
Use
*gdn_state_quantizerfor Megatron GDN. Keep the phase context active throughactivation-checkpoint backward. The prefix solve is exact in this delivery.
Testing
For this documentation/example amendment, pre-commit, Markdown links and anchors, command/Python syntax, source-manifest readability, and stale-path checks passed. Runtime kernels were not changed; model training, distributed integration, and quality studies were not rerun for this amendment.
The preceding focused review also passed 124 CPU/GPU decode, INT8, Hadamard, and study-comparison tests on RTX A6000. The separately identified low-level replay-anchor gradient issue remains open and is outside this documentation amendment.
Prior runtime validation on RTX A6000/SM86, Torch 2.9.1+cu128, Triton 3.5.1, and fla-core 0.5.1:
fla.layers.kdapackage.These tests cover outputs, final states, input/state gradients, packed and grouped-head layouts, continuation, readouts, state tile widths, and saved policy settings. Megatron-Core is absent locally, so its integration tests were not rerun. Earlier full-FLA/Hopper and model-quality measurements remain scoped to their original revisions. State-only vLLM validation belongs to #2541.
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. State-only vLLM cache and worker integration is covered separately by #2541,
with QDQ at native invocation boundaries rather than the training replay cadence.