[TRTLLM-14417][fix] Exclude ADP/cuda-graph dummy requests from speculative-decode acceptance stats#16571
Open
xwang233 wants to merge 1 commit into
Open
Conversation
…e stats The per-iteration speculative-decoding stats loop in _append_iter_stats counted attention-DP (and cuda-graph padding) dummy generation requests as real drafted requests. On a disagg-GEN worker under attention-DP, an idle rank is padded with a *generation* dummy that carries synthetic py_draft_tokens=[1]*k (resource_manager.add_dummy_requests is_gen branch) and is assigned a spec-sampler accepted count, so it entered the AR/AL aggregate as a mostly-rejected drafted request and depressed the reported acceptance rate/length. The parallel speculation-gate loop already filters is_dummy; mirror that here. Signed-off-by: Xiao Wang <24860335+xwang233@users.noreply.github.com>
xwang233
requested review from
Tabrizian,
chienchunhung,
lori-ren and
mikeiovine
July 19, 2026 00:35
Contributor
📝 WalkthroughWalkthroughSpeculative decoding per-iteration statistics now exclude dummy generation requests from draft-token and accepted-token aggregation. ChangesSpeculative decoding metrics
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Collaborator
Author
|
/bot run |
Collaborator
|
PR_Github #60139 [ run ] triggered by Bot. Commit: |
Collaborator
|
PR_Github #60139 [ run ] completed with state
|
Collaborator
Author
|
/bot run --reuse-test |
Collaborator
|
PR_Github #60181 [ 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.
Description
The per-iteration speculative-decoding stats loop in
PyExecutor._append_iter_stats(tensorrt_llm/_torch/pyexecutor/py_executor.py) aggregates acceptance rate (AR) and acceptance length (AL) overscheduled_batch.generation_requestswithout filtering out dummy requests.On a disaggregated-generation worker running under attention-DP (and likewise for cuda-graph padding), an idle rank is padded with a generation dummy request. That dummy carries synthetic
py_draft_tokens = [1] * k(theis_genbranch ofresource_manager.add_dummy_requests) and is assigned a spec-sampler accepted count, so it enters the AR/AL aggregate as a mostly-rejected drafted request. The result is a depressed, misleading reported acceptance rate/length — the more idle-rank dummies an iteration accumulates, the lower the reported AR/AL, even though real model behavior is unchanged.The fix mirrors the filter that already exists in the parallel speculation-gate loop in the same file (
if draft_len <= 0 or request.is_dummy: continue): skip any request whoseis_dummyis set before it contributes to the specdec metric.This is a metrics-only change. It touches only the stats-aggregation loop — not scheduling, forward, sampling, or resource management — so model outputs and throughput are unaffected; only the reported
specDecodingStatsare corrected.Test Coverage
request.is_dummy) already applied in the speculation-gate loop of the same method, so no new code path or public API is introduced.PR Checklist