HiCache Storage: generate hash when inserting new nodes (#9053)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user