-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
[Bugfix] Catch and log invalid token ids in detokenizer #24351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Nick Hill <nhill@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a targeted bugfix to handle a rare OverflowError within the detokenizer. The change correctly isolates the OverflowError, logs the exception with the problematic token ID for future diagnostics, and ensures the system can continue processing by treating the failed token as None. This is a robust and appropriate way to handle an intermittent, hard-to-reproduce issue. The implementation is sound and effectively insulates the system from this specific failure mode.
…#24351) Signed-off-by: Nick Hill <nhill@redhat.com>
…#24351) Signed-off-by: Nick Hill <nhill@redhat.com>
…#24351) Signed-off-by: Nick Hill <nhill@redhat.com>
This is an update to the "workaround" added in vllm-project#24351. That PR insulates against occasional negative token ids that can be produced occasionally, though we still don't know the root cause. With the update to tokenizers 0.22.1, this error manifests as a TypeError rather than an OverflowError, so the patch needs to be updated to account for this. Signed-off-by: Nick Hill <nhill@redhat.com>
…#24351) Signed-off-by: Nick Hill <nhill@redhat.com> Signed-off-by: xuebwang-amd <xuebwang@amd.com>
…#24351) Signed-off-by: Nick Hill <nhill@redhat.com> Signed-off-by: xuebwang-amd <xuebwang@amd.com>
There is a token overflow issue with quantized models that happens occasionally: #21951
The exact cause is not yet clear and it appears to be difficult to reproduce.
This change just insulates against the error, skipping the problem token but still logging the exception. It also prints the token id in question (suspected to be negative) which should help with further diagnosis.