AN ILLUSTRATED FIELD GUIDE / LLM SERVING

Why read the same
request twice?

Follow five little tokens through an LLM server. Find out what it can remember, where that memory lives, and when remembering is not enough.

OUR REQUEST Help · me · plan · a · trip5 toy token labels · output target: 2 tokens

Start here; no GPU background needed. Green means retained work; amber means new work; red means replay or mismatch. Every count below is an invented, hand-checkable teaching example—not a measured speedup. The complete earlier lesson and all four original labs are preserved in optional same-page references.

01 / THE WHOLE JOB

Two people ask the same thing. Must we start over?

Ari asks an assistant, “Help me plan a trip.” A moment later, Bea sends the same beginning. The model still has to write Bea's answer. But does the server really need to prepare that entire beginning again?

ARI, THEN BEA
“Help me
plan a trip”
Read the request
keep useful working memory
THEN WRITE AN ANSWER
“Try Rome”
Notice this: two requests can share preparation even if their sampled answers differ. This is the whole task. We will open only the server's memory and work-order boxes—not train a model.

The model weights are learned numbers shared by requests using that model. The working memory records what a particular request has processed. Reusing the latter is not saving and replaying an old answer.

Three separate questions hide inside “remember”: Where did we put the data? Does this request begin the same way? Do we have everything needed to continue? Each needs a different picture.

Carry this forward: reuse preparation, not necessarily the answer. First we need to see what “preparation” means.

02 / OPEN THE READING BOX

What does the server actually remember?

The model reads tokens: numbered pieces of text, which may be words, word fragments or punctuation. For arithmetic we pretend our five words are five tokens. A real tokenizer may split them differently.

PROMPT / POSITIONS START AT ZERO
0Help1me2plan3a4trip
Prefill
process the 5 prompt positions
Sample “Try”
from the final prompt's scores
Decode
process “Try”, then sample “Rome”
Notice this: generating two output tokens does not necessarily mean two identical decode passes after prefill. The final prompt position can already supply scores for the first output.

Prefill is processing the prompt's not-yet-reused positions. Decode feeds generated tokens back through the model to continue the answer. These are phases of the same model, not two different models. The model's output scores are often called logits.

In an attention layer, a new position makes a query (“what should I look for?”). Earlier positions provide numerical keys (“what can be found here?”) and values (“what information can I contribute?”). Attention mixes values using query–key scores. The KV cache keeps these earlier keys and values so they need not be rebuilt at every step.

One tiny numerical attention example, before the full equation

Suppose two earlier values are 10 and 20, and their attention weights are ¾ and ¼. Their contribution is ¾ × 10 + ¼ × 20 = 12.5. Where those values sit in memory must not change 12.5. Real keys/values are vectors at many layers; the preserved arithmetic lab computes actual scores, softmax weights and weighted vectors across scattered pages.

A sampled word is not automatically in this cache yet: it enters the model's processed state when it is fed back. Keep “tokens emitted” separate from “tokens processed.”

Carry this forward: the KV cache saves intermediate model work. Now find one saved item without assuming everything is adjacent.

03 / A MAP OF ADDRESSES

Where is the memory for “trip”?

Imagine reserving one enormous continuous stretch of memory for every conversation, just in case it grows. Much of it could sit empty. Instead, put token positions into small blocks and keep a table mapping their logical order to physical storage.

Our block size is 2 token positions. “trip” is position 4. Divide 4 by 2: it belongs to logical block 2, at offset 0. If table[2] is 33, the address is physical block 33, offset 0. No hunting through every block.

Predict: move logical block 2 from physical block 33 to physical block 5, with its contents intact. Should the model's answer change?

Follow one address

PagedAttention, introduced by vLLM, connects this paged layout to attention reads. It changes how saved keys/values are found, not the mathematical attention result. The little labels above stand in for their numerical KV vectors.

Answer: the address changes; the data and answer must not. Five positions need six slots here, not a maximum-length reservation. Paging is about placement; it does not by itself prove a second request can reuse a prefix.

04 / A TREE OF SHARED BEGINNINGS

How much of Bea's beginning have we seen?

Ari's “Help me plan a trip” is cached. Another request says “Help me plan a meal”. Store their common beginning once, then branch where the tokens disagree. A radix tree compresses a run of shared tokens onto one edge rather than drawing a separate node for every token.

