[HiCache]bug fix: fixed blank item in host_mem_release_queue (#11005)

Co-authored-by: Zuoyuan Zhang <zuoyuanzhang@ZuoyuandeMacBook-Pro.local>
Co-authored-by: Zhiqiang Xie <xiezhq@stanford.edu>
This commit is contained in:
zhangzuo21
2025-10-01 21:42:37 +08:00
committed by GitHub
parent ac1f2928ae
commit 2e130b7618

View File

@@ -575,9 +575,11 @@ class HiCacheController:
return operation.completed_tokens, operation.hash_value
def append_host_mem_release(self, host_indices: torch.Tensor):
chunks = host_indices.split(self.mem_pool_host.page_size)
for chunk in chunks:
self.host_mem_release_queue.put(chunk)
if host_indices.numel() == 0:
return
pages = host_indices.split(self.mem_pool_host.page_size)
for page in pages:
self.host_mem_release_queue.put(page)
def _page_get_zero_copy(self, operation, hash_values, host_indices):
results = self.storage_backend.batch_get_v1(hash_values, host_indices)