Skip to content

Conversation

@russellb
Copy link
Member

PR #14575 delayed initialization of the grammar bitmask until it was
needed to try to fix a problem encountered on TPU systems.
Unfortunately, that change was not sufficient.

We need to delay usage of ALL xgrammar APIs, not just the grammar
initialization. This change implements that. More initialization is now
deferred until the first time a structured output request is received.

Signed-off-by: Russell Bryant [email protected]

@russellb russellb requested a review from mgoin as a code owner March 11, 2025 14:00
@github-actions
Copy link

👋 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 fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

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 ready label to the PR or enable auto-merge.

🚀

Copy link
Collaborator

@NickLucche NickLucche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working on my side (TPU). I also like the fact that you're only initializing when structured output is enabled.

@russellb
Copy link
Member Author

Working on my side (TPU). I also like the fact that you're only initializing when structured output is enabled.

Thank you for the quick testing!

@WoosukKwon WoosukKwon added the ready ONLY add when PR is ready to merge/full CI is needed label Mar 11, 2025
@mergify
Copy link

mergify bot commented Mar 11, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @russellb.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Mar 11, 2025
PR vllm-project#14575 delayed initialization of the grammar bitmask until it was
needed to try to fix a problem encountered on TPU systems.
Unfortunately, that change was not sufficient.

We need to delay usage of ALL xgrammar APIs, not just the grammar
initialization. This change implements that. More initialization is now
deferred until the first time a structured output request is received.

Signed-off-by: Russell Bryant <[email protected]>
@russellb russellb force-pushed the v1-defer-xgrammar-init branch from ae99fc9 to dd05b0f Compare March 11, 2025 17:54
@mergify mergify bot removed the needs-rebase label Mar 11, 2025
@russellb
Copy link
Member Author

rebased to resolve conflicts after #14622 went in

@WoosukKwon WoosukKwon enabled auto-merge (squash) March 11, 2025 18:19
@WoosukKwon WoosukKwon merged commit 61a01b2 into vllm-project:main Mar 11, 2025
30 checks passed
JC1DA pushed a commit to JC1DA/vllm that referenced this pull request Mar 11, 2025
lulmer pushed a commit to lulmer/vllm that referenced this pull request Apr 7, 2025
shreyankg pushed a commit to shreyankg/vllm that referenced this pull request May 3, 2025
RichardoMrMu pushed a commit to RichardoMrMu/vllm that referenced this pull request May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed v1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants