Skip to content

Commit ba4efab

Browse files
committed
fix: move FillMask vector allocs into rank-0 block, use PRIVATE for internal CMake dep
1 parent 6958472 commit ba4efab

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

src/turbomind/generation/CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
cmake_minimum_required(VERSION 3.11)
1616

1717
add_library(guided_decoding STATIC guided_decoding.cc)
18-
target_link_libraries(guided_decoding PUBLIC
19-
apply_token_bitmask_inplace_cuda
20-
xgrammar
21-
core)
18+
target_link_libraries(guided_decoding
19+
PUBLIC xgrammar core
20+
PRIVATE apply_token_bitmask_inplace_cuda)
2221
set_property(TARGET guided_decoding PROPERTY POSITION_INDEPENDENT_CODE ON)
2322

2423
add_library(generation STATIC

src/turbomind/generation/guided_decoding.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ void GuidedDecoding::FillMask(int phase, TensorMap& env)
6666
nullptr,
6767
0};
6868

69-
std::vector<xgrammar::GrammarMatcher> active_matchers;
70-
std::vector<int32_t> active_indices;
71-
active_matchers.reserve(gs);
72-
active_indices.reserve(gs);
73-
7469
if (tp_group_->rank() == 0) {
70+
std::vector<xgrammar::GrammarMatcher> active_matchers;
71+
std::vector<int32_t> active_indices;
72+
active_matchers.reserve(gs);
73+
active_indices.reserve(gs);
74+
7575
for (int i = 0; i < gs; ++i) {
7676
if (const auto& m = d.matchers[i]; m && !m->IsTerminated()) {
7777
active_matchers.emplace_back(*m);

0 commit comments

Comments
 (0)