Skip to content

Commit 84ee4e7

Browse files
committed
Merge remote-tracking branch 'one/master' into pyproject_draft
2 parents 51763be + 6353034 commit 84ee4e7

File tree

139 files changed

+6327
-2955
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+6327
-2955
lines changed

packaging/SENTENCEPIECE.tar.gz

13.2 MB
Binary file not shown.

packaging/nnfw.spec

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Source1001: CPUINFO.tar.gz
1111
Source1002: EIGEN.tar.gz
1212
Source1003: GEMMLOWP.tar.gz
1313
Source1004: RUY.tar.gz
14+
Source1005: SENTENCEPIECE.tar.gz
1415
Source2001: EXTERNALS_FOR_ODC.tar.gz
1516

1617
%{!?build_type: %define build_type Release}
@@ -96,16 +97,6 @@ Summary: GGMA generative AI framework
9697

9798
%description ggma
9899
GGMA package for on-device generative AI framework
99-
100-
%files ggma
101-
%manifest %{name}.manifest
102-
%defattr(-,root,root,-)
103-
%ifarch arm armv7l armv7hl aarch64 x86_64 %ix86 riscv64
104-
%{_libdir}/ggma/libggma_api.so
105-
%{_libdir}/ggma/libggma_tokenize.so
106-
%{_includedir}/ggma/*
107-
%{_libdir}/pkgconfig/ggma.pc
108-
%endif
109100
%endif # ggma_build
110101

111102
%if %{test_build} == 1
@@ -183,6 +174,10 @@ mkdir ./externals
183174
tar -xf %{SOURCE2001} -C ./externals
184175
%endif # odc_build
185176

177+
%if %{ggma_build} == 1
178+
tar -xf %{SOURCE1005} -C ./runtime/externals
179+
%endif # ggma_build
180+
186181
%build
187182
%ifarch arm armv7l armv7hl aarch64 x86_64 %ix86 riscv64
188183
# nncc build
@@ -331,6 +326,19 @@ install -m 644 %{overlay_path}/lib/libloco*.so %{buildroot}%{_libdir}/nnfw/odc
331326
%endif # arm armv7l armv7hl aarch64 x86_64 %ix86
332327
%endif # odc_build
333328

329+
%if %{ggma_build} == 1
330+
%files ggma
331+
%manifest %{name}.manifest
332+
%defattr(-,root,root,-)
333+
%ifarch arm armv7l armv7hl aarch64 x86_64 %ix86 riscv64
334+
%dir %{_libdir}/ggma
335+
%dir %{_includedir}/ggma
336+
%{_libdir}/ggma/lib*
337+
%{_includedir}/ggma/*
338+
%{_libdir}/pkgconfig/ggma.pc
339+
%endif
340+
%endif # ggma_build
341+
334342
%changelog
335343
* Thu Mar 15 2018 Chunseok Lee <chunseok.lee@samsung.com>
336344
- Initial spec file for nnfw

runtime/ggma/src/tokenize/TokenizerSentencePiece.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,11 @@ size_t SentencePieceTokenizer::tokenize(const char *text, size_t text_len, int32
7676
int bos_id = _processor->bos_id();
7777
size_t bos_offset = 0;
7878

79+
// TODO: Make BOS token prepending configurable
7980
if (bos_id >= 0 && max_tokens > 0)
8081
{
81-
tokens[0] = 1; // Add BOS token
82-
bos_offset = 1; // Start actual tokens from index 1
82+
tokens[0] = bos_id; // Add BOS token
83+
bos_offset = 1; // Start actual tokens from index 1
8384
}
8485

8586
size_t available_space = max_tokens - bos_offset;

runtime/infra/cmake/CfgOptionFlags.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ option(BUILD_RUNTIME_NNAPI_TEST "Build Runtime NN API Generated Test" ON)
2929
option(BUILD_RUNTIME_NNFW_API_TEST "Build Runtime NNFW API Tests" ON)
3030
option(BUILD_TFLITE_RUN "Build tflite_run test driver" ON)
3131
option(BUILD_ONERT_RUN "Build onert_run test driver" ON)
32+
option(BUILD_GGMA_RUN "Build ggma_run test driver" ON)
3233
option(BUILD_ONERT_TRAIN "Build onert_train test driver" ON)
3334
option(BUILD_TFLITE_COMPARATOR_TEST_TOOL "Build testing tool to compare runtime result with TFLite" ON)
3435
option(BUILD_WITH_HDF5 "Build test tool with HDF5 library" ON)

runtime/infra/cmake/options/options_aarch64-tizen.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ option(DOWNLOAD_GTEST "Download Google Test source and build Google Test" OFF)
88
option(ENVVAR_ONERT_CONFIG "Use environment variable for onert configuration" OFF)
99

1010
option(BUILD_XNNPACK "Build XNNPACK" OFF)
11+
12+
option(BUILD_GGMA_API "Build GGMA API for Generative AI" OFF)
13+
option(DOWNLOAD_SENTENCEPIECE "Download SentencePiece source" OFF)
14+
option(BUILD_SENTENCEPIECE "Build SentencePiece library from the source" OFF)

runtime/infra/cmake/options/options_armv7hl-tizen.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ option(DOWNLOAD_GTEST "Download Google Test source and build Google Test" OFF)
88
option(ENVVAR_ONERT_CONFIG "Use environment variable for onert configuration" OFF)
99

1010
option(BUILD_XNNPACK "Build XNNPACK" OFF)
11+
12+
option(BUILD_GGMA_API "Build GGMA API for Generative AI" OFF)
13+
option(DOWNLOAD_SENTENCEPIECE "Download SentencePiece source" OFF)
14+
option(BUILD_SENTENCEPIECE "Build SentencePiece library from the source" OFF)

runtime/infra/cmake/options/options_armv7l-tizen.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,3 @@ option(ENVVAR_ONERT_CONFIG "Use environment variable for onert configuration" OF
99

1010
option(BUILD_XNNPACK "Build XNNPACK" OFF)
1111

12-
option(BUILD_GGMA_API "Build GGMA API for Generative AI" OFF)
13-
option(DOWNLOAD_SENTENCEPIECE "Download SentencePiece source" OFF)
14-
option(BUILD_SENTENCEPIECE "Build SentencePiece library from the source" OFF)

runtime/infra/cmake/options/options_i686-tizen.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,3 @@ option(ENVVAR_ONERT_CONFIG "Use environment variable for onert configuration" OF
88

99
option(BUILD_XNNPACK "Build XNNPACK" OFF)
1010

11-
option(BUILD_GGMA_API "Build GGMA API for Generative AI" OFF)
12-
option(DOWNLOAD_SENTENCEPIECE "Download SentencePiece source" OFF)
13-
option(BUILD_SENTENCEPIECE "Build SentencePiece library from the source" OFF)

runtime/infra/cmake/options/options_x86_64-tizen.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ option(DOWNLOAD_GTEST "Download Google Test source and build Google Test" OFF)
77
option(ENVVAR_ONERT_CONFIG "Use environment variable for onert configuration" OFF)
88

99
option(BUILD_XNNPACK "Build XNNPACK" OFF)
10+
11+
option(BUILD_GGMA_API "Build GGMA API for Generative AI" OFF)
12+
option(DOWNLOAD_SENTENCEPIECE "Download SentencePiece source" OFF)
13+
option(BUILD_SENTENCEPIECE "Build SentencePiece library from the source" OFF)

runtime/infra/cmake/packages/TensorFlowLiteConfig.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,6 @@ if(Flatbuffers_FOUND)
9292
target_link_libraries(tensorflow-lite INTERFACE flatbuffers::flatbuffers)
9393
endif(Flatbuffers_FOUND)
9494

95-
target_link_libraries(tensorflow-lite INTERFACE Threads::Threads)
95+
target_link_libraries(tensorflow-lite INTERFACE Threads::Threads ${CMAKE_DL_LIBS})
9696

9797
set(TensorFlowLite_FOUND TRUE)

0 commit comments

Comments
 (0)