[https://nvbugs/6223556][fix] Correct cached_tokens accounting in dis-agg gen-first overlap path#14910
Open
tensorrt-cicd wants to merge 1 commit into
Open
[https://nvbugs/6223556][fix] Correct cached_tokens accounting in dis-agg gen-first overlap path#14910tensorrt-cicd wants to merge 1 commit into
tensorrt-cicd wants to merge 1 commit into
Conversation
Contributor
📝 WalkthroughWalkthroughThis PR modifies the generation-first disaggregation service to correctly adjust usage accounting by rewriting generation response usage from the context response, updates two test configuration files to enable cache reuse features (block and partial reuse), and removes two test waivers to enable previously skipped overlap tests. ChangesDisaggregated generation-first flow improvements
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
xinhe-nv
approved these changes
Jun 4, 2026
…ting In generation-first disaggregated scheduling the context and generation requests run concurrently, so the context worker's usage cannot be propagated to the generation worker through the request (as done in the context-first path). The generation worker then reports the entire transferred prompt as cached, over-reporting cached_tokens. Adopt the context worker's usage on the final response, mirroring the context-first propagation. Also enable KV block reuse in the overlap_gen_first test configs so the cache-reuse usage check is meaningful, and remove the related waivers. Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
38c081a to
953ffd2
Compare
Collaborator
|
/bot run --add-multi-gpu-test --disable-fail-fast |
Collaborator
Author
|
PR_Github #53292 [ run ] triggered by Bot. Commit: |
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.
Summary
cached_tokensas the full prompt length (17) instead of the actual reused KV blocks (prompt_tokens-1 = 16). This causedtest_disaggregated_overlap_gen_firstto fail its cache-reuse usage check.rewrite_usage_response_from_ctx, mirroring the context-first behavior. The test configs were also updated to enable block reuse and partial reuse so the reuse path is exercised, and the corresponding waives were removed since the test now passes.Test plan
Links
Summary by CodeRabbit
Bug Fixes
Tests