[Refactor][kv_offload]: rename block→chunk (#52615)
Signed-off-by: Ronen Schaffer <ronen.schaffer@ibm.com>
This commit is contained in:
@@ -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]):
|
||||
|
||||
Reference in New Issue
Block a user