Two requests share the first four token labelsRoot connects to Help me plan a, then branches into trip for Ari and meal for another request. Edge labels contain token runs; the tree is an index, not the physical KV layout.Help · me · plan · atripArimealone compressed shared edge
Notice this: follow tokens from the root, never jump into the middle. This is our original teaching drawing, not an official SGLang figure. The index leads to saved KV; it is not the memory itself.

Predict: if Bea changes “plan” to “book”, can she still reuse the cached “a trip” at the end?

Change the beginning, not just its appearance

SGLang's RadixAttention uses a radix index to find reusable token prefixes. Both modern SGLang and vLLM support prefix reuse and paged/pooled KV: “one has trees, one has pages” is not an exclusive feature split.

We use a full-block-only teaching policy: matching 5 tokens at block size 2 reuses 4 and processes 1. A real system may handle partially filled blocks differently, and even a full prefix hit can still require boundary work before an output is sampled.

Precision note: documentation policy versus implementation paths

Pinned vLLM documentation describes caching full blocks; its pinned code also has partial-block entries and copy-on-write paths (a private writable copy when sharing would be unsafe). Those are different evidence scopes, not a contradiction to erase. Exact enabling configurations were not verified. Full-hit boundary/logit work is not included in this toy's reused-position counts. The preserved PagedAttention chapter links each pinned source separately.

Official vLLM pictures: connect the simple tree to real block bookkeeping

These are the upstream documentation's own token labels A–O, not our trip example. Read a four-letter run such as ABCD as one block in the source figure.

OFFICIAL / vLLM / UNMODIFIED PNGvLLM documentation: Request 0 has token blocks ABCD, EFGH, IJKL and incomplete MNO, with hashes for complete prefixes and free-list metadata.

Notice this: complete blocks have prefix hashes; the incomplete MNO block shows “Hash: None”.

Takeaway: the source's full-block example has a concrete eligibility boundary, like our 4-out-of-5 reuse.

vLLM contributors · Apache-2.0 · pinned original · rights, revision & hash.

OFFICIAL / vLLM / UNMODIFIED PNGA later stage of the same vLLM request: MNOP is now a full hashed block, and new token Q occupies an incomplete unhashed block.

Notice this: the same request has grown. MNO becomes the complete MNOP block and receives hash A–P; Q starts a new incomplete block.

Takeaway: a block's eligibility changes when it fills. The picture illustrates the documentation's full-block policy, not every partial-block code path.

vLLM contributors · Apache-2.0 · pinned original · rights, revision & hash.

Official SGLang reading: the authors' RadixAttention explanation and tree figure. Notice its branches share beginnings, not arbitrary matching substrings. Takeaway: the tree organizes reuse, not a new attention equation. We did not find clear reuse permission for that blog figure, so it is linked rather than downloaded or silently redrawn as “official”.

Answer: no. Once “book” differs, later matching words have a different context. A matching prefix plus compatible cache identity determines reuse, not similar-looking phrases.

05 / A TIMELINE OF COMPLETE STATE

What if KV is only half of “remembering”?

Now change one thing: use a hybrid model with attention layers and recurrent layers. A recurrent layer updates a running numerical summary as each token is processed. Continuing correctly needs both the saved KV and that recurrent summary, plus any extra model-specific state needed to continue (auxiliary state), from the same processed endpoint.

Keep our five-token prompt. Suppose the model has already processed all 5 positions, and we later append 2 more. A coarse checkpoint exists after 4 positions. If no complete checkpoint exists after 5, replay position 5 before processing the 2 new positions: 1 + 2 = 3. A complete endpoint-5 checkpoint reduces that to 0 + 2 = 2.

Here “2 new” means appended input positions in a later request, not the two output tokens in our ribbon. This experiment counts prompt recovery work only. Endpoint 5 means five positions processed (indices 0–4).

Predict: is “KV through 5, recurrent state through 4” enough? Can a host-memory toggle repair a checkpoint that was never captured?

Choose what actually survived

FlashStates is research built on a vLLM fork. Its contribution includes capturing and managing complete hybrid recovery units at exact processed endpoints, under supported capture/export conditions. It is not a third independent general serving engine, and it does not remove attention's need for KV.

OFFICIAL / FLASHSTATES / UNMODIFIED STATIC PNG FlashStates official overview: checkpoint dots on growing token timelines show replay gaps for version-specific vLLM and SGLang baselines and exact-end recovery for FlashStates; adjacent charts report the authors' GLM-5.3-Flash 48-session benchmark.

