[None][fix] Split draft host cache during estimation - #17585
Draft
zheyuf wants to merge 1 commit into
Draft
Conversation
Signed-off-by: Zheyu Fu <zheyuf@nvidia.com>
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.
@coderabbitai summary
Description
When one-engine speculative decoding creates separate target and draft KV cache managers,
host_cache_sizeis a combined budget. The normal manager-construction path splits that budget by target/draft bytes per token, but the split was nested under thenot estimating_kv_cacheguard.The estimation path still creates both host pools, so each manager temporarily received the full configured host budget. With a 192 GiB per-rank budget at TP8, startup could request up to 3 TiB of host memory on a 2 TiB node before reaching the later, correct split.
This change:
The issue affects host offload with separate speculative draft/target KV managers; non-speculative models, shared-cache paths, and configurations without host cache are unaffected.
Test Coverage
test_estimation_splits_host_budget_before_creating_managersto cover the previously missedbuild_managers(..., estimating_kv_cache=True)lifecycle.python -m pytest -q tests/unittest/_torch/executor/test_kv_cache_budget_split.py: 21 passed in thebranch-m3-2026-08-12nightly environment with this source file overlaid.git diff --checkpass for the modified files.PR Checklist
GitHub Bot Help
To see a list of available CI bot commands, comment
/bot help.