[Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package

Stefan Hager stefan.hager at ginzinger.com
Thu Nov 24 14:06:17 UTC 2022


Hello,

this RFC patch series proposes a way to integrate the Tensorflow-lite runtime (TFLite) into Buildroot.

This first RFC just integrates the TFLite C++ sahred library. 
After a sucessful first integration the next step wuld be to activate the python library for TFlite. 
As a third step i plan to integrate the NPU Backend Driver for TFLite to use accelerated inference on the i.MX8MP NPU (neural processing unit) for C++ an Python. 
All of this currently works locally as a proof of concept for a few users.

The currently used Version of TFLite is 2.8.0 (official) which is proven to work. 

TFlite comes with a bunch of external source dependencies which are downloaded by separate hidden packages and then built by the main TFLite package. 
TFLite needs its own versions of libabseil, eigen and flatbuffers wich may conflict with the Versions provided by Buildroot. 
Since i can not gurantee that TFlite will work with other Versions of this packages i decided to only let TFlite be activated if this packages are not activated in Buildroot. 

Currently TFlite only supports a limited set of processor architectures (ARMV8A: only 64-bit Support no 32-bit (doesn't build); ARMV7A: only 32-bit Support). 
Anyone else may activate further platforms if needed, but testing needs to then be done by them.

How to build a minimal config with TFLite:
===============================================
$ make raspberrypi4_64_defconfig menuconfig
Activate TFLite in menuconfig: Target packages -> Libraries -> [*] tensorflow-lite
$ make tensorflow-lite

I'm hoping for Comments to prepare a first patchset.

Stefan Hager (10):
  tensorflow-lite-abseil-cpp: new package
  tensorflow-lite-clog: new package
  tensorflow-lite-abseil-cpuinfo: new package
  tensorflow-lite-eigen: new package
  tensorflow-lite-farmhash: new package
  tensorflow-lite-fft2d: new package
  tensorflow-lite-flatbuffers: new package
  tensorflow-lite-gemmlowp: new package
  tensorflow-lite-ruy: new package
  tensorflow-lite: new package

 package/Config.in                             |   1 +
 package/tensorflow-lite-abseil-cpp/Config.in  |   5 +
 .../tensorflow-lite-abseil-cpp.hash           |   3 +
 .../tensorflow-lite-abseil-cpp.mk             |  14 ++
 package/tensorflow-lite-clog/Config.in        |   5 +
 .../tensorflow-lite-clog.hash                 |   3 +
 .../tensorflow-lite-clog.mk                   |  14 ++
 package/tensorflow-lite-cpuinfo/Config.in     |   5 +
 .../tensorflow-lite-cpuinfo.hash              |   3 +
 .../tensorflow-lite-cpuinfo.mk                |  14 ++
 package/tensorflow-lite-eigen/Config.in       |   5 +
 .../tensorflow-lite-eigen.hash                |   9 +
 .../tensorflow-lite-eigen.mk                  |  14 ++
 package/tensorflow-lite-farmhash/Config.in    |   5 +
 .../tensorflow-lite-farmhash.hash             |   3 +
 .../tensorflow-lite-farmhash.mk               |  14 ++
 package/tensorflow-lite-fft2d/Config.in       |   5 +
 .../tensorflow-lite-fft2d.hash                |   3 +
 .../tensorflow-lite-fft2d.mk                  |  15 ++
 package/tensorflow-lite-flatbuffers/Config.in |   5 +
 .../tensorflow-lite-flatbuffers.hash          |   3 +
 .../tensorflow-lite-flatbuffers.mk            |  14 ++
 package/tensorflow-lite-gemmlowp/Config.in    |   5 +
 .../tensorflow-lite-gemmlowp.hash             |   3 +
 .../tensorflow-lite-gemmlowp.mk               |  14 ++
 package/tensorflow-lite-ruy/Config.in         |   5 +
 .../tensorflow-lite-ruy.hash                  |   3 +
 .../tensorflow-lite-ruy.mk                    |  14 ++
 ...2sse-since-this-is-only-useful-on-x8.patch |  34 +++
 ...build-a-shared-library-instead-of-st.patch |  55 +++++
 ...build-tflite-with-external-delegates.patch |  59 +++++
 ...epositories-and-git-pull-configurati.patch | 203 +++++++++++++++
 package/tensorflow-lite/Config.in             |  56 +++++
 package/tensorflow-lite/tensorflow-lite.hash  |   3 +
 package/tensorflow-lite/tensorflow-lite.mk    | 232 ++++++++++++++++++
 35 files changed, 848 insertions(+)
 create mode 100644 package/tensorflow-lite-abseil-cpp/Config.in
 create mode 100644 package/tensorflow-lite-abseil-cpp/tensorflow-lite-abseil-cpp.hash
 create mode 100644 package/tensorflow-lite-abseil-cpp/tensorflow-lite-abseil-cpp.mk
 create mode 100644 package/tensorflow-lite-clog/Config.in
 create mode 100644 package/tensorflow-lite-clog/tensorflow-lite-clog.hash
 create mode 100644 package/tensorflow-lite-clog/tensorflow-lite-clog.mk
 create mode 100644 package/tensorflow-lite-cpuinfo/Config.in
 create mode 100644 package/tensorflow-lite-cpuinfo/tensorflow-lite-cpuinfo.hash
 create mode 100644 package/tensorflow-lite-cpuinfo/tensorflow-lite-cpuinfo.mk
 create mode 100644 package/tensorflow-lite-eigen/Config.in
 create mode 100644 package/tensorflow-lite-eigen/tensorflow-lite-eigen.hash
 create mode 100644 package/tensorflow-lite-eigen/tensorflow-lite-eigen.mk
 create mode 100644 package/tensorflow-lite-farmhash/Config.in
 create mode 100644 package/tensorflow-lite-farmhash/tensorflow-lite-farmhash.hash
 create mode 100644 package/tensorflow-lite-farmhash/tensorflow-lite-farmhash.mk
 create mode 100644 package/tensorflow-lite-fft2d/Config.in
 create mode 100644 package/tensorflow-lite-fft2d/tensorflow-lite-fft2d.hash
 create mode 100644 package/tensorflow-lite-fft2d/tensorflow-lite-fft2d.mk
 create mode 100644 package/tensorflow-lite-flatbuffers/Config.in
 create mode 100644 package/tensorflow-lite-flatbuffers/tensorflow-lite-flatbuffers.hash
 create mode 100644 package/tensorflow-lite-flatbuffers/tensorflow-lite-flatbuffers.mk
 create mode 100644 package/tensorflow-lite-gemmlowp/Config.in
 create mode 100644 package/tensorflow-lite-gemmlowp/tensorflow-lite-gemmlowp.hash
 create mode 100644 package/tensorflow-lite-gemmlowp/tensorflow-lite-gemmlowp.mk
 create mode 100644 package/tensorflow-lite-ruy/Config.in
 create mode 100644 package/tensorflow-lite-ruy/tensorflow-lite-ruy.hash
 create mode 100644 package/tensorflow-lite-ruy/tensorflow-lite-ruy.mk
 create mode 100644 package/tensorflow-lite/0001-Deactivated-neon2sse-since-this-is-only-useful-on-x8.patch
 create mode 100644 package/tensorflow-lite/0002-Added-option-to-build-a-shared-library-instead-of-st.patch
 create mode 100644 package/tensorflow-lite/0003-Added-option-to-build-tflite-with-external-delegates.patch
 create mode 100644 package/tensorflow-lite/0004-Removed-source-repositories-and-git-pull-configurati.patch
 create mode 100644 package/tensorflow-lite/Config.in
 create mode 100644 package/tensorflow-lite/tensorflow-lite.hash
 create mode 100644 package/tensorflow-lite/tensorflow-lite.mk

-- 
2.36.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4625 bytes
Desc: not available
URL: <http://lists.buildroot.org/pipermail/buildroot/attachments/20221124/943ebc72/attachment.bin>


More information about the buildroot mailing list