File tree Expand file tree Collapse file tree 15 files changed +33
-81
lines changed
shim_et/xplat/executorch/build Expand file tree Collapse file tree 15 files changed +33
-81
lines changed Original file line number Diff line number Diff line change 28
28
[submodule "backends/xnnpack/third-party/pthreadpool "]
29
29
path = backends/xnnpack/third-party/pthreadpool
30
30
url = https://github.com/Maratyszcza/pthreadpool.git
31
- [submodule "extension/llm/third-party/abseil-cpp "]
32
- path = extension/llm/third-party/abseil-cpp
33
- url = https://github.com/abseil/abseil-cpp.git
34
- [submodule "extension/llm/third-party/re2 "]
35
- path = extension/llm/third-party/re2
36
- url = https://github.com/google/re2.git
37
- [submodule "extension/llm/third-party/sentencepiece "]
38
- path = extension/llm/third-party/sentencepiece
39
- url = https://github.com/google/sentencepiece.git
31
+ [submodule "extension/llm/tokenizers "]
32
+ path = extension/llm/tokenizers
33
+ url = https://github.com/pytorch-labs/tokenizers.git
40
34
[submodule "kernels/optimized/third-party/eigen "]
41
35
path = kernels/optimized/third-party/eigen
42
36
url = https://gitlab.com/libeigen/eigen.git
Original file line number Diff line number Diff line change @@ -122,17 +122,17 @@ if(${ANDROID})
122
122
)
123
123
# Build ABSL and RE2
124
124
set (EXTENSIONS_LLM_DIR ${CMAKE_CURRENT_SOURCE_DIR} /../../extension/llm )
125
- set (THIRD_PARTY_ABSL_DIR ${EXTENSIONS_LLM_DIR} /third-party/abseil-cpp )
126
- set (THIRD_PARTY_RE2_DIR ${EXTENSIONS_LLM_DIR} /third-party/re2 )
125
+ set (THIRD_PARTY_ABSL_DIR ${EXTENSIONS_LLM_DIR} /tokenizers/ third-party/abseil-cpp )
126
+ set (THIRD_PARTY_RE2_DIR ${EXTENSIONS_LLM_DIR} /tokenizers/ third-party/re2 )
127
127
set (ABSL_ENABLE_INSTALL ON )
128
128
set (ABSL_PROPAGATE_CXX_STD ON )
129
129
set (_pic_flag ${CMAKE_POSITION_INDEPENDENT_CODE} )
130
130
set (CMAKE_POSITION_INDEPENDENT_CODE ON )
131
131
add_subdirectory (
132
- ${THIRD_PARTY_ABSL_DIR} ${CMAKE_CURRENT_BINARY_DIR} /third-party/abseil
132
+ ${THIRD_PARTY_ABSL_DIR} ${CMAKE_CURRENT_BINARY_DIR} /tokenizers/ third-party/abseil
133
133
)
134
134
add_subdirectory (
135
- ${THIRD_PARTY_RE2_DIR} ${CMAKE_CURRENT_BINARY_DIR} /third-party/re2
135
+ ${THIRD_PARTY_RE2_DIR} ${CMAKE_CURRENT_BINARY_DIR} /tokenizers/ third-party/re2
136
136
)
137
137
set (CMAKE_POSITION_INDEPENDENT_CODE ${_pic_flag} )
138
138
Original file line number Diff line number Diff line change @@ -66,11 +66,11 @@ set(ABSL_PROPAGATE_CXX_STD ON)
66
66
set (_pic_flag ${CMAKE_POSITION_INDEPENDENT_CODE} )
67
67
set (CMAKE_POSITION_INDEPENDENT_CODE ON )
68
68
add_subdirectory (
69
- ${EXECUTORCH_ROOT} /extension/llm/third-party/abseil-cpp
69
+ ${EXECUTORCH_ROOT} /extension/llm/tokenizers/ third-party/abseil-cpp
70
70
${CMAKE_CURRENT_BINARY_DIR} /abseil-cpp
71
71
)
72
72
add_subdirectory (
73
- ${EXECUTORCH_ROOT} /extension/llm/third-party/re2
73
+ ${EXECUTORCH_ROOT} /extension/llm/tokenizers/ third-party/re2
74
74
${CMAKE_CURRENT_BINARY_DIR} /re2
75
75
)
76
76
set (CMAKE_POSITION_INDEPENDENT_CODE ${_pic_flag} )
@@ -82,6 +82,8 @@ set(llama_runner_deps executorch extension_data_loader extension_module
82
82
target_link_libraries (llama_runner PUBLIC ${llama_runner_deps} )
83
83
84
84
target_include_directories (
85
- llama_runner INTERFACE ${_common_include_directories} ${EXECUTORCH_ROOT}
85
+ llama_runner
86
+ INTERFACE ${_common_include_directories} ${EXECUTORCH_ROOT}
87
+ ${EXECUTORCH_ROOT} /extension/llm/tokenizers/include
86
88
)
87
89
target_compile_options (llama_runner PUBLIC ${_preprocessor_flag} )
Original file line number Diff line number Diff line change 10
10
11
11
namespace example {
12
12
13
- using ::executorch::extension::llm ::Tiktoken;
13
+ using ::tokenizers ::Tiktoken;
14
14
15
15
namespace {
16
16
static constexpr int32_t kSpecialTokensSize = 256 ;
Original file line number Diff line number Diff line change 8
8
9
9
#pragma once
10
10
11
- #include < executorch/extension/llm/tokenizer /tiktoken.h>
11
+ #include < pytorch/tokenizers /tiktoken.h>
12
12
13
13
namespace example {
14
14
@@ -17,7 +17,7 @@ enum class Version {
17
17
Multimodal,
18
18
};
19
19
20
- std::unique_ptr<::executorch::extension::llm ::Tiktoken> get_tiktoken_for_llama (
20
+ std::unique_ptr<::tokenizers ::Tiktoken> get_tiktoken_for_llama (
21
21
Version version = Version::Default);
22
22
23
23
} // namespace example
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ def define_common_targets():
15
15
"llama_tiktoken.h" ,
16
16
],
17
17
exported_deps = [
18
- "//executorch/extension/llm/tokenizer :tiktoken" ,
18
+ "//pytorch/tokenizers :tiktoken" ,
19
19
],
20
20
visibility = [
21
21
"@EXECUTORCH_CLIENTS" ,
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ include(${EXECUTORCH_ROOT}/build/Test.cmake)
19
19
20
20
set (_tokenizer_test_srcs
21
21
test_tiktoken.cpp
22
- ${CMAKE_CURRENT_SOURCE_DIR} /../../../../../extension/llm/tokenizer /tiktoken.cpp
22
+ ${CMAKE_CURRENT_SOURCE_DIR} /../../../../../extension/llm/tokenizers/src /tiktoken.cpp
23
23
${CMAKE_CURRENT_SOURCE_DIR} /../llama_tiktoken.cpp
24
24
)
25
25
@@ -29,11 +29,11 @@ set(ABSL_PROPAGATE_CXX_STD ON)
29
29
set (_pic_flag ${CMAKE_POSITION_INDEPENDENT_CODE} )
30
30
set (CMAKE_POSITION_INDEPENDENT_CODE ON )
31
31
add_subdirectory (
32
- ${CMAKE_CURRENT_SOURCE_DIR} /../../../../../extension/llm/third-party/abseil-cpp
32
+ ${CMAKE_CURRENT_SOURCE_DIR} /../../../../../extension/llm/tokenizers/ third-party/abseil-cpp
33
33
${CMAKE_CURRENT_BINARY_DIR} /abseil-cpp
34
34
)
35
35
add_subdirectory (
36
- ${CMAKE_CURRENT_SOURCE_DIR} /../../../../../extension/llm/third-party/re2
36
+ ${CMAKE_CURRENT_SOURCE_DIR} /../../../../../extension/llm/tokenizers/ third-party/re2
37
37
${CMAKE_CURRENT_BINARY_DIR} /re2
38
38
)
39
39
set (CMAKE_POSITION_INDEPENDENT_CODE ${_pic_flag} )
@@ -43,5 +43,6 @@ target_include_directories(
43
43
tokenizer_test
44
44
PRIVATE
45
45
${CMAKE_INSTALL_PREFIX} /include
46
- ${CMAKE_CURRENT_SOURCE_DIR} /../../../../../extension/llm/third-party/abseil-cpp
46
+ ${CMAKE_CURRENT_SOURCE_DIR} /../../../../../extension/llm/tokenizers/include
47
+ ${CMAKE_CURRENT_SOURCE_DIR} /../../../../../extension/llm/tokenizers/third-party/abseil-cpp
47
48
)
Original file line number Diff line number Diff line change @@ -63,7 +63,10 @@ target_compile_options(
63
63
full_portable_ops_lib INTERFACE -DET_EVENT_TRACER_ENABLED
64
64
)
65
65
target_include_directories (
66
- full_portable_ops_lib PUBLIC ${_common_include_directories}
66
+ full_portable_ops_lib
67
+ PUBLIC
68
+ ${_common_include_directories}
69
+ ${CMAKE_CURRENT_SOURCE_DIR} /../../extension/llm/tokenizers/include
67
70
)
68
71
69
72
# find RE2 for tokenizer
@@ -72,11 +75,11 @@ set(ABSL_PROPAGATE_CXX_STD ON)
72
75
set (_pic_flag ${CMAKE_POSITION_INDEPENDENT_CODE} )
73
76
set (CMAKE_POSITION_INDEPENDENT_CODE ON )
74
77
add_subdirectory (
75
- ${CMAKE_CURRENT_SOURCE_DIR} /../../extension/llm/third-party/abseil-cpp
78
+ ${CMAKE_CURRENT_SOURCE_DIR} /../../extension/llm/tokenizers/ third-party/abseil-cpp
76
79
${CMAKE_CURRENT_BINARY_DIR} /abseil-cpp
77
80
)
78
81
add_subdirectory (
79
- ${CMAKE_CURRENT_SOURCE_DIR} /../../extension/llm/third-party/re2
82
+ ${CMAKE_CURRENT_SOURCE_DIR} /../../extension/llm/tokenizers/ third-party/re2
80
83
${CMAKE_CURRENT_BINARY_DIR} /re2
81
84
)
82
85
set (CMAKE_POSITION_INDEPENDENT_CODE ${_pic_flag} )
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -21,11 +21,11 @@ set(ABSL_PROPAGATE_CXX_STD ON)
21
21
set (_pic_flag ${CMAKE_POSITION_INDEPENDENT_CODE} )
22
22
set (CMAKE_POSITION_INDEPENDENT_CODE ON )
23
23
add_subdirectory (
24
- ${CMAKE_CURRENT_SOURCE_DIR} /../third-party/abseil-cpp
24
+ ${CMAKE_CURRENT_SOURCE_DIR} /../tokenizers/ third-party/abseil-cpp
25
25
${CMAKE_CURRENT_BINARY_DIR} /abseil-cpp
26
26
)
27
27
add_subdirectory (
28
- ${CMAKE_CURRENT_SOURCE_DIR} /../third-party/re2
28
+ ${CMAKE_CURRENT_SOURCE_DIR} /../tokenizers/ third-party/re2
29
29
${CMAKE_CURRENT_BINARY_DIR} /re2
30
30
)
31
31
set (CMAKE_POSITION_INDEPENDENT_CODE ${_pic_flag} )
@@ -35,6 +35,7 @@ add_library(extension_llm_tokenizer ${_extension_llm_tokenizer__srcs})
35
35
target_include_directories (
36
36
extension_llm_tokenizer PUBLIC ${EXECUTORCH_ROOT} /..
37
37
${_common_include_directories}
38
+ ${CMAKE_CURRENT_SOURCE_DIR} /../tokenizers/include
38
39
)
39
40
40
41
target_link_libraries (extension_llm_tokenizer re2::re2 )
@@ -53,7 +54,7 @@ install(
53
54
target_include_directories (
54
55
extension_llm_tokenizer
55
56
PRIVATE ${CMAKE_INSTALL_PREFIX} /include
56
- ${CMAKE_CURRENT_SOURCE_DIR} /../third-party/abseil-cpp
57
+ ${CMAKE_CURRENT_SOURCE_DIR} /../tokenizers/ third-party/abseil-cpp
57
58
)
58
59
59
60
if (BUILD_TESTING )
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ _EXTERNAL_DEPS = {
43
43
"nlohmann_json" : [], # Intentionally not supporting OSS buck build HF tokenizer.
44
44
"prettytable" : "//third-party:prettytable" ,
45
45
"pybind11" : "//third-party:pybind11" ,
46
- "re2" : "//extension/llm/third-party:re2" ,
46
+ "re2" : "//extension/llm/tokenizers/ third-party:re2" ,
47
47
"sentencepiece" : [], # Intentionally not supporting OSS buck build of sentencepiece.
48
48
"sentencepiece-py" : [],
49
49
# Core C++ PyTorch functionality like Tensor and ScalarType.
You can’t perform that action at this time.
0 commit comments