vllm.v1.kv_offload.cpu.retention
¶
Classes:
-
RetentionLeases–Applies
cpu.retain/cpu.releaseKV hints as best-effort leases.
RetentionLeases
¶
Applies cpu.retain / cpu.release KV hints as best-effort leases.
A lease raises lease_cnt on its resident chunks; the policy only learns
about 0<->1 transitions. Evicted keys stay in their lease until it is
refreshed, so a re-store while the lease is live is retained again.
Methods:
-
on_chunk_evicted–Drop a chunk that left the cache from the retained set.
-
on_key_inserted–Restore
lease_cnton a re-stored key of a live lease. -
on_new_request–Apply the request's releases now and defer its retains.
-
on_request_finished–Grant the request's deferred retains over its resident
keys.
Attributes:
-
resident_retained(int) –Number of resident chunks covered by a live lease.
resident_retained
property
¶
Number of resident chunks covered by a live lease.
on_chunk_evicted(key)
¶
Drop a chunk that left the cache from the retained set.
The policy removes chunks without touching lease_cnt, and the lease
keeps the key until it is refreshed, so this is the only place that
sees the resident retained set shrink.
on_key_inserted(key, chunk)
¶
Restore lease_cnt on a re-stored key of a live lease.
chunk is still write-pending and not yet in the policy; policies read
chunk.retained once it becomes evictable.
on_new_request(req_context)
¶
Apply the request's releases now and defer its retains.
on_request_finished(req_context, keys)
¶
Grant the request's deferred retains over its resident keys.