Notice this: on the left, compare the outlined ideal endpoint markers with the filled actual recovery arrows. Red segments are old positions replayed to bridge the gap—our “1 old + 2 new” example, at research scale.

Takeaway: checkpoint placement and memory pressure determine recoverable work. This figure's right-hand numbers are the authors' historical, configuration-specific reported experiment, not measured by this lesson and not a universal ranking of today's engines. Open the full-size figure to read its labels.

FutureMLS-Lab / FlashStates authors · Apache-2.0 · pinned original · authors' benchmark scope · license, notice & hash.

Answer: neither mismatched endpoints nor empty host capacity can restore missing state. Host storage can move a previously captured complete unit; it cannot invent one.

06 / A WORK LEDGER, NOT A MEMORY MAP

Who gets the next turn?

Even perfect reuse does not decide which waiting request runs next. A scheduler chooses work under limits. Continuous batching lets requests join or leave between iterations; chunked prefill breaks prompt work into smaller pieces.

For this separate concurrency example, requests A, B and C have different lengths. We switch from our five-token trip to show why a short request can finish first. There are 2 active slots and a budget of 4 token positions per tick. Visit each active request once, in order: process up to 2 prompt tokens, or decode 1 output token. Release finished slots after the tick; admit replacements at the next tick.

Predict: B arrives after A. Must it finish after A? Step the ledger: the result is B, then A, then C.

Spend the next token budget

This teaching scheduler deliberately counts output-generation actions separately from prefill; it does not model first-token logit fusion, GPU kernel time or a production scheduling policy. Its ticks have no millisecond conversion. Real serving can combine/cache/chunk work in version- and configuration-dependent ways.

Carry this forward: memory management answers “what can run?” Scheduling answers “what runs now?” Neither a token count nor a tick count alone establishes latency.

07 / REASSEMBLE THE SERVER

What changed—and what should we compare?

Return to Bea's “Help me plan a trip”. We can now tell a complete story without giving every mechanism the same picture.

  1. 1Read token IDs. Tokenization decides the pieces; the same-looking sentence is not sufficient cache identity.
  2. 2Find a reusable beginning. An index, such as a radix tree or prefix hashes, locates compatible saved work.
  3. 3Check completeness. A hybrid model also needs recurrent/auxiliary state at the same endpoint.
  4. 4Schedule and address the rest. A work ledger selects positions; block tables locate their KV while the model runs.
  5. 5Sample, stream, continue. Reuse can avoid old prompt work; the model still has to produce the answer. Release references safely when done.

Compare the same request under the same policy

A real comparison fixes the model and precision, hardware, software revisions, prompt/output lengths, arrival pattern, cache warmth, concurrency and memory budget. It reports both speed and quality constraints. “More cached tokens” alone is not a benchmark.

Time to first token (TTFT) measures from a stated arrival boundary until the first output; it can include waiting, lookup, transfer and prompt work. Inter-token latency measures gaps between outputs. Throughput measures tokens or requests per time under a specified workload. Improving one does not automatically improve the others.

The whole idea: place memory efficiently, reuse only compatible beginnings, recover complete state, and schedule fairly. vLLM and SGLang have overlapping capabilities; FlashStates studies hybrid recovery on vLLM. Choose with a controlled workload, not three feature mascots or our toy counts.

Ready to inspect the details? The next tier keeps the complete mechanisms with six concept-specific walkthroughs: an event trace, responsibility matrix, address map, growing prefix tree, aligned state timelines and measurement protocol. Actual attention arithmetic, ownership and eviction, and all four original labs are here too.

Optional depth · complete seven-chapter lesson + four original labs

Tier 2: mechanisms and precision. Every chapter and numerical control is preserved here. Each walkthrough now uses a representation suited to its mechanism rather than a repeated building scene. Expand only what you want to inspect. Tier 3: sources. Pinned references appear beside their claims; the source registry and official figure provenance distinguish evidence, versions and reuse rights.

01 / START SLOWLY

Same model mathematics. Different ways to organize the work.

An inference framework accepts requests, prepares token IDs, schedules model work, manages memory, chooses compatible execution kernels, samples output tokens and streams them back. It does not invent a new set of learned weights for each request.

Weights are the recipe

Learned Q/K/V projections and MLP weights are shared across requests using the same model. Runtime attention queries, KV caches and recurrent states are different objects.

