vllm.v1.kv_offload.tiering.spec
¶
TieringOffloadingSpec: Spec for multi-tier KV cache offloading.
This spec creates a TieringOffloadingManager with a CPU primary tier and configurable secondary tiers (e.g., Storage, Network).
Configuration via kv_connector_extra_config
- cpu_bytes_to_use: (required) Bytes to allocate for CPU primary tier
- block_size: (optional) Tokens per offloaded chunk (default: GPU block size)
- eviction_policy: (optional) Primary tier eviction policy: built-in "lru"/ "arc", or the name of a policy registered via CachePolicyFactory, or an out-of-tree CachePolicy class name paired with cache_policy_module_path (default: "lru")
- cache_policy_module_path: (optional) Python import path to load eviction_policy from when it names an out-of-tree CachePolicy not registered via CachePolicyFactory
- secondary_tiers: (optional) List of secondary tier configurations
Each secondary tier config is a dict with:
- type: (required) Type of secondary tier (e.g., "example", "fs", "p2p", "obj"), or the class name of an out-of-tree SecondaryTierManager paired with module_path.
- module_path: (optional) Python import path to load 'type' from when it names an out-of-tree SecondaryTierManager not registered via SecondaryTierFactory.register_tier()
- Additional tier-specific parameters are passed directly to the tier constructor. See each tier's documentation for supported parameters.
Example configuration: { "cpu_bytes_to_use": 10737418240, # 10 GB "block_size": 16, "eviction_policy": "lru", "secondary_tiers": [ { "type": "example", "custom_param": 67 } ] }
Example out-of-tree tier configuration: { "cpu_bytes_to_use": 10737418240, "secondary_tiers": [ { "type": "MyCustomTier", "module_path": "my_package.my_module", "custom_param": "value" } ] }
Classes:
-
TieringOffloadingSpec–Spec for multi-tier KV cache offloading.
TieringOffloadingSpec
¶
Bases: CPUOffloadingSpec
Spec for multi-tier KV cache offloading.
Creates a TieringOffloadingManager with: - Primary tier: CPU (LRU or ARC eviction policy) - Secondary tiers: Configurable via extra_config
The CPU primary tier has direct GPU access and serves as the gateway for all GPU↔offload operations. Secondary tiers cannot directly access GPU memory and must transfer data through the primary tier.
Methods:
-
config_info_keys–Return TIER_LABEL and the label names of all tiers, with no repeat.
-
get_manager–Get the TieringOffloadingManager.
_get_secondary_tiers(extra_config)
classmethod
¶
Resolve every configured secondary tier to its manager class.
Parameters:
Returns:
-
list[tuple[dict[str, Any], type[SecondaryTierManager]]]–One (tier config, tier class) pair for each secondary tier, in
-
list[tuple[dict[str, Any], type[SecondaryTierManager]]]–configuration order. That order sets the tier index.
Raises:
-
ValueError–If secondary_tiers is not a list.
_validate_canonical_refs(kv_caches)
¶
Require a mapping on every ref and record layer portability.
Fails loudly rather than persist direct-layout bytes under a canonical format identity.
config_info_keys(extra_config)
classmethod
¶
Return TIER_LABEL and the label names of all tiers, with no repeat.
get_manager()
¶
Get the TieringOffloadingManager.
Creates a TieringOffloadingManager with: - Primary tier: CPU (LRU or ARC) - Secondary tiers: As configured in extra_config
Returns:
-
OffloadingManager–TieringOffloadingManager instance
_reject_workers_across_nodes()
¶
Reject secondary tiers on an engine whose workers span nodes.
Secondary tiers run in the engine core and read only its node's CPU region, which lacks the slots of workers on other nodes (#54415). An engine's workers form a grid of TP, PP and PCP groups, so they share one node if every such group does. Collective over each group.