For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Python class
RecurrentStateBuffer
RecurrentStateBuffer
class max.nn.kv_cache.RecurrentStateBuffer(pages)
Bases: KVCacheBufferInterface
One replica’s recurrent state pool, viewed as the pages it holds.
all_buffers
Returns every leaf’s pages, leaf-major then device order.
pages
Each state leaf’s [num_blocks, bytes_per_page] uint8 pages, one
buffer per device.
to_memory()
to_memory()
Returns one unit per state leaf, keyed as leaves() names it.
-
Return type:
total_num_pages
property total_num_pages: int
Returns the first leaf’s block count, including the null block.