[HiCache] Fix memory host free logic when share_indices_with_anchor enabled#22767
[HiCache] Fix memory host free logic when share_indices_with_anchor enabled#22767hzh0425 merged 1 commit intosgl-project:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request simplifies the free method in memory_pool_host.py by removing the logic that mirrored index freeing across multiple pool entries. Feedback indicates that this change makes the documentation for the share_indices_with_anchor flag stale, so the corresponding comments in the PoolEntry dataclass should be updated to maintain accuracy.
| if getattr(entry, "share_indices_with_anchor", False): | ||
| entry.host_pool.free(indices) | ||
| return n | ||
| return self.anchor_entry.host_pool.free(indices) |
There was a problem hiding this comment.
The removal of the mirroring logic in free makes the documentation for share_indices_with_anchor in the PoolEntry dataclass (line 1666) stale and incorrect. It still claims that HostPoolGroup.free mirrors frees to the pool when this flag is enabled. Please update the comment in the PoolEntry definition to reflect that mirroring is no longer performed.
|
/tag-and-rerun-ci |
Co-authored-by: hzh0425 <hzh0425@apache.org>
637f0ed to
ad268c4
Compare
|
/rerun-failed-ci |
2 similar comments
|
/rerun-failed-ci |
|
/rerun-failed-ci |
…nabled (sgl-project#22767) Co-authored-by: hzh0425 <hzh0425@apache.org>
…nabled (sgl-project#22767) Co-authored-by: hzh0425 <hzh0425@apache.org>
…nabled (sgl-project#22767) Co-authored-by: hzh0425 <hzh0425@apache.org>
Motivation
If
share_indices_with_anchoris set totrue, the entry host pool does not require explicitallocorfree. The redundantfreeoperation occurring here causes the memory consumed byfree_slotsto continuously increase.Modifications
Accuracy Tests
Speed Tests and Profiling
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ci