[None][fix] Release stale-range holder after _commit_block in KVCache…#14478
Open
Tabrizian wants to merge 2 commits into
Open
[None][fix] Release stale-range holder after _commit_block in KVCache…#14478Tabrizian wants to merge 2 commits into
Tabrizian wants to merge 2 commits into
Conversation
…ManagerV2
When _commit_block finalizes a block that is already inside stale_range[lc]
for some finite-window lifecycle (e.g. DSv4 DSA / SWA), the freshly assigned
holder (_PageHolder or _SharedPageLock from line 1268 / 1312-1325) was left
in place. _check_sanity then asserted on the precondition of suspend():
/workspaces/tensorrt_llm/.../sampler.../suspend()
-> _kv_cache.py:931 assert self._check_sanity()
-> _kv_cache.py:1531 assert holder is None # for committed stale block
This trips deterministically on DSv4-Pro disagg GEN runs under MAX_UTILIZATION
scheduling: when the V2 scheduler tries to suspend an in-flight request to
make room, the precondition check aborts the worker. The previously-known
release paths (_on_stop_committing, _unlock_stale_blocks) never revisit a
committed-and-already-stale ordinal, so a 'commit-into-stale-range' case
slipped through.
Fix: at the tail of _commit_block, for the committed block, iterate each
non-SSM lifecycle and clear beam_block[lc] when the ordinal lies inside
that lifecycle's stale_range. The committed page itself remains alive in
the radix tree (committed pages are shareable across caches); only this
_KVCache's redundant strong reference is dropped, restoring the
'committed AND stale -> holder is None' invariant.
Validated end-to-end on DSv4-Pro disagg sweep on Lyris GB300 (c=4/8/16/32/64,
DEP8/TEP8): zero _check_sanity AssertionError across ~160k commit-into-stale
events under real traffic.
Signed-off-by: Iman Tabrizian <10105175+tabrizian@users.noreply.github.com>
Member
Author
|
/bot run --disable-fail-fast |
Collaborator
|
PR_Github #50027 [ run ] triggered by Bot. Commit: |
Collaborator
|
PR_Github #50027 [ run ] completed with state
|
Collaborator
|
/bot run --disable-fail-fast |
Collaborator
|
PR_Github #50071 [ run ] triggered by Bot. Commit: |
Collaborator
|
PR_Github #50071 [ run ] completed with state |
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.
…ManagerV2
When _commit_block finalizes a block that is already inside stale_range[lc] for some finite-window lifecycle (e.g. DSv4 DSA / SWA), the freshly assigned holder (_PageHolder or _SharedPageLock from line 1268 / 1312-1325) was left in place. _check_sanity then asserted on the precondition of suspend():
/workspaces/tensorrt_llm/.../sampler.../suspend()
-> _kv_cache.py:931 assert self._check_sanity()
-> _kv_cache.py:1531 assert holder is None # for committed stale block
This trips deterministically on DSv4-Pro disagg GEN runs under MAX_UTILIZATION scheduling: when the V2 scheduler tries to suspend an in-flight request to make room, the precondition check aborts the worker. The previously-known release paths (_on_stop_committing, _unlock_stale_blocks) never revisit a committed-and-already-stale ordinal, so a 'commit-into-stale-range' case slipped through.
Fix: at the tail of _commit_block, for the committed block, iterate each non-SSM lifecycle and clear beam_block[lc] when the ordinal lies inside that lifecycle's stale_range. The committed page itself remains alive in the radix tree (committed pages are shareable across caches); only this _KVCache's redundant strong reference is dropped, restoring the 'committed AND stale -> holder is None' invariant.
Validated end-to-end on DSv4-Pro disagg sweep on Lyris GB300 (c=4/8/16/32/64, DEP8/TEP8): zero _check_sanity AssertionError across ~160k commit-into-stale events under real traffic.
@coderabbitai summary
Description
Test Coverage
PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
If PR introduces API changes, an appropriate PR label is added - either
api-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin the PR title.Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.