Repository navigation
[Frontend] Upgrade XGrammar to 0.2.7 and Rust structural tags to 0.3.0 - #57272
Merged
Merged
Conversation
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Bugen Zhao <i@bugenzhao.com>
BugenZhao
force-pushed
the
bz/python-xgrammar-0.2.7
branch
from
September 17, 2026 03:01
4cb0376 to
155a56b
Compare
BugenZhao
marked this pull request as ready for review
September 17, 2026 03:03
BugenZhao
requested review from
aarnphm,
bbrowning,
chaunceyjiang,
njhill and
sfeng33
as code owners
September 17, 2026 03:03
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Bugen Zhao <i@bugenzhao.com>
abmfy
approved these changes
Sep 17, 2026
abmfy
left a comment
Member
There was a problem hiding this comment.
LGTM! Two non-blocking edge-case notes inline on the K3 KimiK3Xml migration (union-typed argument correlation; the dropped unsafe-enum guard). The upgrade otherwise looks correct.
Member
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Member
Author
|
/ci run |
|
✅ Triggered Buildkite CI #89585 for commit |
ywang96
approved these changes
Sep 18, 2026
Member
Author
|
/ci run |
|
✅ Triggered Buildkite CI #89776 for commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Pin the shared Python frontend/engine dependency to
xgrammar==0.2.7and regenerate the CPU, CUDA, ROCm, and XPU test lockfiles. The CPU lockfile also updatesapache-tvm-ffito satisfy XGrammar's minimum version.Use the upstream
deepseek_v4_1structural-tag builder through the standard builtin route, removing the local wrapper and older-version fallback. This makes V4.1 parameter-schema enforcement consistently available. The CLI parser name remainsdeepseek_v41; serving continues to passreasoning=Falsebecause the engine owns the reasoning boundary. Existing tests cover required/named/strict-auto choices, invalid parameters, and non-strict parallel calls.Upgrade Rust
xgrammar-structural-tagto 0.3.0, which tracks XGrammar 0.2.7. Adapt the local Kimi K3 builder toReasoningMode, preserving its enabled/disabled behavior and handling the new auto mode. Refresh Kimi K3 and HY serialization snapshots for the updated structural-tag format; token and character budgets remain unset.Replace Rust's local DeepSeek V4.1 builder with
Model::DeepSeekV41.builder(), enabling parameter-schema enforcement throughdeepseek_v4_1_xml. Kimi K3 keeps its handwritten typed-argument grammar, including type/value correlation and marker-safe enum handling, alongside its existing channel framing and raw-JSON argument branch.Related to #54497's dependency-upgrade proposal. Its
max_whitespace_cntconfiguration plumbing is separate work. A search of open XGrammar upgrade PRs, 0.2.7 references, and #54497 references found no overlapping implementation. #56408 already added conditional use of the upstream V4.1 builder; this change makes that dependency available consistently and removes the compatibility path.Test Plan
Test Result
any_order, missing/duplicate/invalid parameters, enums, nested references, and integer/null unions. This supplemental harness is outside the repository.git diff --checkpassed.AI assistance: Codex implemented the changes, ran local validation, and prepared the PR for review.