Skip to content

[HiSparse] Switch to host reads once a request fills its admission window - #59495

Merged
MatthewBonanni merged 2 commits into
fix/hisparse-publish-durable-prefixfrom
perf/hisparse-early-host-reads
Sep 30, 2026
Merged

MatthewBonanni merged 2 commits into
fix/hisparse-publish-durable-prefixfrom
perf/hisparse-early-host-reads

Conversation

@MatthewBonanni

@MatthewBonanni MatthewBonanni commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Stacked on #59494. Optional: #59494 alone fixes the livelock; this avoids the preemptions behind it.

Purpose

Admission caps each request's resident pages at the in-flight window (HiSparseResidentSpec.max_admission_blocks_per_request, derived from max_in_flight_tokens), on the assumption that older pages move to host. At runtime, though, a request keeps its resident pages pinned until free GPU blocks fall below a fixed watermark (a tenth of the pool). A chunked prefill whose next chunk needs more than that outgrows the pool it was admitted into and is preempted, even though its written-back pages could have been released. With #59494 it resumes from host, but the preemption is still wasted work.

Changes

HiSparseCoordinator.update_residency also switches a request to host reads (asks for a hot region, then releases its written-back pages) once its resident pages fill the window admission reserved for it. Runtime then enforces the same assumption admission makes, with no second estimate. HiSparseResidentManager exposes that window as a read-only max_admission_blocks_per_request property; nothing else in vllm/v1/core changes.

Released pages stay readable until the pool reuses them, so a long request that switches early only pays for its hot region.

Test Plan

  • New test_hisparse_prefill_reads_host_once_it_fills_admission_window[4-True, 3-False]: a prefill that fills its admission window requests a hot region while free blocks are still above the watermark; one below it does not.
  • Same H100 engine repro as [Bugfix][HiSparse] Fix a chunked-prefill preemption livelock #59494 (shrunk DeepSeek-V3.2, indexer + 8 resident groups sharing the GPU pool), tests/v1/e2e/general/test_hisparse.py, and HiSparse unit tests (-k hisparse).

Test Result

Repro main #59494 this PR (on #59494)
1×120k prompt, 4000 blocks, 8192-token chunks livelock 35 steps, 1 preemption 32 steps, 0 preemptions
1×120k prompt, 12000 blocks livelock 26 steps, 1 preemption 23 steps, 0 preemptions
2×60k prompts, 4000 blocks livelock 40 steps, 2 preemptions 34 steps, 0 preemptions
3×40k prompts, 6000 blocks 35 steps, 2 preemptions 29 steps, 2 preemptions 24 steps, 0 preemptions
1×120k, 1024-token chunks 126 steps 126 steps 126 steps

AI assistance (Claude Code) was used for the investigation, implementation, tests, and this description.

🤖 Generated with Claude Code

…the pool

A request's resident pages stay pinned until free blocks fall below a
fixed watermark (a tenth of the pool). A chunked prefill whose next chunk
needs more than that exhausts the pool first and is preempted, even though
its written-back pages could have been released.

Also ask for a hot region once the free pool cannot hold the resident pages
the rest of the prompt would pin, so the prefill releases written-back pages
instead of being preempted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@MatthewBonanni
MatthewBonanni marked this pull request as draft September 30, 2026 20:53
Replace the remaining-prompt estimate with the window admission already
reserves per request: a request switches to host reads once its resident
pages fill max_admission_blocks_per_request (the in-flight window, from the
resident spec). Runtime then enforces the assumption admission makes, with
no second estimate and no prompt length passed through update_residency.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Matthew Bonanni <mbonanni@redhat.com>
@MatthewBonanni MatthewBonanni changed the title [HiSparse] Switch a prefill to host reads before its prompt outgrows the pool [HiSparse] Switch to host reads once a request fills its admission window Sep 30, 2026
@MatthewBonanni
MatthewBonanni merged commit 4cafcf6 into main Sep 30, 2026
12 checks passed
@MatthewBonanni

Copy link
Copy Markdown
Member Author

Folded into #59494.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant