vllm.model_executor.layers.mamba.checkpoint
¶
Classes:
-
MambaPrefillCheckpointBuilder–Build backend-neutral prefill checkpoint locations.
-
MambaPrefillCheckpointExporter–Store each checkpoint's pre-convolution window and recurrent state.
Functions:
-
compute_mamba_prefill_checkpoints–Per-row internal prefill checkpoint offsets and cache block columns.
MambaPrefillCheckpointBuilder
¶
Build backend-neutral prefill checkpoint locations.
Source code in vllm/model_executor/layers/mamba/checkpoint.py
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.
Source code in vllm/model_executor/layers/mamba/checkpoint.py
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | |
compute_mamba_prefill_checkpoints(seq_lens, query_lens, hash_block_size, mamba_block_size, checkpoint_alignment, drop_eagle_block, cache_hit_alignment_tokens, num_hash_lookahead_tokens=0)
¶
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.
0and-1mean the row has none.