Skip to content

vllm.v1.kv_offload.tiering.obj.manager

Object store secondary tier implementation.

Classes:

ObjAsyncLookupManager

Bases: AsyncLookupManager

Async lookup manager for ObjectStoreSecondaryTierManager.

Batches existence probes into a single query_memory() call so the background thread issues one round-trip per step instead of one per key.

ObjectStoreSecondaryTierManager

Bases: SecondaryTierManager

Secondary tier that offloads KV cache blocks to an S3-compatible store.

Handles CPU DRAM <-> S3 transfers only. GPU <-> CPU is managed by the primary tier. Object keys are formed as {prefix}/{hash_shard}/{hash}.bin.

Methods:

  • __init__ –

    Args:

  • drain_jobs –

    Block until every submitted transfer has completed or failed.

  • get_finished_jobs –

    Poll transfers; a failed promotion marks its cached verdicts False

__init__(offloading_spec, primary_kv_view, tier_type, store_config, prefix='', io_threads=4, enable_kv_events=False, locality=None, backpressure_detector=None, access_mode=OffloadAccessMode.READWRITE)

Args: offloading_spec: Offloading configuration. primary_kv_view: Memoryview of the primary tier's CPU KV cache. tier_type: Tier type identifier, set by SecondaryTierFactory. store_config: Object store connection parameters (see ObjStoreConfig). prefix: Key prefix prepended to all object keys. io_threads: Number of NIXL I/O threads. enable_kv_events: Emit BlockStored KV events for blocks successfully stored to this tier. Effective only when KV cache events are enabled globally (kv_events_config). locality: Whether this tier's storage is LOCAL or REMOTE relative to the publishing vLLM instance. backpressure_detector: Optional backpressure detector. access_mode: read serves loads but never writes blocks, write writes blocks but never serves loads, and readwrite (default) does both.

_poll_active_transfers()

Poll all in-flight transfers once; move newly-completed (success or failure) into _pending_results and release their NIXL handles.

_probe_connectivity()

Verify object store connectivity at startup via a NIXL lookup probe.

Performs a single exists() check against a synthetic key that will never exist. A True/False result confirms the bucket is reachable; an exception indicates misconfigured obj store params and raises RuntimeError.

_submit_transfer(job_id, block_ids, obj_keys, op)

Submit an async transfer. op is 'WRITE' (store) or 'READ' (load).

drain_jobs()

Block until every submitted transfer has completed or failed.

nixl exposes only check_xfer_state (poll-based), so this loops until _transfers is empty. Results accumulate in _pending_results and are surfaced by the next get_finished_jobs() call.

get_finished_jobs()

Poll transfers; a failed promotion marks its cached verdicts False here (scheduler thread).