[V1] Fix jump-forward decoding correctness and add tests (follow-up to #36142) - #1
[V1] Fix jump-forward decoding correctness and add tests (follow-up to #36142)#1HelloWorldU wants to merge 0 commit into
Conversation
|
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add 🚀 |
Purpose
This PR builds upon vllm-project#36142 by @FredericOdermatt, addressing correctness issues
identified in the bot reviews and adding test coverage for jump-forward decoding.
Changes
Bug Fixes
1. Fix
pending_ff_tokenscleared globally each stepPreviously, all pending ff_tokens were cleared every schedule step, even for
requests not scheduled in that step (preempted or skipped due to token budget).
Those requests would lose their deterministic tokens permanently, corrupting
continuation state. Fixed by only clearing tokens for requests present in
num_scheduled_tokens.2. Fix missing stop checks after appending ff_tokens
ff_tokens were appended without calling
check_stop, allowing requests to bypassEOS/stop-token/max-token termination. Fixed by checking stop conditions during
ff_token application, consistent with
_update_request_with_outputbehavior.Unit Tests Added
New tests in
tests/v1/core/test_scheduler.py:Updated
tests/v1/core/utils.pyto supportenable_jump_decodingconfig viaproper
StructuredOutputsConfig → VllmConfig → Scheduler.__init__chain.Test Results
pytest tests/v1/core/test_scheduler.py -v -k "jump"
4 passed in 81.48s
Pending / Future Work
find_jump_forward_string()(requires safe FF-string totoken conversion, non-trivial due to token boundary issues)
Acknowledgements
Thanks to @FredericOdermatt for the original implementation, @benchislett for
the thorough review, @mmoskal for the llguidance fast-forward documentation,
and the vLLM team for the excellent v1 architecture.