The design of the KVBM is inspired from vLLM and SGLang KV block managers but with a twist from historical memory tiering design aspired in general GPU programming. See KVBM Reading. The following figure shows the internal architecture of KVBM and how it works across workers using NIXL.
Internal architecture and key modules in the Dynamo KVBM
The KvBlockManager <H, D> acts as a coordinator across memory tiers—host (CPU), device (GPU), and remote—by managing per-backend block pools and exposing consistent block lifecycle APIs. It tracks KV block locations across device memory (G1), CPU memory within and across nodes (G2), local/pooled SSDs (G3), and remote storage (G4). G1-G4 are key tiers enabled by KVBM. Critical to note that KVBM treats G4 storage as an opaque blob store, unaware of internal layout optimizations.
KvBlockManager<H, D> owns:
BlockPool<Device>BlockPool<Host>Implementation-wise, KvBlockManagerState holds the logic: it’s initialized by KvBlockManagerConfig, which merges runtime, model, and layout configurations. NixlOptions injects remote awareness.
Each block is a 2D array [num_layers][page_size × inner_dim]. BlockLayouttrait abstracts the memory layout. The default implementation,FullyContiguous, stores all layers for all blocks in one region with alignment-aware stride computation:
Both CPU and GPU pools share this memory layout, but they use storage-specific backends:
DeviceStorage → CUDA device bufferPinnedStorage → page-locked host memorySystemStorage → CPU heap memory (fallback/test)NixlStorage → remote memory through NIXL RDMA handles (includes storage)Each layout is constructed using a LayoutConfig, and storage is either passed directly or allocated using a StorageAllocator.
Each BlockPool<T> (where T is DeviceStorage, PinnedStorage, and so forth) tracks two sub-pools:
ActivePool: Contains blocks currently in use by sequencesInactivePool: Recycled blocks ready for allocation; think free listWhen a token block is requested (for example, get_mutable_block()), the allocator pops from InactivePool, transitions its state, and returns a writable handle. On sequence commit or eviction, the system resets blocks and returns them to the inactive pool.
The state machine (BlockState) that tracks the block lifecycle transitions includes:
This table lists the valid KVBM transitions:
Consider this example lifecycle of a block in the KVBM; in it, a sequence requests a new KV block:
init_sequence() → Transitions to Partialcommit() → State becomes Completeregister() → Block is hashed and moved to Registered. Blocks can now be used to lookup.drop() of RAII handle returns block to ResetThe system uses RAII for memory lifecycle management. Every block holds metadata and registration state, and registration is coupled with an EventManager. On registration and drop:
PublishHandle triggers Register eventsThis pattern ensures consistency for shared memory tracking across workers without requiring explicit deallocation logic. The events are propagated in the Dynamo Events plane. Any Dynamo component subscribed to the events plane can listen to these changes. Note that even the storage provider can subscribe to the events plane and create an internal prefix tree representation that is tailored and optimized for the specific platform.
The NIXL agent exposes remote memory buffers using NixlBlockSet, RemoteBlocks, and layout descriptors. Key operations include:
nixl_register(): Registers memory region with NIXL runtimeserialize() / deserialize(): Converts layout and memory into transferable descriptorsimport_remote_blockset(): Loads remote node’s block layouts into the managerget_remote_blocks_mutable(): Fetches transferable memory views from another nodeRemoteBlocks is a lightweight abstraction over shared memory for cross-node block usage (through UCX or other backends).
The left side of the figure in Understanding KVBM Components illustrates a bidirectional remote memory registration and layout synchronization protocol between workers (for example, Worker 1 and Worker 2) using NIXL. The following steps break down the process:
Agent Creation & Memory Registration:
Each worker independently sets up a NixlAgent:
nixl_register().Metadata exchange:
After memory registration, workers exchange serialized layout metadata, encapsulated in a SerializedNixlBlockLayout.
Why is this step critical?
FullyContiguous layouts, their internal slicing and alignment assumptions differ.Without this step, remote fetches would result in data corruption or misaligned tokens.
Serialization & Deserialization: Making Layouts Portable
In the serialization stage, KVBM exports and FullyContiguous::serialize() encodes:
Memory type (VRAM, DRAM)
Address & size
Device ID
The system sends this using NIXL transfer and then injects it into a KVBM scheduler state. In the deserialization stage, SerializedNixlBlockLayout::deserialize() rehydrates this into:
Ownership handles and lifetime tracking
Memory ownership in NIXL is tightly coupled with RAII-based handles:
PublishHandle which wraps a RegistrationHandleYou can integrate KVBM with a storage backend by extending or wrapping NixlEnabledStorage to support cross-node RDMA registration. All layouts and block pools are generic over these backends, allowing for fine-grained control over memory tiers. We defer detailed integration guidance, since we collaborate with storage partners to simplify and standardize these integration paths.
For now, the following breakdown provides a high-level understanding of how KVBM interacts with external storage using the NIXL storage interface and the Dynamo Event Plane:
The NIXL interface abstracts volume interaction and decouples it from mounting, metadata tracking, or direct system I/O. It provides:
These abstractions allow backends to be integrated without tying into the host’s file system stack, enabling safe interaction with block devices, local filesystems, and RDMA-capable volumes. Please note that these APIs are still being finalized.
To support external storage optimizations without modifying KVBM logic, we provide an event plane built on NATS.io that emits lifecycle events for all block operations. Particularly there are two events emitted.
Each KVEvent (~100 bytes) contains:
For scalability, the system batches and publishes these events periodically (for example, every ~10s, or dynamically based on system load).
This section provides an overview for the storage provider who is interested in integrating as a custom backend to KVBM and providing optimized performance. Please note, this is optional for KVBM integration with a backend.
External storage systems are not tightly coupled with Dynamo’s execution pipeline. Instead, they passively observe KV block lifecycle events through a subscription model:
Now, to enable fast lookup and dynamic tiering, storage vendors may build internal data structures using the received event stream. Here is a high level conceptual design:
This event-driven indexing allows the storage system to track which KV blocks are live and where they belong—enabling low-latency lookup, efficient space reclamation, and multi-tier coordination. With real-time visibility into KV block usage patterns, the storage system can implement smart tiering policies, such as:
These optimizations are performed entirely outside of Dynamo, with the assumption that storage providers adhere to SLA guarantees and volume availability.
Critically, this entire system is designed to be non-intrusive:
This design ensures that performance, resilience, and extensibility scale independently across the KV layer and the storage backend layer.