HiCache Storage: generate hash when inserting new nodes (#9053)

This commit is contained in:
Zhiqiang Xie
2025-08-11 14:18:59 -07:00
committed by GitHub
parent f508cd3cb7
commit 9f78f391ae
5 changed files with 37 additions and 44 deletions

View File

@@ -62,6 +62,7 @@ class TreeNode:
self.host_value: Optional[torch.Tensor] = None
# store hash values of each pages
self.hash_value: Optional[List[str]] = None
self.backuped_storage = False
self.id = TreeNode.counter if id is None else id
TreeNode.counter += 1
@@ -74,10 +75,6 @@ class TreeNode:
def backuped(self):
return self.host_value is not None
@property
def backuped_storage(self):
return self.hash_value is not None and len(self.hash_value) > 0
def protect_host(self):
"""Protect the host value from eviction."""
self.host_ref_counter += 1