Wq: [D,Hq·d] · Wk/Wv: [D,Hkv·d]
Illustrative orientation; stored layouts vary.

KV is previously prepared material

A Transformer stores keys and values for processed token positions, layer by layer. The next query reads eligible past KV. GQA shares KV heads among groups of query heads.

Dense logical K,V: [B,Hkv,T,d]
New q: [B,Hq,1,d]

Scheduling is not attention

Continuous batching changes which requests run between iterations. Chunked prefill divides a long prompt into bounded pieces. Neither changes the definition of attention into a different probability formula.

Scheduler → request IDs + positions + slots
Model runner → logits, updated KV/state

Everyday bridge: a busy restaurant

The menu's recipe is the model weights; each order is a request; partly prepared ingredients are per-request KV/state; the kitchen's order board is the scheduler. A new customer can join when capacity becomes available instead of waiting for an entire group to leave.

Where it breaks: GPU batching is tensor computation, not one cook per request. Cooking speed is not an estimate of GPU latency, and recurrent state is not literally a bag of ingredients. Now return to the exact lifecycle below.

Vocabulary before the machinery
Prefill
Process the uncached prompt positions, using causal attention, to build KV and any recurrent state. The final prompt position's logits can sample the first output token.
Decode
Feed sampled tokens back into the model, update its state and sample subsequent tokens. A sampled token is not automatically already represented in KV.
TTFT
Time from a defined request-arrival boundary to the first output token. It may include queuing, tokenization, cache lookup, transfer and prefill.
Inter-token latency / TPOT
Time between outputs or average time per output token, with the measurement convention stated. Not the same as TTFT.
Throughput
Completed requests or tokens per time under a specified workload, hardware and SLO. Not determined by a cache-hit count alone.
Prefix identity
Matching token context plus compatible model/configuration and any extra cache-key identity. Similar-looking text alone is insufficient.

02 / THREE COMPLETE STORIES, NOT THREE EXCLUSIVE TRICKS

What each system actually does

vLLM: a general serving runtime

  1. The frontend accepts a generation request and prepares tokens and sampling parameters.
  2. The engine looks up compatible reusable prefix blocks and queues the uncached work.
  3. A token-budget scheduler selects work; KV management allocates slots and builds mappings.
  4. The model runner executes a compatible attention/backend and other layers, using paged KV metadata.
  5. Sampling chooses output tokens; completion frees references and reusable blocks may remain cached.

Chunked prefill, prefix caching, tensor parallel execution and speculative decoding are distinct features whose support depends on version/model/backend. The original PagedAttention kernel is not the only current backend.

PagedAttention paper · Pinned V1 scheduler

SGLang: structured programs plus a runtime

  1. A request can come through a serving API or a structured language-model program with related calls/branches.
  2. The runtime prepares tokens and matches their prefix against a radix index.
  3. It protects active cached paths, allocates new KV slots and schedules the remaining positions.
  4. The model runner performs prefill/decode, potentially overlapping CPU scheduling and GPU work when supported.
  5. Finished paths can be retained for later reuse; unlocked evictable paths release capacity when needed.

RadixAttention manages prefix reuse. It is not a replacement for the model's attention equation. SGLang also has paged/pooled KV and batching; these are not vLLM-only ideas.

SGLang paper · Pinned radix cache

FlashStates: hybrid-state research on vLLM

  1. It inherits a serving path from its vLLM fork; it is not an independent drop-in competitor covering every engine feature.
  2. A hybrid attention/recurrent model processes a prefix.
  3. The system captures a recoverable state at its exact processed endpoint, when supported by its capture path.
  4. A recovery unit ties compatible KV references to recurrent/auxiliary checkpoints and prefix identity.
  5. A matching later request resumes from a complete unit, or falls back and recomputes. An optional host tier can restore a captured unit with transfer cost.

The contribution is capturing and managing the whole state needed to resume, not making attention KV unnecessary. Endpoint/export constraints and performance comparisons are source-version-specific.

Pinned FlashStates code and release paper

Layers of a system: HTTP/API → tokenizer → cache lookup → scheduler → memory allocation → model kernels → sampler → stream/cleanup. PagedAttention mainly connects storage and attention reads; RadixAttention mainly locates reusable prefixes; FlashStates connects hybrid checkpoint capture, recovery and dependency-aware storage. These mechanisms can coexist.

03 / vLLM, INCLUDING THE ACTUAL ATTENTION READ

