-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
[Structured Output][Refactor] Move apply_grammar_bitmask()
method from ModelRunner
to structured output utils
#21999
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
base: main
Are you sure you want to change the base?
Conversation
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 removes a redundant null check for grammar_bitmask
. This is a good code cleanup that improves maintainability by removing unnecessary code. The change is straightforward and relies on the caller performing the null check, as stated in the PR description.
CC: @russellb |
👋 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 🚀 |
if
check for bitmask in model runner to assert
if
check for bitmask in model runner to assert
apply_grammar_bitmask()
method from ModelRunner to StructuredOutputManager
apply_grammar_bitmask()
method from ModelRunner to StructuredOutputManagerapply_grammar_bitmask()
method from ModelRunner
to StructuredOutputManager
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.
The StructuredOutputManager isn't an object used by the model runner right now. How about just making it a utility function somewhere instead of hanging it off of that class? Maybe here https://github.com/vllm-project/vllm/blob/main/vllm/v1/structured_output/utils.py
Thanks for your suggestion! I will modify it later~ |
This pull request has merge conflicts that must be resolved before it can be |
apply_grammar_bitmask()
method from ModelRunner
to StructuredOutputManager
apply_grammar_bitmask()
method from ModelRunner
to structured output utils
5003b64
to
c909e3c
Compare
I'm good with this in general, but it will need to be updated one more time. It's in conflict with |
This pull request has merge conflicts that must be resolved before it can be |
OK, no problem. After these fix PR have been merged, I will update this soon. |
@russellb Hello, all the fix PRs you mentioned have already been merged, and I have rebased on the latest code. 😃 |
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.
lgtm, thanks!
…tput utils Signed-off-by: shen-shanshan <[email protected]>
Head branch was pushed to by a user without write access
Signed-off-by: shen-shanshan <[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.
LGTM
This pull request has merge conflicts that must be resolved before it can be |
Essential Elements of an Effective PR Description Checklist
supported_models.md
andexamples
for a new model.Purpose
Currently, the feature structured output is closely coupled with the
model_runner
, and we need to implement duplicateapply_grammar_bitmask()
method in differentmodel_runner
of each platform, e.g.,gpu_model_runner
,npu_model_runner
. Once there are changes have made in this method, we need to update the method in all kinds ofmodel_runner
to sync these changes.Thus, maybe it's better to move these structured output related code in
model_runner
to thestructured_output
module to make it clearer and more extensible.Test Plan
Test Result
(Optional) Documentation Update