Skip to content

vllm.distributed.kv_transfer.kv_connector.v1.umbp.data

Shared data types for the UMBP KV connector.

The types in this module deliberately do not depend on a UMBP client. They describe vLLM's logical KV objects and the physical ranges a runtime adapter will transfer.

Classes:

  • BlockIdentityCodec –

    Build stable rank-local keys from vLLM block hashes.

  • BlockLoadBatch –

    Whole-block loads with request metadata shared across the batch.

  • BlockStoreBatch –

    Columnar whole-block stores with request metadata shared by the batch.

  • BlockTransferPlan –

    One complete logical block transfer.

  • KVLayoutDescriptor –

    Backend-neutral description of one rank-local KV object layout.

  • KVLayoutPlanner –

    Create a deterministic all-layer object layout from KVCacheConfig.

  • KVRange –

    A source/destination range in a runtime transfer.

  • KVRegion –

    One deterministic region in a rank-local KV object.

  • LoadSpec –

    Scheduler decision for one externally loaded prefix.

  • RankTopology –

    Model-parallel ranks that participate in one KV object.

  • RequestTracker –

    Core request state shared by every runtime mode.

  • StoreEventResult –

    Number of workers that finished one store event.

  • TransferJobState –

    Per-key completion state; one failed key does not fail its siblings.

  • UMBPConnectorMetadata –

    Scheduler-to-worker metadata for one engine step.

  • UMBPConnectorWorkerMetadata –

    Worker completion metadata aggregated across ranks.

  • UMBPHandshakeMetadata –

    Namespace a worker derived, reported to the scheduler at startup.

  • UMBPNamespace –

    Compatibility namespace for objects stored outside the engine.

Functions:

BlockIdentityCodec dataclass

Build stable rank-local keys from vLLM block hashes.

Groups in replicated_groups get one TP-agnostic key (tp*) that every TP rank loads and only TP rank 0 stores.

Methods:

  • keys_per_object –

    Number of rank keys that together hold one logical block.

keys_per_object(topology, group_id)

Number of rank keys that together hold one logical block.

BlockLoadBatch dataclass

Bases: Sequence[BlockTransferPlan]

Whole-block loads with request metadata shared across the batch.

BlockStoreBatch dataclass

Bases: Sequence[BlockTransferPlan]

Columnar whole-block stores with request metadata shared by the batch.

BlockTransferPlan dataclass

One complete logical block transfer.

KVLayoutDescriptor dataclass

Backend-neutral description of one rank-local KV object layout.

KVLayoutPlanner

Create a deterministic all-layer object layout from KVCacheConfig.

Methods:

  • plan_for_block –

    Lower one GPU block into a deterministic scatter/gather plan.

  • register_kv_caches –

    Capture stable base addresses for the planned KV regions.

plan_for_block(key, block_id, base_addresses, *, group_id=None, request_id=None)

Lower one GPU block into a deterministic scatter/gather plan.

register_kv_caches(kv_caches)

Capture stable base addresses for the planned KV regions.

KVRange

Bases: NamedTuple

A source/destination range in a runtime transfer.

KVRegion dataclass

One deterministic region in a rank-local KV object.

LoadSpec dataclass

Scheduler decision for one externally loaded prefix.

RankTopology dataclass

Model-parallel ranks that participate in one KV object.

RequestTracker dataclass

Core request state shared by every runtime mode.

Methods:

  • mark_saved –

    Advance the save watermark only to a complete block boundary.

  • replace_blocks –

    Replace stale pre-preemption tables with resumed full tables.

mark_saved(token_count, block_size)

Advance the save watermark only to a complete block boundary.

replace_blocks(block_ids)

Replace stale pre-preemption tables with resumed full tables.

StoreEventResult dataclass

Number of workers that finished one store event.

TransferJobState dataclass

Per-key completion state; one failed key does not fail its siblings.

UMBPConnectorMetadata dataclass

Bases: KVConnectorMetadata

Scheduler-to-worker metadata for one engine step.

UMBPConnectorWorkerMetadata dataclass

Bases: KVConnectorWorkerMetadata

Worker completion metadata aggregated across ranks.

UMBPHandshakeMetadata dataclass

Bases: KVConnectorHandshakeMetadata

Namespace a worker derived, reported to the scheduler at startup.

UMBPNamespace dataclass

Compatibility namespace for objects stored outside the engine.

Methods:

  • configured –

    Return the explicit key_namespace, or None when it is derived.

  • from_vllm_config –

    Derive the namespace from a worker's per-layer KV cache config.

configured(vllm_config) classmethod

Return the explicit key_namespace, or None when it is derived.

from_vllm_config(vllm_config, kv_cache_config) classmethod

Derive the namespace from a worker's per-layer KV cache config.

The scheduler holds a single worker's config, so it adopts the namespace its workers report instead.

_engine_may_load_foreign_kv(vllm_config)

Whether any connector of this engine may load KV that vLLM's own cache writer did not produce, e.g. a MultiConnector sibling of UMBP.

MultiConnector hands each child a config copy holding only that child's kv_transfer_config, so read the engine's current config, which workers set while they create their connector.

_model_fingerprint(model_config)

Effective model settings that change the KV a checkpoint produces.

hf_config already has hf_overrides applied, so overridden RoPE or attention settings separate engines that share the same model path.

_page_segments(spec, tensor, num_blocks, layout)

Byte (offset, length) runs of a layer's page from its block start.

Empty when the page is one contiguous run. LHBNC and BHLNC store each head's tokens as a separate run.

_spec_fingerprint(spec)

Every field that shapes a layer's stored bytes, in a stable form.

tp_replicated_group_ids(config, topology)

Groups whose blocks are byte-identical on every TP rank.

Every layer must declare a single TP shard (max_tp_shards=1, e.g. MLA latents and sparse indexers); context parallelism shards them, so it opts out.