[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:
huangtingwei
2026-04-15 16:31:18 +08:00
committed by GitHub
co-authored by hzh0425
parent aa78564e1a
commit 3511c2deb4
@@ -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)