Repository navigation
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. |
|
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: true
Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## kaix/linear-attention-state-nvfp4 #2788 +/- ##
=====================================================================
- Coverage 68.99% 68.23% -0.77%
=====================================================================
Files 656 662 +6
Lines 72133 74071 +1938
=====================================================================
+ Hits 49769 50540 +771
- Misses 22364 23531 +1167
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:
|
Signed-off-by: Kai Xu <kaix@nvidia.com>
291b2c1 to
bd91f22
Compare
|
Signed-off-by: Kai Xu <kaix@nvidia.com>
Linear-attention series — 8 PRs
mainThe seven open PRs form native GitHub stack #2806 in this order. #2497 has landed, so #2519 targets
main. #2805 contains NVFP4 and is based on #2657; #2788 and #2541 are rebased in sequence. #2503 and #2507 retain their existing commits; their rebases remain deferred until their immediate parents merge.#2788 owns ReplaySSM training, including the implemented two-precision GDN profile. #2541 owns ordinary state-QDQ serving. The experimental ReplaySSM serving follow-up is published separately on
kaix/linear-attention-replayssm-serving; it is not included in this PR or the numbered stack yet. Serving-time prefill-GEMM QDQ remains deferred until an optimized fused kernel is available.What does this PR do?
Type of change: New feature.
Add optional ReplaySSM state QAT independently of the ordinary GDN/KDA state-QDQ path. Preserve the existing private-fork INT8/Hadamard comparison profile and implement a two-precision GDN profile with an FP32 recurrence anchor and dynamic FP8 E4M3 read copy.
The two-precision suffix imports upstream
emulation.GDNReplayat73a9592e9d8a2268620e8883a82f5cec7442ed36: one native forward per token, with a window-wise adjoint during backward. Each 16-token flush recomputes recurrence updates from raw inputs and the FP32 anchor. Read-side quantization errors do not overwrite the recurrence anchor. ModelOpt owns the quantizer configuration and checkpoint lifecycle; no upstream kernels are copied.Initial scope: GDN, normalized Q/K, K=128, FP32 recurrence, FP8 or disabled read quantization, and first-order gradients. KDA two-precision support, lower-precision anchors, NVFP4 reads and stochastic rounding remain follow-ups. Quantized values use floating storage; this is numerical emulation, with no cache-compression or speed claim.
Usage
Expose only the pinned upstream checkout's
emulationpackage on PYTHONPATH, alongside the example's vLLM 0.30/FLA environment. Do not expose the checkout's bundled vLLM package.The caller supplies an initialized supported model and suffix-only QAT or QAD loss. The recipe disables
gdn_state_quantizerand enables dynamic E4M3gdn_read_quantizer, grouped by 128 key channels per value row. Seeexamples/llm_qat/linear_attention/REPLAYSSM.mdfor setup and the forward/backward schedule. The existing INT8/Hadamard profile still requires its separate compatible fork environment.Testing
Published training head:
0a4625eb04. The following are local/cluster results; GitHub CI for this head is pending.git diff --checkpassed. The private-fork INT8/Hadamard GPU cases were retained but not requalified in this update.Full-model Megatron/Bridge QAT/QAD, HF export-to-serving qualification and performance evaluation remain outstanding for this new profile. Engine-owned ReplaySSM cache integration is in the separate serving branch, not in this PR.
Before your PR is "Ready for review"
Additional Information
Base: #2805 (
kaix/linear-attention-state-nvfp4). Ordinary vLLM state-QDQ serving remains in #2541. ReplaySSM serving uses a separate worker and cache lifecycle, published onkaix/linear-attention-replayssm-servingatf0ddc3221e.