You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[NPU][EAGLE3] Fix issue when Draft model generates EOS token (openvinotoolkit#3293)
<!-- Keep your pull requests (PRs) as atomic as possible. That increases
the likelihood that an individual PR won't be stuck because of adjacent
problems, merge conflicts, or code review.
Your merged PR is going to appear in the automatically generated release
notes on GitHub. So the clearer the title the better. -->
## Description
**Background**
Eagle3 uses speculative decoding where a draft model generates candidate
tokens that are validated by a target model. During this process, one
critical issue existed:
Sequence State Management: When the draft model generates an `EOS`
token, the `Sampler` immediately marks the sequence as `FINISHED`. This
causes `get_running_sequences()` to return empty, leading to assertion
failures in subsequent iterations if the target model rejects the `EOS`.
**Solution**
1. Restore Running State After Draft `EOS`
When draft model generates `EOS`, explicitly restore sequence to
`RUNNING` state after sampling.
2. Early Termination on Draft `EOS`
Break draft generation loop immediately upon detecting EOS:
<!-- Jira ticket number (e.g., 123). Delete if there's no ticket. -->
[CVS-180738](https://jira.devtools.intel.com/browse/CVS-180738)
## Checklist:
- [x] This PR follows GenAI Contributing guidelines. <!-- Always follow
https://github.com/openvinotoolkit/openvino.genai?tab=contributing-ov-file#contributing.
If there are deviations, explain what and why. -->
- [x] Tests have been updated or added to cover the new code. <!--
Specify exactly which tests were added or updated. If the change isn't
maintenance related, update the tests at
https://github.com/openvinotoolkit/openvino.genai/tree/master/tests or
explain in the description why the tests don't need an update. -->
- [x] This PR fully addresses the ticket. <!--- If not, explain clearly
what is covered and what is not. If follow-up pull requests are needed,
specify in the description. -->
- [x] I have made corresponding changes to the documentation. <!-- Run
github.com/\<username>/openvino.genai/actions/workflows/deploy_gh_pages.yml
on your fork with your branch as a parameter to deploy a test version
with the updated content. Replace this comment with the link to the
built docs. If the documentation is updated in a separate PR, clearly
specify it. -->
0 commit comments