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 |
kaix-nv
force-pushed
the
kaix/linear-attention-vllm
branch
from
September 24, 2026 06:06
ca9f302 to
087123e
Compare
This was referenced Sep 24, 2026
kaix-nv
added this pull request to stack #2543
September 24, 2026 06:31
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## kaix/linear-attention-decode-first #2541 +/- ##
=====================================================================
Coverage ? 70.20%
=====================================================================
Files ? 619
Lines ? 68475
Branches ? 0
=====================================================================
Hits ? 48070
Misses ? 20405
Partials ? 0
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-vllm
branch
from
September 24, 2026 18:17
087123e to
f9d3b35
Compare
kaix-nv
force-pushed
the
kaix/linear-attention-vllm
branch
from
September 25, 2026 01:54
f9d3b35 to
9ccae1f
Compare
Signed-off-by: Kai Xu <kaix@nvidia.com>
kaix-nv
force-pushed
the
kaix/linear-attention-vllm
branch
from
September 25, 2026 04:26
9ccae1f to
3c932d0
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 drafts
All five drafts 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.
Stacked on #2519 (
kaix/linear-attention-decode-first). Add a state-only ModelOpt fake-quant plugin for vLLM GDN and KDA. It appliesTensorQuantizerto the incoming recurrent state immediately before each native prefill or decode call. Native kernels and cache management remain in use; this PR changes no CUDA or Triton kernels.Prefill quantizes the initialized state tensor passed to the original chunk kernel. Decode gathers only active cache slots, applies QDQ, and writes them back before the original recurrent kernel. Each slot/head has its own dynamic scale over
[Dk,Dv]. FP8 E4M3 and signed symmetric INT8 are supported, with FP32 dequantized state.This replaces the earlier draft's custom attention execution and separate request cache. There is no additional persistent state allocation or worker memory reservation. Quantization happens once per native invocation, including scheduler-level prompt continuations; it does not round every internal prefill chunk or the final-state write. Quantizer configuration and state names survive save/restore through the HF-to-vLLM mapper.
The worker validates adapter policy before calibration or warmup and after loading quantizer state. It discovers adapters from the model instead of retaining a second list; shared runtime capability checks run once per binding.
The execution-config definition comes from #2519. This serving adapter continues to accept only the default execution policy and state quantizers; it does not enable the training prefill-GEMM or replay paths. The native integration test now propagates its import paths to spawned workers as well as through
PYTHONPATH.Usage
The recipe sets
algorithm: null: dynamic state scales require no calibration dataset. Set statenum_bits: [4, 3]for FP8. Existing worker weight/activation calibration remains available. UseMODELOPT_STATE_PATHinstead ofRECIPE_PATHto restore saved quantizer configuration.The state-only adapter rejects nondefault execution policies, including the previous draft's replay policy. Use the new state-only recipe. See
docs/linear_attention_vllm.mdfor the exact rounding cadence and runtime limits.Testing
Current restacked source on two RTX A6000 GPUs, Torch 2.9.1+cu128, and Triton 3.5.1:
The integration run used the clean pinned vLLM checkout
930288170c31e8568290fff407dca8caf17d16ad, whose recurrent-state ABI is key-first, with existing local compiled artifacts. The initially selected editable vLLM checkout used value-first state and correctly failed the runtime guard; that run is not included in the passing result.The passing run used the existing local pytest harness to set
gpu_memory_utilization=0.04, with the same 128 MiB cache budget and unchanged numerical assertions. This avoids requiring nearly all GPU memory for tiny synthetic models.NCCL_P2P_DISABLE=1is required on this host. These are validation settings, not changes to the serving worker or kernels.The local
low_memory_vllmfixture wraps this test module'sLLMconstructor withfunctools.partial(LLM, gpu_memory_utilization=0.04). It is not part of the PR. Models use tiny offline Qwen3-Next/Kimi Linear configurations and synthetic weights; this is functional qualification, with no pretrained-quality or performance claim.Before your PR is "Ready for review"
CONTRIBUTING.md?: N/A; no copied third-party kernel or new dependency. Wrappers call native vLLM functions.Additional Information
The supported runtime is vLLM 0.15.x with key-first FP32 state, eager synchronous execution, TP=1/2 and PP=DP=CP=1. Speculative decoding, prefix caching, state transfer, and CUDA graphs remain unsupported.
A separate prefill-GEMM PR is deferred until an optimized fused kernel is available. It will reuse #2503's eight numerical sites; this adapter does not expose the materialized PyTorch prefill backend. Megatron training/backward qualification and vLLM forward/cache qualification remain separate.