Repository navigation
Conversation
Signed-off-by: Taimys <2281693949@qq.com> Assisted-by: OpenAI Codex
Keep upstream monkeypatch-based test setup and preserve the GDN regression coverage. GDN implementation files remain unchanged. Signed-off-by: Taimys <2281693949@qq.com> Assisted-by: OpenAI Codex
Signed-off-by: Taimys <2281693949@qq.com> Assisted-by: OpenAI Codex
Contributor
|
Documentation preview: https://vllm--62922.org.readthedocs.build/en/62922/ |
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.
Overview
Avoid materializing dense initial states for CUDA Mamba2 continued-prefill calls containing one sequence with direct final-state writeback. State passing reads the initial state from the cache and preserves each chunk's entering state in the existing SSD workspace.
Fixes #62919.
Claims
Validation
Correctness
385 passed, with no failures, errors or skips, on one NVIDIA L20.
Coverage includes FP16/BF16/FP32 state storage, multiple SSD shapes, in-place updates, shared/crossed cache slots, masked initial states, checkpoint/returned-state fallbacks, and protection against destructive autotuning. Numerical comparisons use
rtol=0, atol=0.The suite includes 18 gather-warmup regressions using strided block-table column views. They require compile-only startup warmup and reject new gather compilation during the subsequent SSD call. A separate negative control using stride-1-only warmup triggers the expected failure.
A compiled Granite mixed-prefill/decode run completed 48 requests with 1,116 exact layer-level comparisons across direct, checkpoint and multi-sequence paths, including 756 comparisons in mixed prefill/decode steps.
Serving performance
Baseline: unmodified
8407bc0bb6b0061dacb731ae3cc54b6035f112b3.Candidate: the same revision plus this patch. Both variants use native extensions built from the baseline source; this patch changes no native code.
Environment:
03a64d0592a0af98cf9e80e13415a711e825e3e1.A custom streaming HTTP client measured two workloads:
max_tokens=1, 32 concurrent single-prompt RPCs.[32, 600, 1600, 128, 32, 600, 1600, 128], andmax_tokens=64. Long suffixes begin with a varying nonce to avoid additional cache hits across rounds.Services ran serially in stock/candidate/candidate/stock order. Each variant had two independent processes, with three measured rounds per workload per process after warmup. Each round contained 64 prompts. Table values are medians of the six round-level statistics; TTFT percentiles are computed per round.
TTFT is measured per prompt from the start of its HTTP RPC to the first streamed token. Throughput is measured in prompts/s, including all eight prompts in each batched RPC.
No benchmark-specific SSD configurations were forced. Existing autotuned kernels tuned independently in each process. The candidate's indexed state-passing path used its fixed production configuration (
BLOCK_SIZE=512), bypassing autotuning because trial launches could overwrite aliased input states.Client concurrency and SSD batch size are distinct. Separate probes of the short-continuation workload observed B=1 SSD prefill calls. The mixed workload produced B=3 checkpoint-prefill calls, alongside B=1 calls and decode work. These probes ran separately; timed workers had no scheduling probes, shadow execution or profiler.
All 1,536 recorded responses (768 per variant) matched in token IDs and text at corresponding input positions across runs. Short outputs contained one token; mixed outputs reached the 64-token limit.
Serving configuration
MODELpoints to a local snapshot of the model revision listed above. Both variants used the same server configuration:Each process used separate vLLM and Inductor cache directories. Compiled Triton binaries were shared, while disk caching of autotuning results remained disabled.
The client used
/v1/completionswithtemperature=0, streaming enabled andreturn_token_ids=true. It tracked the first token separately for eachchoice.index, including tokens with empty decoded text. The shared prefix was primed before workload warmup and measurement.Details
Continued prefill currently materializes dense initial states through indexing and
torch.where, even for short suffixes. This snapshot also protects the original state after final-state writeback.For CUDA SSD calls containing one prefill sequence with direct final-state writeback, state passing now reads the indexed cache and stores each chunk's entering state in the existing workspace. Chunk scan consumes those states. The FP32 recurrence and final-state writeback arithmetic remain unchanged; cache and workspace dtypes must match.
Indexed state passing uses a fixed
BLOCK_SIZE=512, bypassing autotuning to avoid destructive trial writes. Multi-sequence, checkpoint and returned-state calls retain snapshot semantics: CUDA uses the existing fused gather, while other platforms retain the PyTorch snapshot.Gather warmup uses the existing compile-only registry and covers the alignment and stride classes produced by Mamba2 metadata. The existing SSD warmup also exercises the indexed direct path.
Scope and tradeoffs
The serving measurements cover one model/GPU configuration and two workloads. The mixed workload exercises checkpoint fallback together with single-sequence prefill and decode; it does not isolate short multi-sequence SSD calls.
Earlier prototype measurements identified host overhead in the snapshot fallback. Isolated API cost was not remeasured on the final patch, and the mixed serving result does not establish regression-free behavior for every fallback workload.
For batched completions, the tested baseline reports
cached_tokensonly for the last prompt. Per-prompt cache-hit counts were therefore asserted for the single-prompt workload; mixed-workload coverage was additionally checked through the independent scheduling probes.Related work checked: #61497 addresses final-state writeback and dispatch overhead, #61501 introduces the opt-in FlashInfer scan, and #61528 targets piecewise graph capture. This change addresses the remaining initial-state snapshot in the default Triton SSD path.
Assisted by Astra.