Skip to content

Commit b2c640e

Browse files
authored
Some minor fix in cmakelists (#4185)
* fix: upgrade cmake_minimum_required to 3.11 * fix: upgrade xgrammar and only use gold linker in linux * fix: remove unused properties
1 parent a34db18 commit b2c640e

File tree

14 files changed

+22
-71
lines changed

14 files changed

+22
-71
lines changed

CMakeLists.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ FetchContent_MakeAvailable(yaml-cpp)
8383
FetchContent_Declare(
8484
xgrammar
8585
GIT_REPOSITORY https://github.com/mlc-ai/xgrammar.git
86-
GIT_TAG v0.1.25
86+
GIT_TAG v0.1.27
8787
GIT_SUBMODULES "3rdparty/dlpack"
8888
GIT_PROGRESS TRUE
8989
USES_TERMINAL_DOWNLOAD TRUE
@@ -162,8 +162,15 @@ endif()
162162

163163
set(CXX_STD "17" CACHE STRING "C++ standard")
164164
# enable gold linker for binary and .so
165-
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
166-
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=gold")
165+
if(NOT MSVC)
166+
find_program(GOLD_PATH ld.gold REQUIRED)
167+
if(NOT GOLD_PATH)
168+
message(FATAL_ERROR "GNU gold linker is required but not found. "
169+
"Please install binutils-gold package.")
170+
endif()
171+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
172+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fuse-ld=gold")
173+
endif()
167174
set(CUDA_PATH ${CUDA_TOOLKIT_ROOT_DIR})
168175

169176
set(CUSPARSELT_PATH "" CACHE STRING "cuSPARSELt path")

lmdeploy/turbomind/tokenizer_info.py

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -285,59 +285,3 @@ def from_huggingface(
285285
else:
286286
# TODO(yixin): unsupported tokenizer
287287
raise ValueError(f'Unsupported tokenizer type: {type(tokenizer)}')
288-
289-
@property
290-
def vocab_type(self) -> VocabType:
291-
"""The type of the vocabulary."""
292-
return VocabType(self._handle.vocab_type)
293-
294-
@property
295-
def vocab_size(self) -> int:
296-
"""The size of the vocabulary."""
297-
return self._handle.vocab_size
298-
299-
@property
300-
def add_prefix_space(self) -> bool:
301-
"""Whether the tokenizer will prepend a space before the text in the
302-
tokenization process."""
303-
return self._handle.add_prefix_space
304-
305-
@property
306-
def prepend_space_in_tokenization(self) -> bool:
307-
"""Whether the tokenizer will prepend a space before the text in the
308-
tokenization process.
309-
310-
This property is deprecated. Use add_prefix_space instead.
311-
"""
312-
logger.warning('prepend_space_in_tokenization is deprecated. Use add_prefix_space instead.')
313-
return self.add_prefix_space
314-
315-
@property
316-
def decoded_vocab(self) -> List[bytes]:
317-
"""The decoded vocabulary of the tokenizer.
318-
319-
This converts the tokens in the LLM's vocabulary back to the original format of the input text. E.g. for type
320-
ByteFallback, the token <0x1B> is converted back to "\u001b".
321-
"""
322-
return self._handle.decoded_vocab
323-
324-
@property
325-
def stop_token_ids(self) -> List[int]:
326-
"""The stop token ids."""
327-
return self._handle.stop_token_ids
328-
329-
@property
330-
def special_token_ids(self) -> List[int]:
331-
"""The special token ids.
332-
333-
Special tokens include control tokens, reserved tokens, padded tokens, etc. Now it is automatically detected
334-
from the vocabulary.
335-
"""
336-
return self._handle.special_token_ids
337-
338-
def dump_metadata(self) -> str:
339-
"""Dump the metadata of the tokenizer to a json string.
340-
341-
It can be used to construct the tokenizer info from the vocabulary and the metadata string.
342-
"""
343-
return self._handle.dump_metadata()

src/turbomind/comm/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright (c) OpenMMLab. All rights reserved.
22

3-
cmake_minimum_required(VERSION 3.8)
3+
cmake_minimum_required(VERSION 3.11)
44

55
find_package(Threads)
66

src/turbomind/comm/cuda_ipc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright (c) OpenMMLab. All rights reserved.
22

3-
cmake_minimum_required(VERSION 3.8)
3+
cmake_minimum_required(VERSION 3.11)
44

55
add_library(cuda_ipc_comm STATIC
66
cuda_ipc_comm.cu

src/turbomind/comm/nccl/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright (c) OpenMMLab. All rights reserved.
22

3-
cmake_minimum_required(VERSION 3.8)
3+
cmake_minimum_required(VERSION 3.11)
44

55
add_library(nccl_comm STATIC nccl.cu)
66
target_link_libraries(nccl_comm PRIVATE rms_norm core ${NCCL_LIBRARIES} logger)

src/turbomind/core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright (c) OpenMMLab. All rights reserved.
22

3-
cmake_minimum_required(VERSION 3.8)
3+
cmake_minimum_required(VERSION 3.11)
44

55
add_library(core STATIC
66
check.cc

src/turbomind/engine/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright (c) OpenMMLab. All rights reserved.
22

3-
cmake_minimum_required(VERSION 3.8)
3+
cmake_minimum_required(VERSION 3.11)
44

55
add_library(engine STATIC gateway.cc request_queue.cc model_request.cc)
66
target_link_libraries(engine PRIVATE core xgrammar)

src/turbomind/kernels/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
cmake_minimum_required(VERSION 3.8)
15+
cmake_minimum_required(VERSION 3.11)
1616

1717
add_library(ban_bad_words STATIC ban_bad_words.cu)
1818
set_property(TARGET ban_bad_words PROPERTY POSITION_INDEPENDENT_CODE ON)

src/turbomind/layers/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
cmake_minimum_required(VERSION 3.8)
15+
cmake_minimum_required(VERSION 3.11)
1616

1717
add_subdirectory(sampling_layers)
1818

src/turbomind/layers/sampling_layers/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
cmake_minimum_required(VERSION 3.8)
15+
cmake_minimum_required(VERSION 3.11)
1616

1717
find_package(CUDAToolkit REQUIRED)
1818

0 commit comments

Comments
 (0)