vllm.distributed.ec_transfer.ec_connector.tiering
¶
Tiered encoder-cache connector building blocks.
Modules:
-
config–Configuration for the local encoder-cache filesystem tier.
-
connector–Public connector shell for tiered encoder-cache offloading.
-
executor–Asynchronous filesystem I/O execution for encoder-cache entries.
-
filesystem–Non-blocking interface for an encoder-cache filesystem tier.
-
io–Raw-tensor filesystem I/O for encoder-cache entries.
-
layout–Persistent cache identity and full-block disk layout for encoder cache.
-
lookup–EC file probes using the native KV asynchronous lookup lifecycle.
-
manager–Asynchronous CPU-primary and secondary-tier transfer orchestration.
-
primary–Borrow the CPU scheduler's existing cache and storage for tiering.
-
scheduler–Scheduler orchestration for CPU-primary encoder-cache tiering.
Classes:
-
ECCacheNamespace–Stable factors that determine encoder-output byte compatibility.
-
ECFileEntry–An entry published in the filesystem tier's in-memory index.
-
ECFileSystemBackpressureConfig–Validated EMA backpressure settings for filesystem stores.
-
ECFileSystemTier–Scheduler-facing contract for the optional filesystem tier.
-
ECFileSystemTierConfig–Validated settings for one local encoder-cache filesystem tier.
-
ECFileSystemTierManager–Capacity-bounded LRU index and lifecycle around entry I/O.
-
ECReadResult–Completion reported for one accepted filesystem read.
-
ECTieringConfig–Validated top-level configuration for encoder-cache tiering.
-
ECWriteResult–Completion reported for one accepted filesystem write.
Functions:
-
build_ec_cache_key–Return a filesystem-safe digest for one encoder-cache item.
-
get_ec_entry_path–Map a cache key to a versioned, hash-prefix-sharded raw tensor file.
-
get_ec_namespace_path–Return the versioned directory containing one cache namespace.
-
get_ec_temporary_path–Return a temporary path in the namespace's per-owner staging directory.
ECCacheNamespace
dataclass
¶
Stable factors that determine encoder-output byte compatibility.
The digest excludes process- and request-local identity so compatible model
configurations can reuse files across restarts. Model identity and effective
configuration are captured by encoder_config_hash.
ECFileEntry
dataclass
¶
An entry published in the filesystem tier's in-memory index.
ECFileSystemBackpressureConfig
dataclass
¶
Validated EMA backpressure settings for filesystem stores.
ECFileSystemTier
¶
Bases: Protocol
Scheduler-facing contract for the optional filesystem tier.
Implementations own their worker threads and in-memory entry index. Calls made from the scheduler path must not perform filesystem I/O or wait for an I/O task. The caller keeps submitted buffers alive until the matching completion is returned by a poll method.
Methods:
-
contains–Return an in-memory membership decision without filesystem I/O.
-
poll_completed_reads–Drain currently available read completions without blocking.
-
poll_completed_writes–Drain currently available write completions without blocking.
-
shutdown–Stop accepting work and release resources owned by the tier.
-
submit_read–Queue a filesystem-to-CPU read without blocking.
-
submit_write–Queue a CPU-to-filesystem write without blocking.
contains(cache_key)
¶
Return an in-memory membership decision without filesystem I/O.
poll_completed_reads()
¶
Drain currently available read completions without blocking.
poll_completed_writes()
¶
Drain currently available write completions without blocking.
shutdown()
¶
Stop accepting work and release resources owned by the tier.
submit_read(cache_key, destinations)
¶
Queue a filesystem-to-CPU read without blocking.
Return False when the tier is no longer accepting work. On
acceptance, exactly one completion must eventually be returned by
poll_completed_reads.
submit_write(cache_key, sources, file_size_bytes)
¶
Queue a CPU-to-filesystem write without blocking.
file_size_bytes is the allocated size of all complete CPU blocks.
The sources must contain every byte of every block, including undefined
padding in the final block. On acceptance, exactly one completion must
eventually be returned by poll_completed_writes. Return
False when the tier is no longer accepting work or store pressure
policy, capacity, or same-key lifecycle state skips this cache
opportunity.
ECFileSystemTierConfig
dataclass
¶
Validated settings for one local encoder-cache filesystem tier.
ECFileSystemTierManager
¶
Capacity-bounded LRU index and lifecycle around entry I/O.
Methods:
-
contains–Return an in-memory membership decision without filesystem I/O.
-
drain–Wait for accepted I/O and retain its results for later polling.
-
io_stats–Return the executor's current non-blocking pressure snapshot.
-
lookup–Use indexed entries immediately; probe unknown files asynchronously.
-
poll_completed_reads–Drain currently available read completions without blocking.
-
poll_completed_writes–Drain currently available write completions without blocking.
-
shutdown–Stop submission, drain accepted I/O, and stop the executor.
-
submit_read–Submit a read for an indexed entry without filesystem work here.
-
submit_write–Submit a write; publish it in memory only after completion.
Attributes:
-
capacity_bytes(int) –Return the configured filesystem capacity.
-
used_bytes(int) –Return indexed bytes, write reservations and unconfirmed deletions.
capacity_bytes
property
¶
Return the configured filesystem capacity.
used_bytes
property
¶
Return indexed bytes, write reservations and unconfirmed deletions.
contains(cache_key)
¶
Return an in-memory membership decision without filesystem I/O.
drain()
¶
Wait for accepted I/O and retain its results for later polling.
io_stats()
¶
Return the executor's current non-blocking pressure snapshot.
lookup(cache_key, file_size_bytes, request_id)
¶
Use indexed entries immediately; probe unknown files asynchronously.
poll_completed_reads()
¶
Drain currently available read completions without blocking.
poll_completed_writes()
¶
Drain currently available write completions without blocking.
shutdown()
¶
Stop submission, drain accepted I/O, and stop the executor.
submit_read(cache_key, destinations)
¶
Submit a read for an indexed entry without filesystem work here.
submit_write(cache_key, sources, file_size_bytes)
¶
Submit a write; publish it in memory only after completion.
ECReadResult
dataclass
¶
Completion reported for one accepted filesystem read.
ECTieringConfig
dataclass
¶
Validated top-level configuration for encoder-cache tiering.
Methods:
-
from_vllm_config–Build tiering configuration from vLLM EC connector settings.
Attributes:
-
filesystem_enabled(bool) –Return whether a filesystem secondary tier is configured.
ECWriteResult
dataclass
¶
Completion reported for one accepted filesystem write.
build_ec_cache_key(namespace_digest, identifier, modality, num_tokens, file_size_bytes)
¶
Return a filesystem-safe digest for one encoder-cache item.
get_ec_entry_path(root_dir, namespace_digest, cache_key)
¶
Map a cache key to a versioned, hash-prefix-sharded raw tensor file.
get_ec_namespace_path(root_dir, namespace_digest)
¶
Return the versioned directory containing one cache namespace.
get_ec_temporary_path(entry_path, operation_token, owner_id)
¶
Return a temporary path in the namespace's per-owner staging directory.