File tree Expand file tree Collapse file tree 4 files changed +29
-5
lines changed
Expand file tree Collapse file tree 4 files changed +29
-5
lines changed Original file line number Diff line number Diff 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" )
111112FetchContent_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.'" )
Original file line number Diff line number Diff line change 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_;
Original file line number Diff line number Diff line change @@ -52,9 +52,9 @@ ordered-set
5252peft
5353patchelf
5454einops
55- flashinfer-python ~= 0.6.1
55+ flashinfer-python == 0.6.4
5656opencv-python-headless
57- xgrammar == 0.1.25
57+ xgrammar == 0.1.32
5858llguidance == 0.7.29
5959jsonschema
6060backoff
Original file line number Diff line number Diff 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)" ,
You can’t perform that action at this time.
0 commit comments