Skip to content

[3/9] Serve GDN/KDA state QDQ checkpoints in vLLM - #3078

Draft
kaix-nv wants to merge 1 commit into
kaix/linear-attention-decode-firstfrom
kaix/linear-attention-vllm
Draft

kaix-nv wants to merge 1 commit into
kaix/linear-attention-decode-firstfrom
kaix/linear-attention-vllm

Conversation

@kaix-nv

@kaix-nv kaix-nv commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Merge order: 9 draft PRs

#3077 → #2519 → #3078 → #2657 → #2805 → #2788 → #2878 → #2503 → #2507

#2497 is already on main. Each PR is based on the preceding branch; #3077 is based on main.

What does this PR do?

Type of change: New feature.

Add ordinary state-only fake quantization for vLLM 0.30 GDN/KDA layers. Before native execution, gather initialized active cache slots, quantize them, and write them back; fresh and inactive slots are untouched. Transpose the native value-first cache for the same value-channel grouping used in training.

FakeQuantWorker restores the saved policy and quantizer mapping. It rejects two-precision ReplaySSM checkpoints, which require the separate worker added later in #2788. Unsupported GDN owners fail explicitly. Dynamic block shapes follow the active batch size.

This slice now directly follows #2519, before the Bridge training example. Cache storage stays floating point. The qualified integration scope is synchronous eager execution at TP=1; scheduler chunking, mixed-batch native dispatch, and wider parallelism need separate qualification.

Usage

VLLM_GDN_DECODE_KERNEL=triton VLLM_ENABLE_FLA_PACKED_RECURRENT_DECODE=1 python examples/vllm_serve/vllm_serve_fakequant.py /path/to/model   --modelopt-recipe-path examples/vllm_serve/linear_attention_state_int8.yaml   --dtype bfloat16 --enforce-eager --no-async-scheduling --no-enable-prefix-caching   --mamba-cache-mode none --mamba-cache-dtype float32   --additional-config '{"gdn_prefill_backend":"triton","kda_prefill_backend":"triton","kda_decode_backend":"triton"}'

Testing

Restacked on main 580ffff1cddb9b20a38b7434e6290654ebf96a8f on 2026-10-27; this PR head is 882af51e1ff9603f7c0aebfaa3cf748fdf4376eb.

  • Combined stack at 9f913d907c298efeb99daf84a7c32246cf38208a: 226 tests passed in 108.95 seconds, covering TensorQuantizer defaults/calibration/folding/restore, state policies, independent recurrence and gradient references, replay cache lifecycle, CUDA graphs, packed two-precision gradients, GDN operand QDQ and guarded inverse behavior. These are stack-tip results; intermediate heads were not all rerun separately.
  • Changed-file pre-commit checks passed (including Ruff, mypy and Bandit). The recipe checker was run separately with the installed Python environment; all eight changed complete recipes loaded successfully.
  • All nine parent links, signed commits, Python syntax and diff checks verified. Every rebuilt branch is free of the removed biased mode; released changelog entries are preserved.
  • Local environment: RTX A6000/SM86, PyTorch 2.9.1+cu128, Triton 3.5.1. The regular GPU tests use independent reference prefixes where native vLLM is unavailable. The vLLM 0.30 engine, supported Megatron/Bridge environment, FLA 0.5.2 on Hopper/Blackwell, and full-model accuracy were not rerun. These results are not new model-quality or throughput evidence.

Before your PR is "Ready for review"

  • Backward compatibility: opt-in; existing default behavior is retained.
  • Necessary tests: existing focused suites extended or retained; validation and environment limits listed above.
  • Dependencies: optional versions and setup are documented with the example; this restack adds no dependency.
  • Changelog: updated under 0.49; released 0.48 entries preserved.
  • Owner review and CI for the new head remain required. Keep draft.

Review history

This draft continues #2541. During the restack, GitHub marked that PR merged when its rewritten head became an ancestor of its former base branch, before its base was retargeted. No main-branch merge occurred; main remains at 580ffff1cddb9b20a38b7434e6290654ebf96a8f. The prior PR retains the earlier discussion.

@copy-pr-bot

copy-pr-bot Bot commented Oct 28, 2026

Copy link
Copy Markdown

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.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@kaix-nv
kaix-nv force-pushed the kaix/linear-attention-vllm branch from 882af51 to e2b2980 Compare November 17, 2026 01:08

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant