[Refactor][kv_offload]: rename block→chunk (#52615)

Signed-off-by: Ronen Schaffer <ronen.schaffer@ibm.com>
This commit is contained in:
Ronen Schaffer
2026-09-09 17:45:49 +03:00
committed by GitHub
parent 9ffb8cea96
commit 138d137b5b
34 changed files with 933 additions and 916 deletions
+8 -5
View File
@@ -114,17 +114,17 @@ class LookupResult(Enum):
class OffloadPolicy(Enum):
# Offload only newly-computed blocks as they arrive; prefix-hit
# blocks (already offloaded by a prior request) are skipped.
BLOCK_LEVEL = "block_level"
# Offload all blocks for the request, including prefix hits.
# Offload only newly-computed chunks as they arrive; prefix-hit
# chunks (already offloaded by a prior request) are skipped.
CHUNK_LEVEL = "chunk_level"
# Offload all chunks for the request, including prefix hits.
# Used by tiers that need the complete KV context for a request.
REQUEST_LEVEL = "request_level"
@dataclass
class RequestOffloadingContext:
policy: OffloadPolicy = OffloadPolicy.BLOCK_LEVEL
policy: OffloadPolicy = OffloadPolicy.CHUNK_LEVEL
class ScheduleEndContext(NamedTuple):
@@ -400,6 +400,9 @@ class OffloadingManager(ABC):
class BlockIDsLoadStoreSpec(LoadStoreSpec, ABC):
"""
Spec for loading/storing KV blocks from given block numbers.
Subclass semantics differ: GPULoadStoreSpec.block_ids are GPU block
indices; CPULoadStoreSpec.block_ids are CPU cache chunk indices.
"""
def __init__(self, block_ids: list[int]):