Skip to main content

Module cache

Module cache 

Source
Expand description

§Mamba-1 Inference Caches

State carried between calls during autoregressive (token-by-token) generation. During training or prefill the whole sequence is processed at once by Mamba1::forward; during decoding one token is processed per call by Mamba1::step. Both modes thread the same two pieces of state:

  1. Convolution window — the last conv_kernel pre-activation inputs to the depthwise Conv1d, kept so each step can apply the causal filter without reprocessing earlier tokens.

  2. SSM hidden state — the per-channel state matrix that compresses the entire past into a fixed-size representation (independent of how many tokens have been seen).

Mirrors crate::mamba2::cache; Mamba-1 has a single SSD-free recurrence so the cache holds plain tensors rather than the head-structured state of Mamba-2.

Structs§

Mamba1Cache
The mutable state carried between calls for a single Mamba-1 layer.
Mamba1CacheConfig
Configuration / factory for a single Mamba1Cache.
Mamba1Caches
A collection of per-layer caches for a complete Mamba-1 network.
Mamba1CachesConfig
Configuration / factory for Mamba1Caches.