Skip to content

Commit 9532fed

Browse files
authored
[None][infra] Bump xgrammar (#12811)
1 parent 4403635 commit 9532fed

File tree

4 files changed

+29
-5
lines changed

4 files changed

+29
-5
lines changed

3rdparty/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,16 @@ FetchContent_Declare(
108108
SOURCE_SUBDIR
109109
dont-add-this-project-with-add-subdirectory)
110110

111+
set(_patch_file "${CMAKE_CURRENT_SOURCE_DIR}/patches/xgrammar_constexpr.patch")
111112
FetchContent_Declare(
112113
xgrammar
113114
GIT_REPOSITORY https://github.com/mlc-ai/xgrammar
114-
GIT_TAG v0.1.25 # e4e816f5f0fe39f5b1601a17a4552307fa3b70ff
115+
GIT_TAG v0.1.32 # 62e13551b9b63251114894c5ee638564b160dd48
115116
GIT_SHALLOW TRUE
116117
# NOTE: TensorRT-LLM only uses the headers
117118
SOURCE_SUBDIR
118-
dont-add-this-project-with-add-subdirectory)
119+
dont-add-this-project-with-add-subdirectory
120+
PATCH_COMMAND
121+
bash -c "patch -p1 --forward --batch --dry-run -i '${_patch_file}' && \
122+
patch -p1 --forward --batch -i '${_patch_file}' || \
123+
echo 'Patch already applied, skipping.'")
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_;

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ ordered-set
5252
peft
5353
patchelf
5454
einops
55-
flashinfer-python~=0.6.1
55+
flashinfer-python==0.6.4
5656
opencv-python-headless
57-
xgrammar==0.1.25
57+
xgrammar==0.1.32
5858
llguidance==0.7.29
5959
jsonschema
6060
backoff

security_scanning/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ dependencies = [
5555
"patchelf (>=0.17.2.4,<0.18.0.0)",
5656
"einops (>=0.8.2,<0.9.0)",
5757
"flashinfer-python (>=0.6.1,<0.7.0)",
58-
"xgrammar (==0.1.25)",
58+
"xgrammar (==0.1.32)",
5959
"llguidance (==0.7.29)",
6060
"jsonschema (>=4.26.0,<5.0.0)",
6161
"backoff (>=2.2.1,<3.0.0)",

0 commit comments

Comments
 (0)