Skip to content

vllm.model_executor.layers.mamba.checkpoint

Classes:

Functions:

MambaPrefillCheckpointBuilder

Build backend-neutral prefill checkpoint locations.

MambaPrefillCheckpointExporter dataclass

Store each checkpoint's pre-convolution window and recurrent state.

The recurrent states are rows of a buffer the prefill kernel emitted; recurrent_rows picks each checkpoint row's state out of it, and by default row i holds checkpoint i's. Layers with only a conv state pass no recurrent buffers. token_indices maps the rows' tokens, laid out by cu_seqlens, to their rows of raw_qkv.

compute_mamba_prefill_checkpoints(seq_lens, query_lens, hash_block_size, mamba_block_size, checkpoint_alignment, cache_hit_alignment_tokens, num_hash_lookahead_tokens)

Per-row internal prefill checkpoint offsets and cache block columns.

Backends call this instead of re-deriving the rules, so they decline in lockstep with the scheduler and MambaManager: allocating a checkpoint block without writing it leaves the prefix cache serving uninitialized state.

Returns:

  • list[int] –

    (offsets, cols): the checkpoint's offset into each row's query and

  • list[int] –

    its block-table column. 0 and -1 mean the row has none.