[Bugfix][HiSparse] Never allocate GPU pages without host backing (#59036)

Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
Co-authored-by: Matthew Bonanni <mbonanni@redhat.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas Wilkinson
2026-09-30 04:13:29 +00:00
committed by GitHub
co-authored by Matthew Bonanni Claude Opus 5.5
parent e006d761a5
commit 90e13fc757
8 changed files with 252 additions and 85 deletions
+6 -3
View File
@@ -660,10 +660,13 @@ class HiSparseCoordinator:
return command
def has_pending_reclamation(self) -> bool:
"""Whether an in-flight spill will free GPU blocks on completion."""
"""Whether an in-flight spill will free GPU or host blocks on completion."""
return any(
pending.page[0] in self.request_states
and self._can_read_from_host(pending.page[0])
pending.host_block.ref_cnt == 1
or (
pending.page[0] in self.request_states
and self._can_read_from_host(pending.page[0])
)
for pending in self.pending_spills.values()
)
+8
View File
@@ -235,6 +235,14 @@ def create_hisparse_layout(
host_num_blocks = host_budget // host_block_stride
if host_num_blocks <= 0:
raise ValueError("HiSparse has no allocatable host blocks.")
# Every computed page needs a host block, so one request at max_model_len
# must fit alongside the pool's null block and a copy-on-write tail.
min_host_blocks = cdiv(vllm_config.model_config.max_model_len, gpu_block_size) + 2
if host_num_blocks < min_host_blocks:
raise ValueError(
f"HiSparse host pool has {host_num_blocks} blocks but max_model_len "
f"needs {min_host_blocks}; increase host_pool_gib."
)
return HiSparseLayout(
source_group=source_group,