-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
[Bugfix] validate grammar and throw 400 error instead of crashing the engine when xgrammar validation fails #17623
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
[Bugfix] validate grammar and throw 400 error instead of crashing the engine when xgrammar validation fails #17623
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 🚀 |
Signed-off-by: Jason Cheng <[email protected]>
… validation fails Signed-off-by: Jason Cheng <[email protected]>
Signed-off-by: Jason Cheng <[email protected]>
Signed-off-by: Jason Cheng <[email protected]>
0015e0b
to
f8bbc08
Compare
Signed-off-by: Jason Cheng <[email protected]>
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.
Thank you! I'm good with this as long as the added tests pass CI (I will kick off the full run now)
Hi can i get some help on the failing CI jobs? |
Head branch was pushed to by a user without write access
Signed-off-by: Jason Cheng <[email protected]>
Signed-off-by: Jason Cheng <[email protected]>
Signed-off-by: Jason Cheng <[email protected]>
@russellb i have fixed the erroneous test cases, the added CI tests have passed now. |
… engine when xgrammar validation fails (vllm-project#17623) Signed-off-by: Jason Cheng <[email protected]> Co-authored-by: Russell Bryant <[email protected]> Signed-off-by: Mu Huai <[email protected]>
… engine when xgrammar validation fails (vllm-project#17623) Signed-off-by: Jason Cheng <[email protected]> Co-authored-by: Russell Bryant <[email protected]>
… engine when xgrammar validation fails (vllm-project#17623) Signed-off-by: Jason Cheng <[email protected]> Co-authored-by: Russell Bryant <[email protected]> Signed-off-by: Yuqi Zhang <[email protected]>
Note that a very similar issue still exists in 0.9.0.1: #19270 🙏 |
API server crashes when xgrammar receives an invalid grammar when the
guided_decoding_backend
is set toauto
. This can be triggered via an invalid json schema, regex, or EBNF grammar. This is due to the assumption that any validation error raised by xgrammar is due to the unsupported json schema features, and backend is reverted to guidance without further validation checks.The fixes added an additional guidance validation check if the xgrammar validation fails to catch invalid grammar specifications before trying to compile the grammar.
FIX #17248
FIX #17313