[https://nvbugs/6451032][fix] Reserve extra dflash context slot for dummy requests#16548
Open
amukkara wants to merge 1 commit into
Open
[https://nvbugs/6451032][fix] Reserve extra dflash context slot for dummy requests#16548amukkara wants to merge 1 commit into
amukkara wants to merge 1 commit into
Conversation
amukkara
marked this pull request as ready for review
July 17, 2026 19:03
amukkara
requested review from
BowenFu,
YihuiLu512,
lori-ren,
mlefeb01,
niukuo,
schetlur-nv and
yingguo-trt
July 17, 2026 19:03
Contributor
📝 WalkthroughWalkthroughDFlash speculative decoding now uses an additional dummy slot for unknown request IDs, including warmup and CUDA graph padding. Context-length and K/V buffers accommodate the extra slot, and two DFlash integration test waivers are removed. ChangesDFlash dummy-slot handling
Estimated code review effort: 3 (Moderate) | ~15 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Signed-off-by: Anurag Mukkara <134339030+amukkara@users.noreply.github.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.
Summary by CodeRabbit
Bug Fixes
Tests
Description
Problem: DFlash keeps a per-request context K/V cache indexed by a slot. With cuda graph padding enabled, the padding requests defaulted to slot 0 corrupting whichever real request happened to occupy slot 0. This caused non-deterministic acceptance-length collapse (one request in a batch dropping from ~3.0 to ~0.55) and made
test_dflash_qwen3_5_4bflaky.Solution: Reserve one extra scratch slot for dummy requests.
_ctx_lenand the K/V buffers are now sizedmax_batch + 1, with_dummy_slot = max_batch. Real requests still only draw slots0..max_batch-1.Test Coverage
unittest/_torch/speculative/hw_agnostic/test_dflash.py::test_dflash_qwen3_5_4bIncrease acceptance length threshold in dflash unit tests to catch future regressions early.
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.