Skip to content

Commit 9fe24db

Browse files
sunnyqggclaude
andauthored
[None][feat] Upgrade xgrammar from 0.1.25 to 0.1.32 (NVIDIA#12016)
Signed-off-by: qgai Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 34a9153 commit 9fe24db

File tree

9 files changed

+79
-124
lines changed

9 files changed

+79
-124
lines changed

3rdparty/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ foreach(DEP_IDX RANGE ${DEP_COUNT_MINUS_ONE})
3030
string(JSON DEP_SOURCE_SUBDIR ERROR_VARIABLE _err GET "${DEP_OBJECT}" "source_subdir")
3131
string(JSON DEP_GIT_SUBMODULES_RECURSE ERROR_VARIABLE _err GET "${DEP_OBJECT}" "git_submodules_recurse")
3232
string(JSON DEP_USE_URL ERROR_VARIABLE _err GET "${DEP_OBJECT}" "use_url")
33+
string(JSON DEP_PATCH_FILE ERROR_VARIABLE _err GET "${DEP_OBJECT}" "patch_file")
3334
# cmake-format: on
3435

3536
# Build FetchContent_Declare arguments
@@ -53,6 +54,19 @@ foreach(DEP_IDX RANGE ${DEP_COUNT_MINUS_ONE})
5354
list(APPEND FETCH_ARGS SOURCE_SUBDIR "${DEP_SOURCE_SUBDIR}")
5455
endif()
5556

57+
if(DEP_PATCH_FILE AND NOT DEP_PATCH_FILE STREQUAL "")
58+
list(
59+
APPEND
60+
FETCH_ARGS
61+
PATCH_COMMAND
62+
patch
63+
-p1
64+
--forward
65+
--batch
66+
-i
67+
"${CMAKE_CURRENT_SOURCE_DIR}/${DEP_PATCH_FILE}")
68+
endif()
69+
5670
FetchContent_Declare(${FETCH_ARGS})
5771

5872
# Special handling: Export deep_ep commit to global property

3rdparty/fetch_content.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,10 @@
9393
{
9494
"name": "xgrammar",
9595
"git_repository": "https://github.com/mlc-ai/xgrammar",
96-
"git_tag": "v0.1.25",
96+
"git_tag": "v0.1.32",
9797
"git_shallow": true,
98-
"source_subdir": "dont-add-this-project-with-add-subdirectory"
98+
"source_subdir": "dont-add-this-project-with-add-subdirectory",
99+
"patch_file": "patches/xgrammar_constexpr.patch"
99100
}
100101
]
101102
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--- a/cpp/grammar_functor.cc
2+
+++ b/cpp/grammar_functor.cc
3+
@@ -1750,11 +1750,11 @@
4+
void Apply(Grammar* grammar);
5+
static std::optional<uint64_t> HashSequence(const Grammar& grammar, int32_t sequence_id);
6+
7+
- static const int16_t kNotEndStateFlag = -0x100;
8+
- static const int16_t kEndStateFlag = -0x200;
9+
- static const int16_t kSelfRecursionFlag = -0x300;
10+
- static const int16_t kSimpleCycleFlag = -0x400;
11+
- static const int16_t kUnKnownFlag = -0x500;
12+
+ static constexpr int16_t kNotEndStateFlag = -0x100;
13+
+ static constexpr int16_t kEndStateFlag = -0x200;
14+
+ static constexpr int16_t kSelfRecursionFlag = -0x300;
15+
+ static constexpr int16_t kSimpleCycleFlag = -0x400;
16+
+ static constexpr int16_t kUnKnownFlag = -0x500;
17+
18+
private:
19+
Grammar* grammar_;

ATTRIBUTIONS-Python.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63471,7 +63471,7 @@ SOFTWARE.
6347163471
- `Homepage`: https://github.com/akshaynagpal/w2n
6347263472

6347363473

63474-
## xgrammar (0.1.25)
63474+
## xgrammar (0.1.32)
6347563475

6347663476
### Licenses
6347763477
License: `Apache 2.0`

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ patchelf
5656
einops
5757
flashinfer-python==0.6.4
5858
opencv-python-headless
59-
xgrammar==0.1.25
59+
xgrammar==0.1.32
6060
llguidance==0.7.29
6161
jsonschema
6262
backoff

scripts/attribution/data/dependency_metadata.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ ucx/1.20:
9090
ucxx/16eaa57c8d98c8ef54d666a2d2b11e76cfa565f5:
9191
license: 759cb066f14805ef4068f633d9071e1d
9292
source: https://github.com/rapidsai/ucxx/tree/16eaa57c8d98c8ef54d666a2d2b11e76cfa565f5
93-
xgrammar/v0.1.25:
93+
xgrammar/v0.1.32:
9494
copyright: 989a9441d689f61fba9f797cc253e51b
9595
license: 8e1c96809a7467593130ecc62ae12be9
9696
zeromq/4.3.4-3.el8:

scripts/attribution/data/files_to_dependency.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7507,7 +7507,7 @@ ucxx/16eaa57c8d98c8ef54d666a2d2b11e76cfa565f5:
75077507
- cb11c17f716ae644b2d74652d3d3232b
75087508
- e10a9fefe2ef09b9560cc204bd54f728
75097509
- f75f9c7cefa54d6626032daa93ef2549
7510-
xgrammar/v0.1.25:
7510+
xgrammar/v0.1.32:
75117511
- 0e2b512f384e122c3b8243ae00256e06
75127512
- 1a6e20d89e227a29d674e12e18b5e9e7
75137513
- 1acd98aa4050fd0b8cda58d5d4f6ef78

security_scanning/poetry.lock

Lines changed: 38 additions & 117 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

security_scanning/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ dependencies = [
5757
"patchelf (>=0.17.2.4,<0.18.0.0)",
5858
"einops (>=0.8.2,<0.9.0)",
5959
"flashinfer-python (==0.6.4)",
60-
"xgrammar (==0.1.25)",
60+
"xgrammar (==0.1.32)",
6161
"llguidance (==0.7.29)",
6262
"jsonschema (>=4.26.0,<5.0.0)",
6363
"backoff (>=2.2.1,<3.0.0)",

0 commit comments

Comments
 (0)