[Core][KVConnector] Support HMA+NixlConnector (#35758)
Signed-off-by: NickLucche <nlucches@redhat.com>
This commit is contained in:
@@ -84,6 +84,18 @@ class KVCacheBlocks:
|
||||
assert len(self.blocks) == 1, "Only one group is supported"
|
||||
return [block.block_id for block in self.blocks[0] if block.block_hash is None]
|
||||
|
||||
def get_unhashed_block_ids_all_groups(self) -> list[list[int]]:
|
||||
"""Get block_ids of unhashed blocks from KVCacheBlocks instance."""
|
||||
# Skip padding blocks.
|
||||
return [
|
||||
[
|
||||
block.block_id
|
||||
for block in group
|
||||
if block.block_hash is None and not block.is_null
|
||||
]
|
||||
for group in self.blocks
|
||||
]
|
||||
|
||||
def new_empty(self) -> "KVCacheBlocks":
|
||||
"""
|
||||
Creates a new KVCacheBlocks instance with no blocks.
|
||||
|
||||
Reference in New Issue
Block a user