-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[None][fix] Scope KVCM warmup capacity constraints to DeepSeek V4 #19213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
yizhang-nv
wants to merge
11
commits into
NVIDIA:main
Choose a base branch
from
yizhang-nv:codex/fix-kvcm-v2-init-warmup-budget
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ef0361a
[None][fix] Respect KVCM V2 initialization and warmup budgets
yizhang-nv 10f389c
[None][test] Preserve full and mixed attention constraint coverage
yizhang-nv 7a24133
[None][fix] Limit initialization floor changes to self attention
yizhang-nv d39cfb0
[None][test] Cover multimodal examples with KVCM V2 budget fix
yizhang-nv 72bfd75
[None][fix] Estimate V2 cache constraints and query warmup capacity
yizhang-nv 8995290
[None][fix] Keep V2 budget fix focused on existing CI failures
yizhang-nv 51c69ff
[None][fix] Restore warmup capacity query after short request allocation
yizhang-nv 3be8a74
[None][test] Cover insufficient CUDA graph warmup capacity
yizhang-nv 4767601
[None][fix] Keep maximum-length warmup constraints specific to DeepSe…
yizhang-nv 28d08c0
[None][test] Keep KVCM constraint test changes minimal
yizhang-nv 8b6febf
[None][fix] Preserve generic context warmup constraints
yizhang-nv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3328,6 +3328,14 @@ def free_warmup_requests() -> None: | |
| max_num_draft_tokens=_kv_draft) | ||
| available_tokens = min(available_tokens, draft_available_tokens) | ||
|
|
||
| if isinstance(kv_cache_manager, KVCacheManagerV2): | ||
| # V2 reserves one generation token beyond the draft/extra tokens. | ||
| available_tokens -= 1 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The draft cache cannot use the target-style clamp: its warmup resizes omit |
||
| minimum_tokens = ENC_DEC_CUDA_GRAPH_DUMMY_TOKEN_NUM if is_enc_dec else 1 | ||
| if available_tokens < minimum_tokens: | ||
| free_warmup_requests() | ||
| return None | ||
|
|
||
|
yizhang-nv marked this conversation as resolved.
|
||
| token_num = max( | ||
| ENC_DEC_CUDA_GRAPH_DUMMY_TOKEN_NUM if is_enc_dec else 1, | ||
| min( | ||
|
|
||
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This clamp starts from total slots and reserves only one minimal page per other row, although short dummies and the optional guard page are already resident. It can overestimate capacity and skip graph capture.