Repository navigation
[HiSparse] Switch to host reads once a request fills its admission window - #59495
Merged
MatthewBonanni merged 2 commits intoSep 30, 2026
Merged
MatthewBonanni merged 2 commits into
MatthewBonanni merged 2 commits into
Conversation
…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>
MatthewBonanni
added this pull request to stack #59496
September 30, 2026 20:45
MatthewBonanni
marked this pull request as ready for review
September 30, 2026 20:47
MatthewBonanni
requested review from
ApostaC,
WoosukKwon,
alexm-redhat,
heheda12345,
ivanium,
njhill,
robertgshaw2-redhat and
ywang96
as code owners
September 30, 2026 20:47
There was a problem hiding this comment.
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
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>
Member
Author
|
Folded into #59494. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Admission caps each request's resident pages at the in-flight window (
HiSparseResidentSpec.max_admission_blocks_per_request, derived frommax_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_residencyalso 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.HiSparseResidentManagerexposes that window as a read-onlymax_admission_blocks_per_requestproperty; nothing else invllm/v1/corechanges.Released pages stay readable until the pool reuses them, so a long request that switches early only pays for its hot region.
Test Plan
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.tests/v1/e2e/general/test_hisparse.py, and HiSparse unit tests (-k hisparse).Test Result
4-Truecase fails on [Bugfix][HiSparse] Fix a chunked-prefill preemption livelock #59494 alone.test_prefix_caching.py: 168 passed (CPU).test_hisparse.py4 passed; HiSparse unit tests 165 passed (plus [Bugfix][HiSparse] Fix a chunked-prefill preemption livelock #59494's updated assertion).AI assistance (Claude Code) was used for the investigation, implementation, tests, and this description.
🤖 Generated with Claude Code