[Fix] hisparse: Keep PD destination host pages until the decode KV release (#45108)

This commit is contained in:
Shuwen Wang
2026-10-22 11:19:21 +08:00
committed by GitHub
parent 8dc7f98005
commit 6929afb528
2 changed files with 61 additions and 6 deletions
+3 -6
View File
@@ -2738,6 +2738,9 @@ class DecodeTransferQueue(DecodeHiCacheTransferMixin):
kv_manager._staging_handler = self.staging_handler
def _release_request(self, decode_req: DecodeRequest) -> None:
# HiSparse host pages are the transfer destination; free them with the KV.
if self.scheduler.enable_hisparse:
self.scheduler.hisparse_coordinator.request_finished(decode_req.req)
if self.enable_host_receive:
discard_kv_cache_backup(decode_req.req, self.tree_cache, "host_pool")
if decode_req.host_staged:
@@ -2813,8 +2816,6 @@ class DecodeTransferQueue(DecodeHiCacheTransferMixin):
[decode_req.req],
decode_req.req.return_logprob,
)
if self.scheduler.enable_hisparse:
self.scheduler.hisparse_coordinator.request_finished(decode_req.req)
requires_host_drain = (
self.enable_host_receive and decode_req.host_staged
)
@@ -2864,10 +2865,6 @@ class DecodeTransferQueue(DecodeHiCacheTransferMixin):
[decode_req.req],
decode_req.req.return_logprob,
)
if self.scheduler.enable_hisparse:
self.scheduler.hisparse_coordinator.request_finished(
decode_req.req
)
self._clean_hicache_prefetch_resources(decode_req)
self._release_request(decode_req)
self._record_transfer_failure(