[BugFix][Speculative Decoding] MTP logprobs path drops enable_pd_reorder and raises TypeError - #8120
Open
Anai-Guo wants to merge 1 commit into
Open
Conversation
…h_index_for_sampler_output Signed-off-by: Anai-Guo <antai12232931@outlook.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.
Motivation
fastdeploy/spec_decode/mtp_cuda.py:303callsrecover_batch_index_for_sampler_outputwith two arguments, but the function requires three:The guard above it is
tensor_parallel_rank == 0 and substep == 0 and sampler_output.logprobs_tensors is not None, so this fires as soon as MTP speculative decoding runs with logprobs requested.The value is already at hand — the very next statement in the same block passes it to the sibling helper:
Every other call site in the repo passes it:
pre_and_post_process.py:389, 420, 574, 624(asmodel_output.enable_pd_reorder) and all five call sites intests/worker/test_recover_batch_index_sampling_mask.py.self.model_inputsis aProposerInputBatch(input_batch.py:774), which setsself.enable_pd_reorderin__init__(L785) and refreshes it from the target batch at L791, so the attribute is always present.Modifications
Pass
self.model_inputs.enable_pd_reorderas the third argument. One line.Verification
No GPU here, so I verified at the signature level: parsed
input_batch.pywithast, rebuiltrecover_batch_index_for_sampler_output'sinspect.Signature, and replayed every call site throughSignature.bind.Before:
After: all ten bind cleanly.
black(25.1.0 config, line-length 119) andruff check --config pyproject.tomlboth report no changes for the touched file.🤖 Generated with Claude Code