1
1
mirror of https://github.com/OpenVoiceOS/OpenVoiceOS synced 2025-06-05 22:19:21 +02:00

Extend the whole TensorFlow-Lite runtime infrastructure

- TFlite-runtime GPU delegate support
- TFlite-runtime external delegate support
- ARM Compute Library and ARMnn Delegate
- Whisper-TFlite updates.
This commit is contained in:
j1nx
2023-01-25 14:22:22 +01:00
parent 5e277d5e24
commit 876ee82daa
16 changed files with 226 additions and 53 deletions

View File

@@ -16,6 +16,8 @@ config BR2_PACKAGE_TENSORFLOW_LITE
select BR2_PACKAGE_NEON2SSE
select BR2_PACKAGE_RUY
select BR2_PACKAGE_XNNPACK
select BR2_PACKAGE_OPENCL_HEADERS
select BR2_PACKAGE_VULKAN_HEADERS
help
Tensorflow Lite dynamic library and headers: Inference engine to run previously trained machine learning models.

View File

@@ -24,7 +24,9 @@ TENSORFLOW_LITE_DEPENDENCIES += \
libabseil-cpp \
neon2sse \
ruy \
xnnpack
xnnpack \
opencl_headers \
vulkan-headers
TENSORFLOW_LITE_CONF_OPTS = \
-DCMAKE_C_FLAGS="$(TARGET_CFLAGS) -funsafe-math-optimizations \
@@ -50,17 +52,25 @@ TENSORFLOW_LITE_CONF_OPTS = \
-DFlatBuffers_DIR=$(STAGING_DIR)/usr/lib/cmake/flatbuffers \
-DNEON_2_SSE_DIR=$(STAGING_DIR)/usr/lib/cmake/NEON_2_SSE \
-DTFLITE_ENABLE_EXTERNAL_DELEGATE=ON \
-DTFLITE_ENABLE_GPU=OFF \
-DTFLITE_ENABLE_GPU=ON \
-DTFLITE_ENABLE_INSTALL=ON \
-DTFLITE_ENABLE_MMAP=ON \
-DTFLITE_ENABLE_NNAPI=ON \
-DTFLITE_ENABLE_RUY=ON \
-DTFLITE_ENABLE_XNNPACK=ON
TENSORFLOW_LITE_MAKE_OPTS += _pywrap_tensorflow_interpreter_wrapper
TENSORFLOW_LITE_MAKE_OPTS += _pywrap_tensorflow_interpreter_wrapper benchmark_model
TENSORFLOW_LITE_POST_INSTALL_STAGING_HOOKS = TENSORFLOW_LITE_INSTALL_VERSION_HEADER
TENSORFLOW_LITE_POST_INSTALL_TARGET_HOOKS = TENSORFLOW_LITE_INSTALL_TFLITE_RUNTIME
define TENSORFLOW_LITE_INSTALL_VERSION_HEADER
mkdir -p $(STAGING_DIR)/usr/include/tensorflow/core/public
$(INSTALL) -D -m 644 $(@D)/tensorflow/core/public/version.h \
$(STAGING_DIR)/usr/include/tensorflow/core/public/
endef
define TENSORFLOW_LITE_INSTALL_TFLITE_RUNTIME
mkdir -p $(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/tflite_runtime