[HiCache] Fix memory host free logic when share_indices_with_anchor enabled (#22767)
Co-authored-by: hzh0425 <hzh0425@apache.org>
This commit is contained in:
@@ -1729,13 +1729,7 @@ class HostPoolGroup:
|
||||
return self.anchor_entry.host_pool.alloc(need_size)
|
||||
|
||||
def free(self, indices: torch.Tensor) -> int:
|
||||
n = self.anchor_entry.host_pool.free(indices)
|
||||
for entry in self.entries:
|
||||
if entry is self.anchor_entry:
|
||||
continue
|
||||
if getattr(entry, "share_indices_with_anchor", False):
|
||||
entry.host_pool.free(indices)
|
||||
return n
|
||||
return self.anchor_entry.host_pool.free(indices)
|
||||
|
||||
def get_data_page(self, index, flat: bool = True):
|
||||
return self.anchor_entry.host_pool.get_data_page(index, flat)
|
||||
|
||||
Reference in New Issue
Block a user