PagedAttention: addresses move; the answer must not.

Without paging, a sequence may need a large contiguous KV reservation. Paging divides its logical token positions into fixed-size blocks and maps them to available physical blocks. The last block can have unused slots; it does not reserve every possible future token up front.

A library catalog, not a row of adjacent shelves

A book's chapter order is logical token order. Chapters can sit on different shelves (physical blocks); a catalog (block table) tells you where each one is. Moving a shelf location does not rewrite the chapter.

Limit: attention reads numerical vectors in parallel, not prose sequentially. The catalog is metadata, not learned weights. The exact calculation is below.

Compute attention across scattered pages

One batch, one head, d=2. Four invented K/V rows. The prefix-length control masks later toy positions; it does not run a trained model.

logical_block(t) = floor(t / block_size) physical_block = block_table[logical_block(t)] offset = t mod block_size s_t = dot(q, K[physical_block, offset]) / sqrt(d) a_t = exp(s_t) / sum_j exp(s_j) over visible positions o = sum_t a_t V[physical_block, offset]

The real kernel need not assemble one contiguous K/V array. It may compute partitions and combine numerically stable softmax summaries. Dividing the computation into pages must preserve the same logical attention result, up to implementation precision. Page IDs are not positional embeddings; token position information still matters.

Hand dry-run, tensor contracts and the distinction from FlashAttention

Let c=√2·ln(2). K=[[c,0],[0,0],[−c,0],[0,c]], V=[[1,0],[0,1],[2,2],[4,0]], q=[1,0]. Scores are [ln2,0,−ln2,0], so unnormalized weights are [2,1,1/2,1]. Normalization gives [4/9,2/9,1/9,2/9]. Output = [14/9,4/9] ≈ [1.555556,0.444444]. Moving the same rows to blocks [3,11] cannot change it.

Toy q [1,2] · gathered K,V [T,2] · scores/weights [T] · output [1,2]. Runtime storage example: [physical_blocks,2,block_size,Hkv,d], schematic only. Q/K/V projections are learned; block tables and gather arithmetic are not.

FlashAttention is an IO-aware exact-attention algorithm using tiling and online softmax. Paged KV addressing is a storage/layout mechanism. They are not mutually exclusive; a compatible backend can support both. Neither is FlashStates.

vLLM paging documentation (version-sensitive) · FlashAttention paper

Prefix hashes

Documented vLLM automatic prefix caching links full-block keys to prior-prefix identity, current token IDs and relevant extra identity. A same local token block after a different prefix is not the same attention context.

Docs/code distinction: the pinned source also contains partial-block cache entries and copy-on-write paths, beyond the docs' full-block-only description. Which modes enable them was not established. The simplified full-page examples here are not a universal current-vLLM restriction.

Pinned partial-entry code · Prefix-cache design

Copy-on-write

Two branches can share immutable prefix blocks. If a partially filled block is shared and one branch appends, it may need a private copy before writing. Otherwise the new branch could corrupt the other's KV. At a full-block boundary, a fresh new block can be allocated instead.

Toy B=4, prefix length=6
before: parent=[7,20], child=[7,20]
child writes position 6:
parent=[7,20], child=[7,33]
Full block 7 stays shared.

What paging does not solve

It does not remove KV bandwidth, guarantee every prompt has a reusable prefix, choose the next token, or establish that one engine is fastest. Internal fragmentation remains in partial blocks; metadata, scheduling and kernels still cost resources.

04 / SGLANG, INCLUDING REAL TREE SPLITS

RadixAttention: reuse the shared beginning, not any matching substring.

A radix tree compresses consecutive tokens along an edge. Inserting a sequence with a partial edge match splits that edge at the divergence. Nodes reference reusable KV slots; the tree is neither a learned neural network nor the KV tensor itself.

A familiar commute, then a different turn

Two trips may share the road from home to a junction and then turn toward different destinations. The shared starting route maps to a shared token prefix; the junction maps to a radix split.

Limit: the server reuses already computed KV, not elapsed travel time. Meeting the same street later does not make the earlier trip prefix identical. Exact token/configuration identity is still required.

Insert three cached paths

Labels stand for token IDs, not real word tokenization. 1–12 labels/sequence, up to 10 characters/label. All cached paths assumed resident. Tree compression and physical page alignment are shown as separate teaching layers, not a literal backend layout.

