[HiCache] Make host reclamation independent of transfer order (#40512)

This commit is contained in:
paulzhang-tm
2026-09-24 21:03:25 +08:00
committed by GitHub
parent 3177d10ca6
commit 28ec6700da
2 changed files with 69 additions and 3 deletions
@@ -174,7 +174,9 @@ class HostPoolGroup:
self.free(indices, pool=transfer.name)
transfer.host_indices = None
for transfer in transfers:
# Reclaiming one pool can evict another's slots. Keep allocation order
# identical across TP ranks even when transfers come from a Rust HashMap.
for transfer in sorted(transfers, key=lambda transfer: transfer.name):
if transfer.indices_from_pool is not None:
derived_transfers.append(transfer)
continue