The default tree becomes root → SYS → {A → {B C, D}, X Y}. Incoming SYS A B Q matches three labels before Q differs from C. With page size 2, only two positions are eligible in this simplified policy; recompute B and Q. Identical suffix labels after a changed earlier prefix do not create an attention-cache hit.

Eligible reuse counts exclude engine-specific final-logit/boundary recomputation. Even a whole-prompt cache hit need not eliminate all prefill work; inspect the engine's exact hit path.

Active-path locks, eviction and cache-aware scheduling

Cached does not mean permanently pinned. Active requests protect the paths they are using through reference/lock bookkeeping. Eviction chooses eligible unlocked leaves under the implemented policy; a shared ancestor cannot be released while another live branch needs it. New requests may benefit from cache-aware ordering, but fairness, queueing delay and hit rates must be evaluated together. This tree demo assumes all paths resident and does not claim to implement that scheduler/evictor.

Input token_ids [T] + identity → token-path comparisons → reusable KV slot references [R] + suffix [T−R]. No learned tree weights. Attention still uses Q/K/V and causal masking.

05 / FLASHSTATES, INCLUDING STATE DEPENDENCIES

A bookmark is useful only if all the state behind it survives.

For a dense attention-only model, KV describes its attention history. A hybrid also has recurrent/SSM state and possibly convolution/auxiliary buffers. Recovering a prefix requires compatible components at the same processed endpoint, not a KV match plus an arbitrary latest checkpoint.

Pause a recipe halfway through

A recovery note says “step 6 complete”. It is only useful if the prepared ingredients and the partially cooked mixture are still available in their step-6 condition. The note maps to checkpoint identity, prepared ingredients to KV references, and the evolving mixture to recurrent state.

Limit: recipes can sometimes be reversed; a neural recurrent state generally cannot be rolled backward to recover arbitrary previous states. A host tier is storage, not time travel: it cannot restore a checkpoint never captured.

Exact-end dry-run

  1. Previous processed endpoint p=26. Next prompt length=32.
  2. An invented grid of 8 has a complete earlier checkpoint at 24, requiring 8 processed positions.
  3. A complete exact-end checkpoint at 26 requires only the 6 new positions.
  4. Delete KV or recurrent state at 26: the exact unit is incomplete; fall back to 24.
  5. Restore a previously captured complete host copy: 26 can be usable again, plus transfer cost.
  6. Edit an earlier token: the checkpoint at 26 no longer identifies the request prefix.

Try all six cases in the retained FlashStates lab below. These are counts, not a 8/6 speedup claim.

Recovery-unit ownership: release one, not everybody

Two toy recovery units: A depends on KV blocks {7,20} and checkpoint hA; B depends on {7,33} and hB. Block 7 is shared. Treat these units as evictable cached units, not active requests.


This is explicit reference accounting, not FlashStates' full admission/eviction priority algorithm or measured GPU memory. Each block counts once regardless of owners. Active-use locks would prevent eviction.

Attention layer: o_t = softmax(q_t K_≤tᵀ / √d + mask) V_≤t Generic recurrent layer: h_t = f(h_(t−1), x_t; W) Recovery unit at p = {prefix/model identity, endpoint p, attention KV references, recurrent state, auxiliary buffers} valid(p) = prefix_matches(p) AND every_required_component_present(p)

FlashStates' capture, dependency-aware management and optional modified Mooncake host tier address different failure points. Exact endpoint means positions actually consumed by the model, not necessarily every sampled output token. Capture/export requires backend support; the exact-end scenario does not imply arbitrary in-chunk states can always be extracted.

What the pinned FlashStates options change

The snapshot describes a research fork based on vLLM v0.33.0 with a modified Mooncake dependency. These are source-read option names, not tested setup commands; the lesson neither enables them nor promises compatibility with another version.

  • --mamba-frontier-checkpoint: capture a finished request's recurrent state at its exact processed endpoint.
  • --mamba-prefill-export: export required intermediate state during a longer prefill chunk, where the backend supports it.
  • --prefix-cache-eviction gds and cost coefficients: state-aware GreedyDual-Size admission/eviction, accounting for saved prefill cost and freed blocks.
  • --prefix-cache-leaf-last: change state eviction order, with an idle-leaf threshold option.
  • --mamba-spec-state-layout compact: compact state storage for speculative decoding.
  • Modified Mooncake write-through/unit-policy options: retain captured units in host memory; moving them still consumes time and bandwidth.

These features are off by default in the snapshot, apart from documented always-on correctness fixes. Its reported baselines are specific releases (including SGLang v0.5.23); they are not statements that newer upstream engines lack hybrid caching or host tiers.

Pinned change/option description · Benchmark scope and baselines

06 / END-TO-END, WITHOUT A FAKE LEADERBOARD

Compare roles, behavior and the same request—not product slogans.

DimensionvLLMSGLangFlashStates snapshot
System roleGeneral inference/serving runtimeStructured-program interface plus serving runtimeResearch extension on a vLLM fork
Characteristic mechanismPaged KV/block mapping; documented hash-based prefix reuseRadix-indexed prefix reuseComplete hybrid recovery units and endpoint capture
Request ingressServing frontend/token preparation into engineAPI or related program calls into runtimeInherited fork path; evaluate extension-specific capture/recovery
Cold promptCompute uncached positions, allocate KVCompute uncached positions, insert/extend pathsCompute prompt and capture compatible complete state
Warm prefixFind compatible cached blocks under chosen policyWalk radix paths, protect reusable slotsRequire matching endpoint plus all hybrid components
SchedulingIteration/token-budget scheduling; configuration-dependent chunkingContinuous batching and cache-aware policies; implementation-dependentInherited scheduler plus state handling—not a new universal scheduling policy
Attention executionBackend/model/hardware dependent; original kernel is not the only optionBackend/model/hardware dependent; radix lookup does not replace attention mathAttention plus recurrent kernels/capture support from its fork
Branching/evictionReferences, immutable sharing, compatible copy-on-write and cache evictionPrefix-tree ownership/locks and eligible evictionDependencies between checkpoints and shared KV; complete-unit recovery
Hybrid supportInspect exact release, model and cache modeInspect exact release, model and cache modeCore research target; not a claim that current peers lack hybrid support
Transfer/distributionVersion/configuration-specific parallelism and transfer optionsVersion/configuration-specific parallelism and hierarchical storage optionsOptional host recovery with transfer overhead; not infinite GPU capacity
Selection basisModel/backend compatibility, correctness, workload shape, TTFT/TPOT SLOs, sustained throughput, memory, operations and measured cost—not an algorithm name alone.

The same next-turn workload

The engine columns deliberately use the same simplified full-page cache policy. The extension scenario additionally permits a complete exact old endpoint. These are counterfactual teaching assumptions, not current engine feature claims or measured benchmark results. Missing checkpoints mean no hybrid recovery points at all in this toy.

How to perform a real end-to-end comparison
  1. Pin engine commit, model/tokenizer/adapters, dtype/quantization, attention backend, cache flags and hardware. Verify all configurations support the model correctly.
  2. Use identical input/output distributions, generation/sampling policy, arrival rate, concurrency and context mix. Distinguish cold cache, warm cache, edits and multi-turn/branching workloads.
  3. Record queueing, tokenization, lookup, restore/transfer, uncached prefill, first-token emission, decode and cleanup boundaries. Count usable reused positions and explain full-prefix final-logit handling.
  4. Report TTFT, inter-token latency/TPOT and end-to-end latency distributions; throughput at a declared SLO; peak KV/state/weights memory; transfer bytes and cache hit scope.
  5. Check output/correctness under a defined tolerance and repeated runs. Prefix-cache hits alone do not prove speed, and different sampling/kernels need not produce bit-identical text.
  6. For FlashStates, compare against matched fork/baseline hybrid-state modes. Do not rank it as a third general production engine.

No such benchmark, GPU trace, measured speedup or cost comparison has been executed in this lesson.

Choose a delivery service, not just its sorting shelf

A better shelf system can reduce handling work, but the whole delivery time also includes waiting, loading, travel and return processing. Likewise, fewer prefill positions can help TTFT but do not determine the full serving result.

Limit: the analogy supplies no performance numbers. Only a controlled workload and measured boundaries establish those.

07 / RETAINED, EXPANDED LEARNING TOOLKIT

Additional numerical labs, in the same design

All four original panels remain here: the KV calculator and scheduler, address mapping, two-path radix matching, and exact-end/host-recovery controls. Switch the lab below; this does not open another page or design.

Original lab policy scope: full-page reuse and the hybrid checkpoint grid are deliberate simplifications. The pinned vLLM code has newer partial-block/CoW paths; SGLang also has hybrid/host-cache components. Do not infer universal release limitations from a lab's toy policy.