* [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package
@ 2022-11-24 14:06 Stefan Hager
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 01/10] tensorflow-lite-abseil-cpp: " Stefan Hager
` (10 more replies)
0 siblings, 11 replies; 19+ messages in thread
From: Stefan Hager @ 2022-11-24 14:06 UTC (permalink / raw)
To: buildroot; +Cc: Stefan Hager, Thomas Petazzoni
[-- Attachment #1.1: Type: text/plain, Size: 6757 bytes --]
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
[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 4625 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Buildroot] [RFC PATCH 01/10] tensorflow-lite-abseil-cpp: new package
2022-11-24 14:06 [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package Stefan Hager
@ 2022-11-24 14:06 ` Stefan Hager
2022-11-24 14:46 ` Thomas Petazzoni via buildroot
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 02/10] tensorflow-lite-clog: " Stefan Hager
` (9 subsequent siblings)
10 siblings, 1 reply; 19+ messages in thread
From: Stefan Hager @ 2022-11-24 14:06 UTC (permalink / raw)
To: buildroot; +Cc: Stefan Hager, Thomas Petazzoni
[-- Attachment #1.1: Type: text/plain, Size: 2668 bytes --]
This package adds external sources required by tensorflow-lite. Nothing is built or installed within this package, but legal info and the source archive is created.
The tensorflow-lite makefile copies the files from this package and uses them for building or to provide headers for the staging folder.
Signed-off-by: Stefan Hager <stefan.hager@ginzinger.com>
---
package/tensorflow-lite-abseil-cpp/Config.in | 5 +++++
.../tensorflow-lite-abseil-cpp.hash | 3 +++
.../tensorflow-lite-abseil-cpp.mk | 14 ++++++++++++++
3 files changed, 22 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
diff --git a/package/tensorflow-lite-abseil-cpp/Config.in b/package/tensorflow-lite-abseil-cpp/Config.in
new file mode 100644
index 0000000000..c2c9813284
--- /dev/null
+++ b/package/tensorflow-lite-abseil-cpp/Config.in
@@ -0,0 +1,5 @@
+# Not user-selectable, it is only needed to be copied
+# into the tensorflow-lite source tree.
+
+config BR2_PACKAGE_TENSORFLOW_LITE_ABSEIL_CPP
+ bool
diff --git a/package/tensorflow-lite-abseil-cpp/tensorflow-lite-abseil-cpp.hash b/package/tensorflow-lite-abseil-cpp/tensorflow-lite-abseil-cpp.hash
new file mode 100644
index 0000000000..e59b06c004
--- /dev/null
+++ b/package/tensorflow-lite-abseil-cpp/tensorflow-lite-abseil-cpp.hash
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 126af9eb1f82606c44df2262394cf28033b956402485321bcacc9175a9de4d2c tensorflow-lite-abseil-cpp-997aaf3a2830-br1.tar.gz
+sha256 c79a7fea0e3cac04cd43f20e7b648e5a0ff8fa5344e644b0ee09ca1162b62747 LICENSE
diff --git a/package/tensorflow-lite-abseil-cpp/tensorflow-lite-abseil-cpp.mk b/package/tensorflow-lite-abseil-cpp/tensorflow-lite-abseil-cpp.mk
new file mode 100644
index 0000000000..6181744fda
--- /dev/null
+++ b/package/tensorflow-lite-abseil-cpp/tensorflow-lite-abseil-cpp.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# tensorflow-lite-abseil-cpp
+#
+################################################################################
+
+TENSORFLOW_LITE_ABSEIL_CPP_SITE_METHOD = git
+TENSORFLOW_LITE_ABSEIL_CPP_SITE = https://github.com/abseil/abseil-cpp
+TENSORFLOW_LITE_ABSEIL_CPP_VERSION = 997aaf3a2830
+TENSORFLOW_LITE_ABSEIL_CPP_LICENSE = Apache-2.0
+TENSORFLOW_LITE_ABSEIL_CPP_LICENSE_FILES = LICENSE
+TENSORFLOW_LITE_ABSEIL_CPP_INSTALL_TARGET = NO
+
+$(eval $(generic-package))
--
2.36.1
[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 4625 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Buildroot] [RFC PATCH 02/10] tensorflow-lite-clog: new package
2022-11-24 14:06 [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package Stefan Hager
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 01/10] tensorflow-lite-abseil-cpp: " Stefan Hager
@ 2022-11-24 14:06 ` Stefan Hager
2022-11-24 14:48 ` Thomas Petazzoni via buildroot
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 03/10] tensorflow-lite-abseil-cpuinfo: " Stefan Hager
` (8 subsequent siblings)
10 siblings, 1 reply; 19+ messages in thread
From: Stefan Hager @ 2022-11-24 14:06 UTC (permalink / raw)
To: buildroot; +Cc: Stefan Hager, Thomas Petazzoni
[-- Attachment #1.1: Type: text/plain, Size: 2510 bytes --]
This package adds external sources required by tensorflow-lite. Nothing is built or installed within this package, but legal info and source archive is created.
The tensorflow-lite makefile copies the files from this package and uses them for building or to provide headers for the staging folder.
Signed-off-by: Stefan Hager <stefan.hager@ginzinger.com>
---
package/tensorflow-lite-clog/Config.in | 5 +++++
.../tensorflow-lite-clog/tensorflow-lite-clog.hash | 3 +++
.../tensorflow-lite-clog/tensorflow-lite-clog.mk | 14 ++++++++++++++
3 files changed, 22 insertions(+)
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
diff --git a/package/tensorflow-lite-clog/Config.in b/package/tensorflow-lite-clog/Config.in
new file mode 100644
index 0000000000..2555a7ad48
--- /dev/null
+++ b/package/tensorflow-lite-clog/Config.in
@@ -0,0 +1,5 @@
+# Not user-selectable, it is only needed to be copied
+# into the tensorflow-lite source tree.
+
+config BR2_PACKAGE_TENSORFLOW_LITE_CLOG
+ bool
diff --git a/package/tensorflow-lite-clog/tensorflow-lite-clog.hash b/package/tensorflow-lite-clog/tensorflow-lite-clog.hash
new file mode 100644
index 0000000000..92dc6d3c43
--- /dev/null
+++ b/package/tensorflow-lite-clog/tensorflow-lite-clog.hash
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 820097a94890b35c6f313a6e8be38dc95c405ca2800f141cdf9ec53ec8c48672 tensorflow-lite-clog-d5e37adf1406-br1.tar.gz
+sha256 68a14c3e79add023eecd83d611e73f05b8bf1d16852efeb7eb4033a96736da9e deps/clog/LICENSE
diff --git a/package/tensorflow-lite-clog/tensorflow-lite-clog.mk b/package/tensorflow-lite-clog/tensorflow-lite-clog.mk
new file mode 100644
index 0000000000..70c650e055
--- /dev/null
+++ b/package/tensorflow-lite-clog/tensorflow-lite-clog.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# tensorflow-lite-clog
+#
+################################################################################
+
+TENSORFLOW_LITE_CLOG_SITE_METHOD = git
+TENSORFLOW_LITE_CLOG_SITE = https://github.com/pytorch/cpuinfo
+TENSORFLOW_LITE_CLOG_VERSION = d5e37adf1406
+TENSORFLOW_LITE_CLOG_LICENSE = BSD-2-Clause
+TENSORFLOW_LITE_CLOG_LICENSE_FILES = deps/clog/LICENSE
+TENSORFLOW_LITE_CLOG_INSTALL_TARGET = NO
+
+$(eval $(generic-package))
--
2.36.1
[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 4625 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Buildroot] [RFC PATCH 03/10] tensorflow-lite-abseil-cpuinfo: new package
2022-11-24 14:06 [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package Stefan Hager
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 01/10] tensorflow-lite-abseil-cpp: " Stefan Hager
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 02/10] tensorflow-lite-clog: " Stefan Hager
@ 2022-11-24 14:06 ` Stefan Hager
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 04/10] tensorflow-lite-eigen: " Stefan Hager
` (7 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: Stefan Hager @ 2022-11-24 14:06 UTC (permalink / raw)
To: buildroot; +Cc: Stefan Hager, Thomas Petazzoni
[-- Attachment #1.1: Type: text/plain, Size: 2581 bytes --]
This package adds external sources required by tensorflow-lite. Nothing is built or installed within this package, but legal info and source archive is created.
The tensorflow-lite makefile copies the files from this package and uses them for building or to provide headers for the staging folder.
Signed-off-by: Stefan Hager <stefan.hager@ginzinger.com>
---
package/tensorflow-lite-cpuinfo/Config.in | 5 +++++
.../tensorflow-lite-cpuinfo.hash | 3 +++
.../tensorflow-lite-cpuinfo.mk | 14 ++++++++++++++
3 files changed, 22 insertions(+)
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
diff --git a/package/tensorflow-lite-cpuinfo/Config.in b/package/tensorflow-lite-cpuinfo/Config.in
new file mode 100644
index 0000000000..59b32a7d63
--- /dev/null
+++ b/package/tensorflow-lite-cpuinfo/Config.in
@@ -0,0 +1,5 @@
+# Not user-selectable, it is only needed to be copied
+# into the tensorflow-lite source tree.
+
+config BR2_PACKAGE_TENSORFLOW_LITE_CPUINFO
+ bool
diff --git a/package/tensorflow-lite-cpuinfo/tensorflow-lite-cpuinfo.hash b/package/tensorflow-lite-cpuinfo/tensorflow-lite-cpuinfo.hash
new file mode 100644
index 0000000000..d1d29ae788
--- /dev/null
+++ b/package/tensorflow-lite-cpuinfo/tensorflow-lite-cpuinfo.hash
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 62398e57c4d71aacd80447f376a0c387278e74f9bf767d24be8860110ac9bee8 tensorflow-lite-cpuinfo-5916273f79a2-br1.tar.gz
+sha256 8e7e60636c3aa0cb03571a1a841ce5697f9551ff92b3c426c2561613d15ade70 LICENSE
diff --git a/package/tensorflow-lite-cpuinfo/tensorflow-lite-cpuinfo.mk b/package/tensorflow-lite-cpuinfo/tensorflow-lite-cpuinfo.mk
new file mode 100644
index 0000000000..a308f13125
--- /dev/null
+++ b/package/tensorflow-lite-cpuinfo/tensorflow-lite-cpuinfo.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# tensorflow-lite-cpuinfo
+#
+################################################################################
+
+TENSORFLOW_LITE_CPUINFO_SITE_METHOD = git
+TENSORFLOW_LITE_CPUINFO_SITE = https://github.com/pytorch/cpuinfo.git
+TENSORFLOW_LITE_CPUINFO_VERSION = 5916273f79a2
+TENSORFLOW_LITE_CPUINFO_LICENSE = BSD-2-Clause
+TENSORFLOW_LITE_CPUINFO_LICENSE_FILES = LICENSE
+TENSORFLOW_LITE_CPUINFO_INSTALL_TARGET = NO
+
+$(eval $(generic-package))
--
2.36.1
[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 4625 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Buildroot] [RFC PATCH 04/10] tensorflow-lite-eigen: new package
2022-11-24 14:06 [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package Stefan Hager
` (2 preceding siblings ...)
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 03/10] tensorflow-lite-abseil-cpuinfo: " Stefan Hager
@ 2022-11-24 14:06 ` Stefan Hager
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 05/10] tensorflow-lite-farmhash: " Stefan Hager
` (6 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: Stefan Hager @ 2022-11-24 14:06 UTC (permalink / raw)
To: buildroot; +Cc: Stefan Hager, Thomas Petazzoni
[-- Attachment #1.1: Type: text/plain, Size: 3181 bytes --]
This package adds external sources required by tensorflow-lite. Nothing is built or installed within this package, but legal info and source archive is created.
The tensorflow-lite makefile copies the files from this package and uses them for building or to provide headers for the staging folder.
Signed-off-by: Stefan Hager <stefan.hager@ginzinger.com>
---
package/tensorflow-lite-eigen/Config.in | 5 +++++
.../tensorflow-lite-eigen.hash | 9 +++++++++
.../tensorflow-lite-eigen/tensorflow-lite-eigen.mk | 14 ++++++++++++++
3 files changed, 28 insertions(+)
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
diff --git a/package/tensorflow-lite-eigen/Config.in b/package/tensorflow-lite-eigen/Config.in
new file mode 100644
index 0000000000..a31fa62d9c
--- /dev/null
+++ b/package/tensorflow-lite-eigen/Config.in
@@ -0,0 +1,5 @@
+# Not user-selectable, it is only needed to be copied
+# into the tensorflow-lite source tree.
+
+config BR2_PACKAGE_TENSORFLOW_LITE_EIGEN
+ bool
diff --git a/package/tensorflow-lite-eigen/tensorflow-lite-eigen.hash b/package/tensorflow-lite-eigen/tensorflow-lite-eigen.hash
new file mode 100644
index 0000000000..08d8749d83
--- /dev/null
+++ b/package/tensorflow-lite-eigen/tensorflow-lite-eigen.hash
@@ -0,0 +1,9 @@
+# Locally computed:
+sha256 20ba1d25d83592bfee4bba200a5aa4bab3feb003ede088d606457ecd31fbcd1e tensorflow-lite-eigen-085c2fc5d53f-br1.tar.gz
+sha256 03379001a7b12a2ec997a25554247d985270b353c10d5bafee9ac8d6519820b7 COPYING.APACHE
+sha256 51928dce36213c5333ba3172e847d735d4c6e9b7ff2722a326c49067155b82eb COPYING.BSD
+sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 COPYING.GPL
+sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING.LGPL
+sha256 c87b7f8ee88f6195e91743820c00354833583aef091b72e2d4a49c8e28e798a0 COPYING.MINPACK
+sha256 fab3dd6bdab226f1c08630b1dd917e11fcb4ec5e1e020e2c16f83a0a13863e85 COPYING.MPL2
+sha256 c83230b770f17ef1386ea1fd3681271dd98aa93646bdbfb5bff3a1b7050fff9d COPYING.README
diff --git a/package/tensorflow-lite-eigen/tensorflow-lite-eigen.mk b/package/tensorflow-lite-eigen/tensorflow-lite-eigen.mk
new file mode 100644
index 0000000000..717663d560
--- /dev/null
+++ b/package/tensorflow-lite-eigen/tensorflow-lite-eigen.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# tensorflow-lite-eigen
+#
+################################################################################
+
+TENSORFLOW_LITE_EIGEN_SITE_METHOD = git
+TENSORFLOW_LITE_EIGEN_SITE = https://gitlab.com/libeigen/eigen.git
+TENSORFLOW_LITE_EIGEN_VERSION = 085c2fc5d53f
+TENSORFLOW_LITE_EIGEN_LICENSE = Manily MPL-2.0 see COPYING.README
+TENSORFLOW_LITE_EIGEN_LICENSE_FILES = COPYING.README COPYING.APACHE COPYING.BSD COPYING.GPL COPYING.LGPL COPYING.MINPACK COPYING.MPL2
+TENSORFLOW_LITE_EIGEN_INSTALL_TARGET = NO
+
+$(eval $(generic-package))
--
2.36.1
[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 4625 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Buildroot] [RFC PATCH 05/10] tensorflow-lite-farmhash: new package
2022-11-24 14:06 [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package Stefan Hager
` (3 preceding siblings ...)
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 04/10] tensorflow-lite-eigen: " Stefan Hager
@ 2022-11-24 14:06 ` Stefan Hager
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 06/10] tensorflow-lite-fft2d: " Stefan Hager
` (5 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: Stefan Hager @ 2022-11-24 14:06 UTC (permalink / raw)
To: buildroot; +Cc: Stefan Hager, Thomas Petazzoni
[-- Attachment #1.1: Type: text/plain, Size: 2597 bytes --]
This package adds external sources required by tensorflow-lite. Nothing is built or installed within this package, but legal info and source archive is created.
The tensorflow-lite makefile copies the files from this package and uses them for building or to provide headers for the staging folder.
Signed-off-by: Stefan Hager <stefan.hager@ginzinger.com>
---
package/tensorflow-lite-farmhash/Config.in | 5 +++++
.../tensorflow-lite-farmhash.hash | 3 +++
.../tensorflow-lite-farmhash.mk | 14 ++++++++++++++
3 files changed, 22 insertions(+)
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
diff --git a/package/tensorflow-lite-farmhash/Config.in b/package/tensorflow-lite-farmhash/Config.in
new file mode 100644
index 0000000000..1a5b24b4b7
--- /dev/null
+++ b/package/tensorflow-lite-farmhash/Config.in
@@ -0,0 +1,5 @@
+# Not user-selectable, it is only needed to be copied
+# into the tensorflow-lite source tree.
+
+config BR2_PACKAGE_TENSORFLOW_LITE_FARMHASH
+ bool
diff --git a/package/tensorflow-lite-farmhash/tensorflow-lite-farmhash.hash b/package/tensorflow-lite-farmhash/tensorflow-lite-farmhash.hash
new file mode 100644
index 0000000000..2082fca269
--- /dev/null
+++ b/package/tensorflow-lite-farmhash/tensorflow-lite-farmhash.hash
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 c7dfabd151ee94fe121dbc7bb2f31c6749a9ffab5e36a3d3765c34a4c75a981e tensorflow-lite-farmhash-0d859a811870-br1.tar.gz
+sha256 4162dd091caae234f72d3b57e138174f733e736b2430a4c51b098b17d866fcb6 COPYING
diff --git a/package/tensorflow-lite-farmhash/tensorflow-lite-farmhash.mk b/package/tensorflow-lite-farmhash/tensorflow-lite-farmhash.mk
new file mode 100644
index 0000000000..90892dcfc1
--- /dev/null
+++ b/package/tensorflow-lite-farmhash/tensorflow-lite-farmhash.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# tensorflow-lite-farmhash
+#
+################################################################################
+
+TENSORFLOW_LITE_FARMHASH_SITE_METHOD = git
+TENSORFLOW_LITE_FARMHASH_SITE = https://github.com/google/farmhash
+TENSORFLOW_LITE_FARMHASH_VERSION = 0d859a811870
+TENSORFLOW_LITE_FARMHASH_LICENSE = MIT
+TENSORFLOW_LITE_FARMHASH_LICENSE_FILES = COPYING
+TENSORFLOW_LITE_FARMHASH_INSTALL_TARGET = NO
+
+$(eval $(generic-package))
--
2.36.1
[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 4625 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Buildroot] [RFC PATCH 06/10] tensorflow-lite-fft2d: new package
2022-11-24 14:06 [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package Stefan Hager
` (4 preceding siblings ...)
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 05/10] tensorflow-lite-farmhash: " Stefan Hager
@ 2022-11-24 14:06 ` Stefan Hager
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 07/10] tensorflow-lite-flatbuffers: " Stefan Hager
` (4 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: Stefan Hager @ 2022-11-24 14:06 UTC (permalink / raw)
To: buildroot; +Cc: Stefan Hager, Thomas Petazzoni
[-- Attachment #1.1: Type: text/plain, Size: 2616 bytes --]
This package adds external sources required by tensorflow-lite. Nothing is built or installed within this package, but legal info and source archive is created.
The tensorflow-lite makefile copies the files from this package and uses them for building or to provide headers for the staging folder.
Signed-off-by: Stefan Hager <stefan.hager@ginzinger.com>
---
package/tensorflow-lite-fft2d/Config.in | 5 +++++
.../tensorflow-lite-fft2d.hash | 3 +++
.../tensorflow-lite-fft2d.mk | 15 +++++++++++++++
3 files changed, 23 insertions(+)
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
diff --git a/package/tensorflow-lite-fft2d/Config.in b/package/tensorflow-lite-fft2d/Config.in
new file mode 100644
index 0000000000..03567e05af
--- /dev/null
+++ b/package/tensorflow-lite-fft2d/Config.in
@@ -0,0 +1,5 @@
+# Not user-selectable, it is only needed to be copied
+# into the tensorflow-lite source tree.
+
+config BR2_PACKAGE_TENSORFLOW_LITE_FFT2D
+ bool
diff --git a/package/tensorflow-lite-fft2d/tensorflow-lite-fft2d.hash b/package/tensorflow-lite-fft2d/tensorflow-lite-fft2d.hash
new file mode 100644
index 0000000000..40588abfb7
--- /dev/null
+++ b/package/tensorflow-lite-fft2d/tensorflow-lite-fft2d.hash
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 5f4dabc2ae21e1f537425d58a49cdca1c49ea11db0d6271e2a4b27e9697548eb v1.0.tar.gz
+sha256 0b2a2082537735a2a576dbec2e8f9c1a09812eac6df6a389502a6ba860072906 readme2d.txt
diff --git a/package/tensorflow-lite-fft2d/tensorflow-lite-fft2d.mk b/package/tensorflow-lite-fft2d/tensorflow-lite-fft2d.mk
new file mode 100644
index 0000000000..cd3f70898b
--- /dev/null
+++ b/package/tensorflow-lite-fft2d/tensorflow-lite-fft2d.mk
@@ -0,0 +1,15 @@
+################################################################################
+#
+# tensorflow-lite-fft2d
+#
+################################################################################
+
+TENSORFLOW_LITE_FFT2D_SITE_METHOD = wget
+TENSORFLOW_LITE_FFT2D_SITE = https://storage.googleapis.com/mirror.tensorflow.org/github.com/petewarden/OouraFFT/archive
+TENSORFLOW_LITE_FFT2D_VERSION = 1.0
+TENSORFLOW_LITE_FFT2D_SOURCE = v$(TENSORFLOW_LITE_FFT2D_VERSION).tar.gz
+TENSORFLOW_LITE_FFT2D_LICENSE = readme2d.txt
+TENSORFLOW_LITE_FFT2D_LICENSE_FILES = readme2d.txt
+TENSORFLOW_LITE_FFT2D_INSTALL_TARGET = NO
+
+$(eval $(generic-package))
--
2.36.1
[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 4625 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Buildroot] [RFC PATCH 07/10] tensorflow-lite-flatbuffers: new package
2022-11-24 14:06 [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package Stefan Hager
` (5 preceding siblings ...)
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 06/10] tensorflow-lite-fft2d: " Stefan Hager
@ 2022-11-24 14:06 ` Stefan Hager
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 08/10] tensorflow-lite-gemmlowp: " Stefan Hager
` (3 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: Stefan Hager @ 2022-11-24 14:06 UTC (permalink / raw)
To: buildroot; +Cc: Stefan Hager, Thomas Petazzoni
[-- Attachment #1.1: Type: text/plain, Size: 2692 bytes --]
This package adds external sources required by tensorflow-lite. Nothing is built or installed within this package, but legal info and source archive is created.
The tensorflow-lite makefile copies the files from this package and uses them for building or to provide headers for the staging folder.
Signed-off-by: Stefan Hager <stefan.hager@ginzinger.com>
---
package/tensorflow-lite-flatbuffers/Config.in | 5 +++++
.../tensorflow-lite-flatbuffers.hash | 3 +++
.../tensorflow-lite-flatbuffers.mk | 14 ++++++++++++++
3 files changed, 22 insertions(+)
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
diff --git a/package/tensorflow-lite-flatbuffers/Config.in b/package/tensorflow-lite-flatbuffers/Config.in
new file mode 100644
index 0000000000..96a68b3533
--- /dev/null
+++ b/package/tensorflow-lite-flatbuffers/Config.in
@@ -0,0 +1,5 @@
+# Not user-selectable, it is only needed to be copied
+# into the tensorflow-lite source tree.
+
+config BR2_PACKAGE_TENSORFLOW_LITE_FLATBUFFERS
+ bool
diff --git a/package/tensorflow-lite-flatbuffers/tensorflow-lite-flatbuffers.hash b/package/tensorflow-lite-flatbuffers/tensorflow-lite-flatbuffers.hash
new file mode 100644
index 0000000000..ec420eb374
--- /dev/null
+++ b/package/tensorflow-lite-flatbuffers/tensorflow-lite-flatbuffers.hash
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 abcd4a485080cd1954a01c923d28e7692a360a0961236e4c4012849f98573809 tensorflow-lite-flatbuffers-v1.12.0-br1.tar.gz
+sha256 cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 LICENSE.txt
diff --git a/package/tensorflow-lite-flatbuffers/tensorflow-lite-flatbuffers.mk b/package/tensorflow-lite-flatbuffers/tensorflow-lite-flatbuffers.mk
new file mode 100644
index 0000000000..a03d19ce88
--- /dev/null
+++ b/package/tensorflow-lite-flatbuffers/tensorflow-lite-flatbuffers.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# tensorflow-lite-flatbuffers
+#
+################################################################################
+
+TENSORFLOW_LITE_FLATBUFFERS_SITE_METHOD = git
+TENSORFLOW_LITE_FLATBUFFERS_SITE = https://github.com/google/flatbuffers
+TENSORFLOW_LITE_FLATBUFFERS_VERSION = v1.12.0
+TENSORFLOW_LITE_FLATBUFFERS_LICENSE = Apache-2.0
+TENSORFLOW_LITE_FLATBUFFERS_LICENSE_FILES = LICENSE.txt
+TENSORFLOW_LITE_FLATBUFFERS_INSTALL_TARGET = NO
+
+$(eval $(generic-package))
--
2.36.1
[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 4625 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Buildroot] [RFC PATCH 08/10] tensorflow-lite-gemmlowp: new package
2022-11-24 14:06 [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package Stefan Hager
` (6 preceding siblings ...)
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 07/10] tensorflow-lite-flatbuffers: " Stefan Hager
@ 2022-11-24 14:06 ` Stefan Hager
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 09/10] tensorflow-lite-ruy: " Stefan Hager
` (2 subsequent siblings)
10 siblings, 0 replies; 19+ messages in thread
From: Stefan Hager @ 2022-11-24 14:06 UTC (permalink / raw)
To: buildroot; +Cc: Stefan Hager, Thomas Petazzoni
[-- Attachment #1.1: Type: text/plain, Size: 2604 bytes --]
This package adds external sources required by tensorflow-lite. Nothing is built or installed within this package, but legal info and source archive is created.
The tensorflow-lite makefile copies the files from this package and uses them for building or to provide headers for the staging folder.
Signed-off-by: Stefan Hager <stefan.hager@ginzinger.com>
---
package/tensorflow-lite-gemmlowp/Config.in | 5 +++++
.../tensorflow-lite-gemmlowp.hash | 3 +++
.../tensorflow-lite-gemmlowp.mk | 14 ++++++++++++++
3 files changed, 22 insertions(+)
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
diff --git a/package/tensorflow-lite-gemmlowp/Config.in b/package/tensorflow-lite-gemmlowp/Config.in
new file mode 100644
index 0000000000..39faaaa81c
--- /dev/null
+++ b/package/tensorflow-lite-gemmlowp/Config.in
@@ -0,0 +1,5 @@
+# Not user-selectable, it is only needed to be copied
+# into the tensorflow-lite source tree.
+
+config BR2_PACKAGE_TENSORFLOW_LITE_GEMMLOWP
+ bool
diff --git a/package/tensorflow-lite-gemmlowp/tensorflow-lite-gemmlowp.hash b/package/tensorflow-lite-gemmlowp/tensorflow-lite-gemmlowp.hash
new file mode 100644
index 0000000000..a4fb70aa86
--- /dev/null
+++ b/package/tensorflow-lite-gemmlowp/tensorflow-lite-gemmlowp.hash
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 aff95de30a16132cccb9c219f6489ddf0014742a558d63c443f609dc7f962576 tensorflow-lite-gemmlowp-fda83bdc38b1-br1.tar.gz
+sha256 cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 LICENSE
diff --git a/package/tensorflow-lite-gemmlowp/tensorflow-lite-gemmlowp.mk b/package/tensorflow-lite-gemmlowp/tensorflow-lite-gemmlowp.mk
new file mode 100644
index 0000000000..29c3846ada
--- /dev/null
+++ b/package/tensorflow-lite-gemmlowp/tensorflow-lite-gemmlowp.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# tensorflow-lite-gemmlowp
+#
+################################################################################
+
+TENSORFLOW_LITE_GEMMLOWP_SITE_METHOD = git
+TENSORFLOW_LITE_GEMMLOWP_SITE = https://github.com/google/gemmlowp
+TENSORFLOW_LITE_GEMMLOWP_VERSION = fda83bdc38b1
+TENSORFLOW_LITE_GEMMLOWP_LICENSE = Apache-2.0
+TENSORFLOW_LITE_GEMMLOWP_LICENSE_FILES = LICENSE
+TENSORFLOW_LITE_GEMMLOWP_INSTALL_TARGET = NO
+
+$(eval $(generic-package))
--
2.36.1
[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 4625 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Buildroot] [RFC PATCH 09/10] tensorflow-lite-ruy: new package
2022-11-24 14:06 [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package Stefan Hager
` (7 preceding siblings ...)
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 08/10] tensorflow-lite-gemmlowp: " Stefan Hager
@ 2022-11-24 14:06 ` Stefan Hager
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 10/10] tensorflow-lite: " Stefan Hager
2022-11-24 14:54 ` [Buildroot] [RFC PATCH 00/10] " James Hilliard
10 siblings, 0 replies; 19+ messages in thread
From: Stefan Hager @ 2022-11-24 14:06 UTC (permalink / raw)
To: buildroot; +Cc: Stefan Hager, Thomas Petazzoni
[-- Attachment #1.1: Type: text/plain, Size: 2454 bytes --]
This package adds external sources required by tensorflow-lite. Nothing is built or installed within this package, but legal info and source archive is created.
The tensorflow-lite makefile copies the files from this package and uses them for building or to provide headers for the staging folder.
Signed-off-by: Stefan Hager <stefan.hager@ginzinger.com>
---
package/tensorflow-lite-ruy/Config.in | 5 +++++
.../tensorflow-lite-ruy/tensorflow-lite-ruy.hash | 3 +++
package/tensorflow-lite-ruy/tensorflow-lite-ruy.mk | 14 ++++++++++++++
3 files changed, 22 insertions(+)
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
diff --git a/package/tensorflow-lite-ruy/Config.in b/package/tensorflow-lite-ruy/Config.in
new file mode 100644
index 0000000000..9c9fe22370
--- /dev/null
+++ b/package/tensorflow-lite-ruy/Config.in
@@ -0,0 +1,5 @@
+# Not user-selectable, it is only needed to be copied
+# into the tensorflow-lite source tree.
+
+config BR2_PACKAGE_TENSORFLOW_LITE_RUY
+ bool
diff --git a/package/tensorflow-lite-ruy/tensorflow-lite-ruy.hash b/package/tensorflow-lite-ruy/tensorflow-lite-ruy.hash
new file mode 100644
index 0000000000..18b68cabfb
--- /dev/null
+++ b/package/tensorflow-lite-ruy/tensorflow-lite-ruy.hash
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 c17523afd09d7eb42384d89669106ee67347dd254ee01f46b4725947fe57b99f tensorflow-lite-ruy-e6c1b8dc8a8b-br1.tar.gz
+sha256 cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 LICENSE
diff --git a/package/tensorflow-lite-ruy/tensorflow-lite-ruy.mk b/package/tensorflow-lite-ruy/tensorflow-lite-ruy.mk
new file mode 100644
index 0000000000..df0da455e6
--- /dev/null
+++ b/package/tensorflow-lite-ruy/tensorflow-lite-ruy.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# tensorflow-lite-ruy
+#
+################################################################################
+
+TENSORFLOW_LITE_RUY_SITE_METHOD = git
+TENSORFLOW_LITE_RUY_SITE = https://github.com/google/ruy
+TENSORFLOW_LITE_RUY_VERSION = e6c1b8dc8a8b
+TENSORFLOW_LITE_RUY_LICENSE = Apache-2.0
+TENSORFLOW_LITE_RUY_LICENSE_FILES = LICENSE
+TENSORFLOW_LITE_RUY_INSTALL_TARGET = NO
+
+$(eval $(generic-package))
--
2.36.1
[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 4625 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Buildroot] [RFC PATCH 10/10] tensorflow-lite: new package
2022-11-24 14:06 [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package Stefan Hager
` (8 preceding siblings ...)
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 09/10] tensorflow-lite-ruy: " Stefan Hager
@ 2022-11-24 14:06 ` Stefan Hager
2022-11-24 14:54 ` [Buildroot] [RFC PATCH 00/10] " James Hilliard
10 siblings, 0 replies; 19+ messages in thread
From: Stefan Hager @ 2022-11-24 14:06 UTC (permalink / raw)
To: buildroot; +Cc: Stefan Hager, Thomas Petazzoni
[-- Attachment #1.1: Type: text/plain, Size: 33901 bytes --]
This package adds the tensorflow lite runtime 2.8.0 (official) to buildroot.
Patches are added to build it as a shared library and to add support for external delegates
which enable the usage of external backend plugins to run inference on gpu, npu, etc.
Currently supported Processors: ARMV8A: only 64-bit Toolchains; ARMV7A: only 32-bit Toolchains;
Signed-off-by: Stefan Hager <stefan.hager@ginzinger.com>
---
package/Config.in | 1 +
...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 ++++++++++++++++++
8 files changed, 643 insertions(+)
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
diff --git a/package/Config.in b/package/Config.in
index aef80f9ab0..16ed77dedf 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2099,6 +2099,7 @@ endif
source "package/sphinxbase/Config.in"
source "package/startup-notification/Config.in"
source "package/tbb/Config.in"
+ source "package/tensorflow-lite/Config.in"
source "package/tinycbor/Config.in"
source "package/tz/Config.in"
source "package/tzdata/Config.in"
diff --git a/package/tensorflow-lite/0001-Deactivated-neon2sse-since-this-is-only-useful-on-x8.patch b/package/tensorflow-lite/0001-Deactivated-neon2sse-since-this-is-only-useful-on-x8.patch
new file mode 100644
index 0000000000..048a74bffb
--- /dev/null
+++ b/package/tensorflow-lite/0001-Deactivated-neon2sse-since-this-is-only-useful-on-x8.patch
@@ -0,0 +1,34 @@
+From 4d68ce073e75aacebb5935dce4d0b9b4826b0197 Mon Sep 17 00:00:00 2001
+From: Stefan Hager <stefan.hager@ginzinger.com>
+Date: Tue, 6 Sep 2022 13:50:44 +0200
+Subject: [PATCH] Deactivated neon2sse since this is only useful on x86
+ targets, but tflite will be built for arm/arm64 targets.
+
+Signed-off-by: Stefan Hager <stefan.hager@ginzinger.com>
+---
+ tensorflow/lite/CMakeLists.txt | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/tensorflow/lite/CMakeLists.txt b/tensorflow/lite/CMakeLists.txt
+index 200d1a7..9658e40 100644
+--- a/tensorflow/lite/CMakeLists.txt
++++ b/tensorflow/lite/CMakeLists.txt
+@@ -142,7 +142,6 @@ find_package(farmhash REQUIRED)
+ find_package(fft2d REQUIRED)
+ find_package(flatbuffers REQUIRED)
+ find_package(gemmlowp REQUIRED)
+-find_package(neon2sse REQUIRED)
+ find_package(clog REQUIRED)
+ find_package(cpuinfo REQUIRED) #CPUINFO is used by XNNPACK and RUY library
+ find_package(ruy REQUIRED)
+@@ -491,7 +490,6 @@ target_include_directories(tensorflow-lite
+ target_link_libraries(tensorflow-lite
+ PUBLIC
+ Eigen3::Eigen
+- NEON_2_SSE
+ absl::flags
+ absl::hash
+ absl::status
+--
+2.36.1
+
diff --git a/package/tensorflow-lite/0002-Added-option-to-build-a-shared-library-instead-of-st.patch b/package/tensorflow-lite/0002-Added-option-to-build-a-shared-library-instead-of-st.patch
new file mode 100644
index 0000000000..e4a161e48b
--- /dev/null
+++ b/package/tensorflow-lite/0002-Added-option-to-build-a-shared-library-instead-of-st.patch
@@ -0,0 +1,55 @@
+From 2b312e04ef87458103841eaab4d15ac9766bd15d Mon Sep 17 00:00:00 2001
+From: Stefan Hager <stefan.hager@ginzinger.com>
+Date: Tue, 6 Sep 2022 13:56:25 +0200
+Subject: [PATCH] Added option to build a shared library instead of static.
+
+Signed-off-by: Stefan Hager <stefan.hager@ginzinger.com>
+---
+ tensorflow/lite/CMakeLists.txt | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+diff --git a/tensorflow/lite/CMakeLists.txt b/tensorflow/lite/CMakeLists.txt
+index 9658e40..511bf1b 100644
+--- a/tensorflow/lite/CMakeLists.txt
++++ b/tensorflow/lite/CMakeLists.txt
+@@ -68,6 +68,7 @@ option(TFLITE_ENABLE_MMAP "Enable MMAP (unsupported on Windows)" ON)
+ option(TFLITE_ENABLE_GPU "Enable GPU" OFF)
+ option(TFLITE_ENABLE_METAL "Enable Metal delegate (iOS only)" OFF)
+ option(TFLITE_ENABLE_XNNPACK "Enable XNNPACK backend" ON)
++option(TFLITE_BUILD_SHARED_LIB "Build shared library instead of static" OFF)
+
+ option(TFLITE_KERNEL_TEST "Enable tflite kernel unit test" OFF)
+ if(TFLITE_KERNEL_TEST AND ${CMAKE_CROSSCOMPILING})
+@@ -456,6 +457,10 @@ include_directories(
+ ${TFLITE_INCLUDE_DIRS}
+ )
+
++if(${TFLITE_BUILD_SHARED_LIB})
++ set(LIB_TYPE "SHARED")
++endif()
++
+ # TFLite library
+ add_library(tensorflow-lite
+ ${TFLITE_CORE_API_SRCS}
+@@ -483,6 +488,18 @@ add_library(tensorflow-lite
+ ${TFLITE_SOURCE_DIR}/kernels/internal/utils/sparsity_format_converter.cc
+ ${TFLITE_SOURCE_DIR}/schema/schema_utils.cc
+ )
++
++if (TFLITE_BUILD_SHARED_LIB)
++ target_link_options(tensorflow-lite PRIVATE "-Wl,-z,defs")
++ target_link_options(tensorflow-lite PRIVATE "-Wl,--version-script,${TENSORFLOW_SOURCE_DIR}/tensorflow/lite/tflite_version_script.lds")
++endif()
++
++set_target_properties(tensorflow-lite
++ PROPERTIES
++ VERSION 2.8.0
++ SOVERSION 2.8.0
++)
++
+ target_include_directories(tensorflow-lite
+ PUBLIC
+ ${TFLITE_INCLUDE_DIRS}
+--
+2.36.1
+
diff --git a/package/tensorflow-lite/0003-Added-option-to-build-tflite-with-external-delegates.patch b/package/tensorflow-lite/0003-Added-option-to-build-tflite-with-external-delegates.patch
new file mode 100644
index 0000000000..0e1a4c7ee7
--- /dev/null
+++ b/package/tensorflow-lite/0003-Added-option-to-build-tflite-with-external-delegates.patch
@@ -0,0 +1,59 @@
+From 0395f86d50530a4703b20b8afea2c99c27764df6 Mon Sep 17 00:00:00 2001
+From: Stefan Hager <stefan.hager@ginzinger.com>
+Date: Tue, 6 Sep 2022 13:59:56 +0200
+Subject: [PATCH] Added option to build tflite with external delegates enabled.
+
+Signed-off-by: Stefan Hager <stefan.hager@ginzinger.com>
+---
+ tensorflow/lite/CMakeLists.txt | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/tensorflow/lite/CMakeLists.txt b/tensorflow/lite/CMakeLists.txt
+index 511bf1b..43c3d67 100644
+--- a/tensorflow/lite/CMakeLists.txt
++++ b/tensorflow/lite/CMakeLists.txt
+@@ -69,6 +69,7 @@ option(TFLITE_ENABLE_GPU "Enable GPU" OFF)
+ option(TFLITE_ENABLE_METAL "Enable Metal delegate (iOS only)" OFF)
+ option(TFLITE_ENABLE_XNNPACK "Enable XNNPACK backend" ON)
+ option(TFLITE_BUILD_SHARED_LIB "Build shared library instead of static" OFF)
++option(TFLITE_ENABLE_EXTERNAL_DELEGATE "Enable external delegate" OFF)
+
+ option(TFLITE_KERNEL_TEST "Enable tflite kernel unit test" OFF)
+ if(TFLITE_KERNEL_TEST AND ${CMAKE_CROSSCOMPILING})
+@@ -386,6 +387,17 @@ else()
+ "${TFLITE_SOURCE_DIR}/nnapi/nnapi_implementation_disabled.cc"
+ )
+ endif()
++if(TFLITE_ENABLE_EXTERNAL_DELEGATE)
++ message(STATUS "External delegate is enabled.")
++ populate_tflite_source_vars("delegates/external"
++ TFLITE_DELEGATES_EXTERNAL_SRCS
++ FILTER "(_test_list|_disabled)\\.(cc|h)$"
++ )
++ list(APPEND TFLITE_DELEGATES_EXTERNAL_SRCS
++ ${TFLITE_SOURCE_DIR}/tools/command_line_flags.cc
++ )
++ set(TFLITE_DELEGATES_EXTERNAL_INCL "delegates/external")
++endif()
+ if(TFLITE_ENABLE_XNNPACK)
+ find_package(fp16_headers REQUIRED)
+ find_package(xnnpack REQUIRED)
+@@ -451,6 +463,7 @@ endif()
+ set(TFLITE_INCLUDE_DIRS
+ "${TENSORFLOW_SOURCE_DIR}"
+ "${TFLITE_FLATBUFFERS_SCHEMA_DIR}"
++ "${TFLITE_DELEGATES_EXTERNAL_INCL}"
+ )
+ include_directories(
+ BEFORE
+@@ -466,6 +479,7 @@ add_library(tensorflow-lite
+ ${TFLITE_CORE_API_SRCS}
+ ${TFLITE_CORE_SRCS}
+ ${TFLITE_C_SRCS}
++ ${TFLITE_DELEGATES_EXTERNAL_SRCS}
+ ${TFLITE_DELEGATES_FLEX_SRCS}
+ ${TFLITE_DELEGATES_GPU_SRCS}
+ ${TFLITE_DELEGATES_NNAPI_SRCS}
+--
+2.36.1
+
diff --git a/package/tensorflow-lite/0004-Removed-source-repositories-and-git-pull-configurati.patch b/package/tensorflow-lite/0004-Removed-source-repositories-and-git-pull-configurati.patch
new file mode 100644
index 0000000000..db7ecc3684
--- /dev/null
+++ b/package/tensorflow-lite/0004-Removed-source-repositories-and-git-pull-configurati.patch
@@ -0,0 +1,203 @@
+From 45a950cbe2457caafe8d798db5b3949ffd194cdb Mon Sep 17 00:00:00 2001
+From: Stefan Hager <stefan.hager@ginzinger.com>
+Date: Wed, 7 Sep 2022 07:07:56 +0200
+Subject: [PATCH] Removed source repositories and git pull configuration:
+
+In order to prevent fetching external sources which were already
+populated by buildroot packages, the links to external sources were removed.
+
+Signed-off-by: Stefan Hager <stefan.hager@ginzinger.com>
+---
+ tensorflow/lite/tools/cmake/modules/abseil-cpp.cmake | 8 ++++----
+ tensorflow/lite/tools/cmake/modules/clog.cmake | 6 +++---
+ tensorflow/lite/tools/cmake/modules/cpuinfo.cmake | 6 +++---
+ tensorflow/lite/tools/cmake/modules/eigen.cmake | 6 +++---
+ tensorflow/lite/tools/cmake/modules/farmhash.cmake | 6 +++---
+ tensorflow/lite/tools/cmake/modules/fft2d.cmake | 4 ++--
+ tensorflow/lite/tools/cmake/modules/flatbuffers.cmake | 8 ++++----
+ tensorflow/lite/tools/cmake/modules/gemmlowp.cmake | 6 +++---
+ tensorflow/lite/tools/cmake/modules/ruy.cmake | 6 +++---
+ 9 files changed, 28 insertions(+), 28 deletions(-)
+
+diff --git a/tensorflow/lite/tools/cmake/modules/abseil-cpp.cmake b/tensorflow/lite/tools/cmake/modules/abseil-cpp.cmake
+index b17f9b3..93bf522 100644
+--- a/tensorflow/lite/tools/cmake/modules/abseil-cpp.cmake
++++ b/tensorflow/lite/tools/cmake/modules/abseil-cpp.cmake
+@@ -22,11 +22,11 @@ include(OverridableFetchContent)
+
+ OverridableFetchContent_Declare(
+ abseil-cpp
+- GIT_REPOSITORY https://github.com/abseil/abseil-cpp
++# GIT_REPOSITORY https://github.com/abseil/abseil-cpp
+ # Sync with tensorflow/third_party/absl/workspace.bzl
+- GIT_TAG 997aaf3a28308eba1b9156aa35ab7bca9688e9f6
+- GIT_SHALLOW TRUE
+- GIT_PROGRESS TRUE
++# GIT_TAG 997aaf3a28308eba1b9156aa35ab7bca9688e9f6
++# GIT_SHALLOW TRUE
++# GIT_PROGRESS TRUE
+ PREFIX "${CMAKE_BINARY_DIR}"
+ SOURCE_DIR "${CMAKE_BINARY_DIR}/abseil-cpp"
+ )
+diff --git a/tensorflow/lite/tools/cmake/modules/clog.cmake b/tensorflow/lite/tools/cmake/modules/clog.cmake
+index 93f10fb..3904030 100644
+--- a/tensorflow/lite/tools/cmake/modules/clog.cmake
++++ b/tensorflow/lite/tools/cmake/modules/clog.cmake
+@@ -21,10 +21,10 @@ include(OverridableFetchContent)
+
+ OverridableFetchContent_Declare(
+ clog
+- GIT_REPOSITORY https://github.com/pytorch/cpuinfo
++# GIT_REPOSITORY https://github.com/pytorch/cpuinfo
+ # Sync with tensorflow/third_party/clog/workspace.bzl
+- GIT_TAG d5e37adf1406cf899d7d9ec1d317c47506ccb970
+- GIT_PROGRESS TRUE
++# GIT_TAG d5e37adf1406cf899d7d9ec1d317c47506ccb970
++# GIT_PROGRESS TRUE
+ SOURCE_DIR "${CMAKE_BINARY_DIR}/clog"
+ )
+ OverridableFetchContent_GetProperties(clog)
+diff --git a/tensorflow/lite/tools/cmake/modules/cpuinfo.cmake b/tensorflow/lite/tools/cmake/modules/cpuinfo.cmake
+index 71f7f93..757af38 100644
+--- a/tensorflow/lite/tools/cmake/modules/cpuinfo.cmake
++++ b/tensorflow/lite/tools/cmake/modules/cpuinfo.cmake
+@@ -21,10 +21,10 @@ include(OverridableFetchContent)
+
+ OverridableFetchContent_Declare(
+ cpuinfo
+- GIT_REPOSITORY https://github.com/pytorch/cpuinfo
++# GIT_REPOSITORY https://github.com/pytorch/cpuinfo
+ # Sync with tensorflow/third_party/cpuinfo/workspace.bzl
+- GIT_TAG 5916273f79a21551890fd3d56fc5375a78d1598d
+- GIT_PROGRESS TRUE
++# GIT_TAG 5916273f79a21551890fd3d56fc5375a78d1598d
++# GIT_PROGRESS TRUE
+ SOURCE_DIR "${CMAKE_BINARY_DIR}/cpuinfo"
+ )
+ OverridableFetchContent_GetProperties(cpuinfo)
+diff --git a/tensorflow/lite/tools/cmake/modules/eigen.cmake b/tensorflow/lite/tools/cmake/modules/eigen.cmake
+index ed1ba25..1262adc 100644
+--- a/tensorflow/lite/tools/cmake/modules/eigen.cmake
++++ b/tensorflow/lite/tools/cmake/modules/eigen.cmake
+@@ -21,15 +21,15 @@ include(OverridableFetchContent)
+
+ OverridableFetchContent_Declare(
+ eigen
+- GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
++# GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
+ # Sync with tensorflow/third_party/eigen3/workspace.bzl
+- GIT_TAG 085c2fc5d53f391afcccce21c45e15f61c827ab1
++# GIT_TAG 085c2fc5d53f391afcccce21c45e15f61c827ab1
+ # It's not currently (cmake 3.17) possible to shallow clone with a GIT TAG
+ # as cmake attempts to git checkout the commit hash after the clone
+ # which doesn't work as it's a shallow clone hence a different commit hash.
+ # https://gitlab.kitware.com/cmake/cmake/-/issues/17770
+ # GIT_SHALLOW TRUE
+- GIT_PROGRESS TRUE
++# GIT_PROGRESS TRUE
+ PREFIX "${CMAKE_BINARY_DIR}"
+ SOURCE_DIR "${CMAKE_BINARY_DIR}/eigen"
+ LICENSE_FILE "COPYING.MPL2"
+diff --git a/tensorflow/lite/tools/cmake/modules/farmhash.cmake b/tensorflow/lite/tools/cmake/modules/farmhash.cmake
+index 7a5160f..462d8b3 100644
+--- a/tensorflow/lite/tools/cmake/modules/farmhash.cmake
++++ b/tensorflow/lite/tools/cmake/modules/farmhash.cmake
+@@ -21,15 +21,15 @@ include(OverridableFetchContent)
+
+ OverridableFetchContent_Declare(
+ farmhash
+- GIT_REPOSITORY https://github.com/google/farmhash
++# GIT_REPOSITORY https://github.com/google/farmhash
+ # Sync with tensorflow/third_party/farmhash/workspace.bzl
+- GIT_TAG 0d859a811870d10f53a594927d0d0b97573ad06d
++# GIT_TAG 0d859a811870d10f53a594927d0d0b97573ad06d
+ # It's not currently possible to shallow clone with a GIT TAG
+ # as cmake attempts to git checkout the commit hash after the clone
+ # which doesn't work as it's a shallow clone hence a different commit hash.
+ # https://gitlab.kitware.com/cmake/cmake/-/issues/17770
+ # GIT_SHALLOW TRUE
+- GIT_PROGRESS TRUE
++# GIT_PROGRESS TRUE
+ SOURCE_DIR "${CMAKE_BINARY_DIR}/farmhash"
+ )
+ OverridableFetchContent_GetProperties(farmhash)
+diff --git a/tensorflow/lite/tools/cmake/modules/fft2d.cmake b/tensorflow/lite/tools/cmake/modules/fft2d.cmake
+index 9d44a2c..a7ab036 100644
+--- a/tensorflow/lite/tools/cmake/modules/fft2d.cmake
++++ b/tensorflow/lite/tools/cmake/modules/fft2d.cmake
+@@ -21,9 +21,9 @@ include(OverridableFetchContent)
+
+ OverridableFetchContent_Declare(
+ fft2d
+- URL https://storage.googleapis.com/mirror.tensorflow.org/github.com/petewarden/OouraFFT/archive/v1.0.tar.gz
++# URL https://storage.googleapis.com/mirror.tensorflow.org/github.com/petewarden/OouraFFT/archive/v1.0.tar.gz
+ # Sync with tensorflow/workspace2.bzl
+- URL_HASH SHA256=5f4dabc2ae21e1f537425d58a49cdca1c49ea11db0d6271e2a4b27e9697548eb
++# URL_HASH SHA256=5f4dabc2ae21e1f537425d58a49cdca1c49ea11db0d6271e2a4b27e9697548eb
+ SOURCE_DIR "${CMAKE_BINARY_DIR}/fft2d"
+ LICENSE_FILE "readme2d.txt"
+ LICENSE_URL "http://www.kurims.kyoto-u.ac.jp/~ooura/fft.html"
+diff --git a/tensorflow/lite/tools/cmake/modules/flatbuffers.cmake b/tensorflow/lite/tools/cmake/modules/flatbuffers.cmake
+index a3d01fd..2438759 100644
+--- a/tensorflow/lite/tools/cmake/modules/flatbuffers.cmake
++++ b/tensorflow/lite/tools/cmake/modules/flatbuffers.cmake
+@@ -21,11 +21,11 @@ include(FetchContent)
+
+ OverridableFetchContent_Declare(
+ flatbuffers
+- GIT_REPOSITORY https://github.com/google/flatbuffers
++# GIT_REPOSITORY https://github.com/google/flatbuffers
+ # Sync with tensorflow/third_party/flatbuffers/workspace.bzl
+- GIT_TAG v1.12.0
+- GIT_SHALLOW TRUE
+- GIT_PROGRESS TRUE
++# GIT_TAG v1.12.0
++# GIT_SHALLOW TRUE
++# GIT_PROGRESS TRUE
+ SOURCE_DIR "${CMAKE_BINARY_DIR}/flatbuffers"
+ )
+
+diff --git a/tensorflow/lite/tools/cmake/modules/gemmlowp.cmake b/tensorflow/lite/tools/cmake/modules/gemmlowp.cmake
+index da31e3c..741ad09 100644
+--- a/tensorflow/lite/tools/cmake/modules/gemmlowp.cmake
++++ b/tensorflow/lite/tools/cmake/modules/gemmlowp.cmake
+@@ -21,15 +21,15 @@ include(OverridableFetchContent)
+
+ OverridableFetchContent_Declare(
+ gemmlowp
+- GIT_REPOSITORY https://github.com/google/gemmlowp
++# GIT_REPOSITORY https://github.com/google/gemmlowp
+ # Sync with tensorflow/third_party/gemmlowp/workspace.bzl
+- GIT_TAG fda83bdc38b118cc6b56753bd540caa49e570745
++# GIT_TAG fda83bdc38b118cc6b56753bd540caa49e570745
+ # It's not currently (cmake 3.17) possible to shallow clone with a GIT TAG
+ # as cmake attempts to git checkout the commit hash after the clone
+ # which doesn't work as it's a shallow clone hence a different commit hash.
+ # https://gitlab.kitware.com/cmake/cmake/-/issues/17770
+ # GIT_SHALLOW TRUE
+- GIT_PROGRESS TRUE
++# GIT_PROGRESS TRUE
+ SOURCE_DIR "${CMAKE_BINARY_DIR}/gemmlowp"
+ )
+
+diff --git a/tensorflow/lite/tools/cmake/modules/ruy.cmake b/tensorflow/lite/tools/cmake/modules/ruy.cmake
+index 752f527..4decc31 100644
+--- a/tensorflow/lite/tools/cmake/modules/ruy.cmake
++++ b/tensorflow/lite/tools/cmake/modules/ruy.cmake
+@@ -21,10 +21,10 @@ include(OverridableFetchContent)
+
+ OverridableFetchContent_Declare(
+ ruy
+- GIT_REPOSITORY https://github.com/google/ruy
++# GIT_REPOSITORY https://github.com/google/ruy
+ # Sync with tensorflow/third_party/ruy/workspace.bzl
+- GIT_TAG e6c1b8dc8a8b00ee74e7268aac8b18d7260ab1ce
+- GIT_PROGRESS TRUE
++# GIT_TAG e6c1b8dc8a8b00ee74e7268aac8b18d7260ab1ce
++# GIT_PROGRESS TRUE
+ SOURCE_DIR "${CMAKE_BINARY_DIR}/ruy"
+ )
+ OverridableFetchContent_GetProperties(ruy)
+--
+2.36.1
+
diff --git a/package/tensorflow-lite/Config.in b/package/tensorflow-lite/Config.in
new file mode 100644
index 0000000000..868fc7038a
--- /dev/null
+++ b/package/tensorflow-lite/Config.in
@@ -0,0 +1,56 @@
+config BR2_PACKAGE_TENSORFLOW_LITE
+ bool "tensorflow-lite"
+ depends on BR2_TOOLCHAIN_GCC_AT_LEAST_9
+ depends on BR2_TOOLCHAIN_USES_GLIBC
+ depends on BR2_INSTALL_LIBSTDCPP
+ depends on BR2_TOOLCHAIN_HAS_THREADS
+ depends on BR2_SHARED_LIBS
+ depends on !BR2_PACKAGE_LIBABSEIL_CPP
+ depends on !BR2_PACKAGE_EIGEN
+ depends on !BR2_PACKAGE_FLATBUFFERS
+ depends on ( BR2_arm && BR2_ARM_CPU_ARMV7A ) || ( BR2_aarch64 && BR2_ARM_CPU_ARMV8A )
+ select BR2_PACKAGE_TENSORFLOW_LITE_ABSEIL_CPP
+ select BR2_PACKAGE_TENSORFLOW_LITE_CLOG
+ select BR2_PACKAGE_TENSORFLOW_LITE_CPUINFO
+ select BR2_PACKAGE_TENSORFLOW_LITE_EIGEN
+ select BR2_PACKAGE_TENSORFLOW_LITE_FARMHASH
+ select BR2_PACKAGE_TENSORFLOW_LITE_FFT2D
+ select BR2_PACKAGE_TENSORFLOW_LITE_FLATBUFFERS
+ select BR2_PACKAGE_TENSORFLOW_LITE_GEMMLOWP
+ select BR2_PACKAGE_TENSORFLOW_LITE_RUY
+ help
+ Tensorflow Lite dynamic library and headers: Inference engine to run previously trained machine learning models.
+
+comment "tensorflow-lite needs needs a toolchain w/ gcc >= 9"
+ depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_9
+
+comment "tensorflow-lite needs a toolchain w/ glibc, C++, threads"
+ depends on !BR2_TOOLCHAIN_USES_GLIBC || !BR2_INSTALL_LIBSTDCPP || \
+ !BR2_TOOLCHAIN_HAS_THREADS
+
+comment "tensorflow-lite needs a toolchain w/ shared libraries"
+ depends on !BR2_SHARED_LIBS
+
+comment "tensorflow-lite uses its own version of libabseil-cpp, deactivate buildroot package libabseil-cpp to use tflite"
+ depends on BR2_PACKAGE_LIBABSEIL_CPP
+
+comment "tensorflow-lite uses its own version of eigen, deactivate buildroot package eigen to use tflite"
+ depends on BR2_PACKAGE_EIGEN
+
+comment "tensorflow-lite uses its own version of flatbuffers, deactivate buildroot package flatbuffers to use tflite"
+ depends on BR2_PACKAGE_FLATBUFFERS
+
+comment "tensorflow-lite in buildroot currently only supports arm + armv7a cpu or arm64 + armv8a cpu targets"
+ depends on ( BR2_arm && !BR2_ARM_CPU_ARMV7A ) || ( BR2_aarch64 && !BR2_ARM_CPU_ARMV8A) || (!BR2_arm && !BR2_aarch64)
+
+if BR2_PACKAGE_TENSORFLOW_LITE
+source "package/tensorflow-lite-abseil-cpp/Config.in"
+source "package/tensorflow-lite-clog/Config.in"
+source "package/tensorflow-lite-cpuinfo/Config.in"
+source "package/tensorflow-lite-eigen/Config.in"
+source "package/tensorflow-lite-farmhash/Config.in"
+source "package/tensorflow-lite-fft2d/Config.in"
+source "package/tensorflow-lite-flatbuffers/Config.in"
+source "package/tensorflow-lite-gemmlowp/Config.in"
+source "package/tensorflow-lite-ruy/Config.in"
+endif
diff --git a/package/tensorflow-lite/tensorflow-lite.hash b/package/tensorflow-lite/tensorflow-lite.hash
new file mode 100644
index 0000000000..2aef108def
--- /dev/null
+++ b/package/tensorflow-lite/tensorflow-lite.hash
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 71c6915d04265772a0339bed47276942c678b45cc01534210ebe6984fd1aec65 LICENSE
+sha256 4715f89770e1cf9be64016b34d63fc531b89b1fc5f12ef723a2bddb3b784711a tensorflow-lite-v2.8.0-br1.tar.gz
diff --git a/package/tensorflow-lite/tensorflow-lite.mk b/package/tensorflow-lite/tensorflow-lite.mk
new file mode 100644
index 0000000000..dbff6c9855
--- /dev/null
+++ b/package/tensorflow-lite/tensorflow-lite.mk
@@ -0,0 +1,232 @@
+################################################################################
+#
+# tensorflow-lite
+#
+################################################################################
+
+TENSORFLOW_LITE_RAW_VERSION = 2.8.0
+TENSORFLOW_LITE_VERSION = v$(TENSORFLOW_LITE_RAW_VERSION)
+TENSORFLOW_LITE_SITE = https://github.com/tensorflow/tensorflow.git
+TENSORFLOW_LITE_SITE_METHOD = git
+TENSORFLOW_LITE_INSTALL_STAGING = YES
+TENSORFLOW_LITE_LICENSE = Apache-2.0
+TENSORFLOW_LITE_LICENSE_FILES = LICENSE
+TENSORFLOW_LITE_SUBDIR = tensorflow/lite
+TENSORFLOW_LITE_SUPPORTS_IN_SOURCE_BUILD = NO
+TENSORFLOW_LITE_CONF_OPTS = -DBUILD_SHARED_LIBS=ON
+TENSORFLOW_LITE_CONF_OPTS += -DTFLITE_ENABLE_RUY=ON
+TENSORFLOW_LITE_CONF_OPTS += -DTFLITE_ENABLE_EXTERNAL_DELEGATE=ON
+TENSORFLOW_LITE_CONF_OPTS += -DTFLITE_ENABLE_XNNPACK=OFF
+TENSORFLOW_LITE_CONF_OPTS += -DTFLITE_ENABLE_NNAPI=OFF
+TENSORFLOW_LITE_CONF_OPTS += -DFETCHCONTENT_QUIET=OFF
+TENSORFLOW_LITE_CONF_OPTS += -DOVERRIDABLE_FETCH_CONTENT_GIT_REPOSITORY_AND_TAG_TO_URL=ON
+TENSORFLOW_LITE_PATCH_DEPENDENCIES += tensorflow-lite-abseil-cpp tensorflow-lite-clog tensorflow-lite-cpuinfo tensorflow-lite-eigen \
+ tensorflow-lite-farmhash tensorflow-lite-fft2d tensorflow-lite-flatbuffers tensorflow-lite-gemmlowp tensorflow-lite-ruy
+
+define TENSORFLOW_LITE_CREATE_BUILD_DIR
+ mkdir -p $(@D)/tensorflow/lite/buildroot-build
+endef
+
+define TENSORFLOW_LITE_COPY_ABSEIL_CPP
+ rm -rf $(@D)/tensorflow/lite/buildroot-build/abseil-cpp
+ cp -a $(TENSORFLOW_LITE_ABSEIL_CPP_DIR) $(@D)/tensorflow/lite/buildroot-build/abseil-cpp
+endef
+
+define TENSORFLOW_LITE_COPY_CLOG
+ rm -rf $(@D)/tensorflow/lite/buildroot-build/clog
+ cp -a $(TENSORFLOW_LITE_CLOG_DIR) $(@D)/tensorflow/lite/buildroot-build/clog
+endef
+
+define TENSORFLOW_LITE_COPY_CPUINFO
+ rm -rf $(@D)/tensorflow/lite/buildroot-build/cpuinfo
+ cp -a $(TENSORFLOW_LITE_CPUINFO_DIR) $(@D)/tensorflow/lite/buildroot-build/cpuinfo
+endef
+
+define TENSORFLOW_LITE_COPY_EIGEN
+ rm -rf $(@D)/tensorflow/lite/buildroot-build/eigen
+ cp -a $(TENSORFLOW_LITE_EIGEN_DIR) $(@D)/tensorflow/lite/buildroot-build/eigen
+endef
+
+define TENSORFLOW_LITE_COPY_FARMHASH
+ rm -rf $(@D)/tensorflow/lite/buildroot-build/farmhash
+ cp -a $(TENSORFLOW_LITE_FARMHASH_DIR) $(@D)/tensorflow/lite/buildroot-build/farmhash
+endef
+
+define TENSORFLOW_LITE_COPY_FFT2D
+ rm -rf $(@D)/tensorflow/lite/buildroot-build/fft2d
+ cp -a $(TENSORFLOW_LITE_FFT2D_DIR) $(@D)/tensorflow/lite/buildroot-build/fft2d
+endef
+
+define TENSORFLOW_LITE_COPY_FLATBUFFERS
+ rm -rf $(@D)/tensorflow/lite/buildroot-build/flatbuffers
+ cp -a $(TENSORFLOW_LITE_FLATBUFFERS_DIR) $(@D)/tensorflow/lite/buildroot-build/flatbuffers
+endef
+
+define TENSORFLOW_LITE_COPY_GEMMLOWP
+ rm -rf $(@D)/tensorflow/lite/buildroot-build/gemmlowp
+ cp -a $(TENSORFLOW_LITE_GEMMLOWP_DIR) $(@D)/tensorflow/lite/buildroot-build/gemmlowp
+endef
+
+define TENSORFLOW_LITE_COPY_RUY
+ rm -rf $(@D)/tensorflow/lite/buildroot-build/ruy
+ cp -a $(TENSORFLOW_LITE_RUY_DIR) $(@D)/tensorflow/lite/buildroot-build/ruy
+endef
+
+TENSORFLOW_LITE_POST_PATCH_HOOKS += TENSORFLOW_LITE_CREATE_BUILD_DIR TENSORFLOW_LITE_COPY_ABSEIL_CPP TENSORFLOW_LITE_COPY_CLOG \
+ TENSORFLOW_LITE_COPY_CPUINFO TENSORFLOW_LITE_COPY_EIGEN TENSORFLOW_LITE_COPY_FARMHASH TENSORFLOW_LITE_COPY_FFT2D \
+ TENSORFLOW_LITE_COPY_FLATBUFFERS TENSORFLOW_LITE_COPY_GEMMLOWP TENSORFLOW_LITE_COPY_RUY
+
+define TENSORFLOW_LITE_INSTALL_STAGING_CMDS
+ # Abseil headers:
+ # create header folder
+ find $(TENSORFLOW_LITE_ABSEIL_CPP_DIR)/absl -name "*.h" \
+ | xargs -i realpath --relative-to $(TENSORFLOW_LITE_ABSEIL_CPP_DIR) {} \
+ | xargs dirname \
+ | sort | uniq \
+ | xargs -i $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include/{}
+ # install headers
+ find $(TENSORFLOW_LITE_ABSEIL_CPP_DIR)/absl -name "*.h" \
+ | xargs -i realpath --relative-to $(TENSORFLOW_LITE_ABSEIL_CPP_DIR) {} \
+ | xargs -i $(INSTALL) -D -m 0644 $(TENSORFLOW_LITE_ABSEIL_CPP_DIR)/{} $(STAGING_DIR)/usr/include/{}
+ # Abseil .so:
+ find $(@D)/tensorflow/lite/buildroot-build/_deps/abseil-cpp-build/absl -name "libabsl_*.so" \
+ | xargs -i realpath --relative-to $(@D) {} \
+ | xargs -i $(INSTALL) -D -m 0644 $(@D)/{} $(STAGING_DIR)/usr/lib/
+
+ # Cpuinfo .so
+ $(INSTALL) -D -m 0644 $(@D)/tensorflow/lite/buildroot-build/_deps/cpuinfo-build/libcpuinfo.so $(STAGING_DIR)/usr/lib/
+
+ # Eigen3 Headers containted within the tensorflow sources
+ # create 'third_party/eigen3/unsupported/Eigen' header folders
+ find $(@D)/third_party/eigen3/unsupported/Eigen -type f \( -name "*.h" -o ! -name "*.*" \) \
+ | xargs -i realpath --relative-to $(@D)/third_party/eigen3/unsupported/Eigen {} \
+ | xargs dirname \
+ | sort | uniq \
+ | xargs -i $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include/third_party/eigen3/unsupported/Eigen/{}
+ # install 'third_party/eigen3/unsupported/Eigen' headers
+ find $(@D)/third_party/eigen3/unsupported/Eigen -type f \( -name "*.h" -o ! -name "*.*" \) \
+ | xargs -i realpath --relative-to $(@D)/third_party/eigen3/unsupported/Eigen {} \
+ | xargs -i $(INSTALL) -D -m 0644 $(@D)/third_party/eigen3/unsupported/Eigen/{} $(STAGING_DIR)/usr/include/third_party/eigen3/unsupported/Eigen/{}
+ # additional extension-less 'headers'
+ $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include/third_party/eigen3/Eigen
+ $(INSTALL) -D -m 0644 $(@D)/third_party/eigen3/Eigen/* $(STAGING_DIR)/usr/include/third_party/eigen3/Eigen
+
+ # Eigen3
+ # create header folders
+ find $(TENSORFLOW_LITE_EIGEN_DIR)/Eigen -type f \( -name "*.h" -o ! -name "*.*" \) \
+ | xargs -i realpath --relative-to $(TENSORFLOW_LITE_EIGEN_DIR)/Eigen {} \
+ | xargs dirname \
+ | sort | uniq \
+ | xargs -i $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include/Eigen/{}
+ # install headers
+ find $(TENSORFLOW_LITE_EIGEN_DIR)/Eigen -type f \( -name "*.h" -o ! -name "*.*" \) \
+ | xargs -i realpath --relative-to $(TENSORFLOW_LITE_EIGEN_DIR)/Eigen {} \
+ | xargs -i $(INSTALL) -D -m 0644 $(TENSORFLOW_LITE_EIGEN_DIR)/Eigen/{} $(STAGING_DIR)/usr/include/Eigen/{}
+ # create 'unsupported/Eigen/' header folders
+ find $(TENSORFLOW_LITE_EIGEN_DIR)/unsupported/Eigen -type f \( -name "*.h" -o ! -name "*.*" \) \
+ | xargs -i realpath --relative-to $(TENSORFLOW_LITE_EIGEN_DIR)/unsupported/Eigen {} \
+ | xargs dirname \
+ | sort | uniq \
+ | xargs -i $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include/unsupported/Eigen/{}
+ # install 'unsupported/Eigen/' headers
+ find $(TENSORFLOW_LITE_EIGEN_DIR)/unsupported/Eigen -type f \( -name "*.h" -o ! -name "*.*" \) \
+ | xargs -i realpath --relative-to $(TENSORFLOW_LITE_EIGEN_DIR)/unsupported/Eigen {} \
+ | xargs -i $(INSTALL) -D -m 0644 $(TENSORFLOW_LITE_EIGEN_DIR)/unsupported/Eigen/{} $(STAGING_DIR)/usr/include/unsupported/Eigen/{}
+
+ # Farmhash .so
+ $(INSTALL) -D -m 0644 $(@D)/tensorflow/lite/buildroot-build/_deps/farmhash-build/libfarmhash.so $(STAGING_DIR)/usr/lib/
+
+ # FFT2
+ # create 'third_party/fft2d' header folders from tensorflow-lite sources
+ find $(@D)/third_party/fft2d -name "*.h" \
+ | xargs -i realpath --relative-to $(@D)/third_party/fft2d {} \
+ | xargs dirname \
+ | sort | uniq \
+ | xargs -i $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include/third_party/fft2d/{}
+ # install 'third_party/fft2d' headers from tensorflow-lite sources
+ find $(@D)/third_party/fft2d -name "*.h" \
+ | xargs -i realpath --relative-to $(@D)/third_party/fft2d {} \
+ | xargs -i $(INSTALL) -D -m 0644 $(@D)/third_party/fft2d/{} $(STAGING_DIR)/usr/include/third_party/fft2d/{}
+ # libs
+ $(INSTALL) -D -m 0755 $(@D)/tensorflow/lite/buildroot-build/_deps/fft2d-build/libfft2d_fftsg2d.so $(STAGING_DIR)/usr/lib/
+ $(INSTALL) -D -m 0755 $(@D)/tensorflow/lite/buildroot-build/_deps/fft2d-build/libfft2d_fftsg.so $(STAGING_DIR)/usr/lib/
+
+ # Flatbuffers
+ # create header folders
+ $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include/flatbuffers
+ # install headers
+ $(INSTALL) -D -m 0644 $(TENSORFLOW_LITE_FLATBUFFERS_DIR)/include/flatbuffers/*.h $(STAGING_DIR)/usr/include/flatbuffers
+
+ # Gemmlowp
+ # create header folders
+ find $(TENSORFLOW_LITE_GEMMLOWP_DIR) -name "*.h" \
+ | xargs -i realpath --relative-to $(TENSORFLOW_LITE_GEMMLOWP_DIR) {} \
+ | xargs dirname \
+ | sort | uniq \
+ | xargs -i $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include/gemmlowp/{}
+ # install headers
+ find $(TENSORFLOW_LITE_GEMMLOWP_DIR) -name "*.h" \
+ | xargs -i realpath --relative-to $(TENSORFLOW_LITE_GEMMLOWP_DIR) {} \
+ | xargs -i $(INSTALL) -D -m 0644 $(TENSORFLOW_LITE_GEMMLOWP_DIR)/{} $(STAGING_DIR)/usr/include/gemmlowp/{}
+
+ # Ruy - not built since TFLite v2.8.0 but some components need the headers for example vx-delegate
+ # create header folders
+ find $(TENSORFLOW_LITE_RUY_DIR)/ruy -name "*.h" \
+ | xargs -i realpath --relative-to $(TENSORFLOW_LITE_RUY_DIR)/ruy {} \
+ | xargs dirname \
+ | sort | uniq \
+ | xargs -i $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include/ruy/{}
+ # install headers
+ find $(TENSORFLOW_LITE_RUY_DIR)/ruy -name "*.h" \
+ | xargs -i realpath --relative-to $(TENSORFLOW_LITE_RUY_DIR)/ruy {} \
+ | xargs -i $(INSTALL) -D -m 0644 $(TENSORFLOW_LITE_RUY_DIR)/ruy/{} $(STAGING_DIR)/usr/include/ruy/{}
+
+ # Tensorflow Headers
+ $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include/tensorflow/core/public
+ $(INSTALL) -D -m 0644 $(@D)/tensorflow/core/public/version.h $(STAGING_DIR)/usr/include/tensorflow/core/public/version.h
+ $(INSTALL) -D -m 0644 $(@D)/tensorflow/core/util/stats_calculator.h $(STAGING_DIR)/usr/include/tensorflow/core/util/stats_calculator.h
+ $(INSTALL) -D -m 0644 $(@D)/tensorflow/core/util/stat_summarizer_options.h $(STAGING_DIR)/usr/include/tensorflow/core/util/stat_summarizer_options.h
+
+ # Tensorflow-lite Headers
+ # create header folders
+ find $(@D)/tensorflow/lite -type d -name buildroot-build -prune -o -name "*.h" -print \
+ | xargs -i realpath --relative-to $(@D)/tensorflow/lite {} \
+ | xargs dirname \
+ | sort | uniq \
+ | xargs -i $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include/tensorflow/lite/{}
+ # install headers
+ find $(@D)/tensorflow/lite -type d -name buildroot-build -prune -o -name "*.h" -print \
+ | xargs -i realpath --relative-to $(@D)/tensorflow/lite {} \
+ | xargs -i $(INSTALL) -D -m 0644 $(@D)/tensorflow/lite/{} $(STAGING_DIR)/usr/include/tensorflow/lite/{}
+
+ # Headers for example
+ $(INSTALL) -d -m 0755 $(STAGING_DIR)/usr/include/tensorflow/lite/examples/label_image/
+ $(INSTALL) -D -m 0644 $(@D)/tensorflow/lite/examples/label_image/*.h $(STAGING_DIR)/usr/include/tensorflow/lite/examples/label_image/
+
+ # Tensorflow-lite libs
+ $(INSTALL) -D -m 0644 $(@D)/tensorflow/lite/buildroot-build/libtensorflow-lite.so $(STAGING_DIR)/usr/lib/
+ ln -sf libtensorflow-lite.so $(STAGING_DIR)/usr/lib/libtensorflow-lite.so.$(TENSORFLOW_LITE_RAW_VERSION)
+endef
+
+define TENSORFLOW_LITE_INSTALL_TARGET_CMDS
+ # Abseil
+ find $(@D)/tensorflow/lite/buildroot-build/_deps/abseil-cpp-build/absl -name "libabsl_*.so" \
+ | xargs -i realpath --relative-to $(@D) {} \
+ | xargs -i $(INSTALL) -D -m 0644 $(@D)/{} $(TARGET_DIR)/usr/lib/
+
+ # Cpuinfo
+ $(INSTALL) -D -m 0644 $(@D)/tensorflow/lite/buildroot-build/_deps/cpuinfo-build/libcpuinfo.so $(TARGET_DIR)/usr/lib/
+
+ # Farmhash
+ $(INSTALL) -D -m 0644 $(@D)/tensorflow/lite/buildroot-build/_deps/farmhash-build/libfarmhash.so $(TARGET_DIR)/usr/lib/
+
+ # FFT2
+ $(INSTALL) -D -m 0755 $(@D)/tensorflow/lite/buildroot-build/_deps/fft2d-build/libfft2d_fftsg2d.so $(TARGET_DIR)/usr/lib/
+ $(INSTALL) -D -m 0755 $(@D)/tensorflow/lite/buildroot-build/_deps/fft2d-build/libfft2d_fftsg.so $(TARGET_DIR)/usr/lib/
+
+ # Tensorflow-lite
+ $(INSTALL) -D -m 0644 $(@D)/tensorflow/lite/buildroot-build/libtensorflow-lite.so $(TARGET_DIR)/usr/lib/
+ ln -sf libtensorflow-lite.so $(TARGET_DIR)/usr/lib/libtensorflow-lite.so.$(TENSORFLOW_LITE_RAW_VERSION)
+endef
+
+$(eval $(cmake-package))
--
2.36.1
[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 4625 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [Buildroot] [RFC PATCH 01/10] tensorflow-lite-abseil-cpp: new package
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 01/10] tensorflow-lite-abseil-cpp: " Stefan Hager
@ 2022-11-24 14:46 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 19+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-11-24 14:46 UTC (permalink / raw)
To: Stefan Hager; +Cc: buildroot
Hello,
On Thu, 24 Nov 2022 15:06:18 +0100
Stefan Hager <stefan.hager@ginzinger.com> wrote:
> +TENSORFLOW_LITE_ABSEIL_CPP_SITE_METHOD = git
> +TENSORFLOW_LITE_ABSEIL_CPP_SITE = https://github.com/abseil/abseil-cpp
> +TENSORFLOW_LITE_ABSEIL_CPP_VERSION = 997aaf3a2830
We already have a package for abseil-cpp:
https://gitlab.com/buildroot.org/buildroot/-/tree/master/package/libabseil-cpp/
Why do you need to recreate one ?
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Buildroot] [RFC PATCH 02/10] tensorflow-lite-clog: new package
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 02/10] tensorflow-lite-clog: " Stefan Hager
@ 2022-11-24 14:48 ` Thomas Petazzoni via buildroot
2022-11-25 16:21 ` James Hilliard
0 siblings, 1 reply; 19+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-11-24 14:48 UTC (permalink / raw)
To: Stefan Hager; +Cc: buildroot
Hello,
On Thu, 24 Nov 2022 15:06:19 +0100
Stefan Hager <stefan.hager@ginzinger.com> wrote:
> This package adds external sources required by tensorflow-lite.
> Nothing is built or installed within this package, but legal info and
> source archive is created. The tensorflow-lite makefile copies the
> files from this package and uses them for building or to provide
> headers for the staging folder.
Please wrap the commit logs to ~80 characters.
Isn't there a better way? It's really horrible to duplicate all those
packages that we already have in Buildroot :-/
> +TENSORFLOW_LITE_CLOG_SITE_METHOD = git
> +TENSORFLOW_LITE_CLOG_SITE = https://github.com/pytorch/cpuinfo
Are you sure? This looks like the URL for the cpuinfo package, not the
clog package.
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package
2022-11-24 14:06 [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package Stefan Hager
` (9 preceding siblings ...)
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 10/10] tensorflow-lite: " Stefan Hager
@ 2022-11-24 14:54 ` James Hilliard
[not found] ` <AM5PR06MB315361D4448EE9C17B1C3F65840E9@AM5PR06MB3153.eurprd06.prod.outlook.com>
10 siblings, 1 reply; 19+ messages in thread
From: James Hilliard @ 2022-11-24 14:54 UTC (permalink / raw)
To: Stefan Hager; +Cc: Thomas Petazzoni, buildroot
On Thu, Nov 24, 2022 at 10:14 AM Stefan Hager
<stefan.hager@ginzinger.com> wrote:
>
> 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.
This is an outdated release right? Are there issues with 2.11.0?
>
> 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.
I'm unable to find any documentation indicating this is actually the case.
I skimmed the cmakelists and it doesn't seem to have strict version
requirements:
https://github.com/tensorflow/tensorflow/blob/v2.11.0/tensorflow/lite/CMakeLists.txt
Have you tried building against the normal buildroot versions of these packages?
> 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.
This is probably not the right approach, other packages may depend on
or select the normal versions(flatbuffers seems especially problematic).
>
> 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
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package
[not found] ` <AM5PR06MB315361D4448EE9C17B1C3F65840E9@AM5PR06MB3153.eurprd06.prod.outlook.com>
@ 2022-11-25 16:16 ` James Hilliard
2022-11-28 15:17 ` Hager Stefan
0 siblings, 1 reply; 19+ messages in thread
From: James Hilliard @ 2022-11-25 16:16 UTC (permalink / raw)
To: Hager Stefan; +Cc: Thomas Petazzoni, buildroot
On Fri, Nov 25, 2022 at 5:07 AM Hager Stefan <Stefan.Hager@ginzinger.com> wrote:
>
> Hi James!
>
> Tanks for your Feedback!
>
> Yes TFlite 2.8.0 is not the "latest" Release.
>
> I'm absolutly with you that using special Versions is a bad idea in general.
> On the other hand, it was my fear that it may be difficult to prove that everything works properly with newer Libs even if the build succeeds.
> It was hard work for me get it running and I was happy that everything works even with the known limitations. But i learned a lot ; )
It seems to build fine with normal libraries and without all the
manual copy hacks:
https://patchwork.ozlabs.org/project/buildroot/list/?series=330091&submitter=&state=*&q=&archive=both&delegate=
See if that works for you, I refactored your patchset and it seems to
build without
issues now using system libraries.
I also uploaded that series to my personal github if that's easier for
you to test:
https://github.com/jameshilliard/buildroot/tree/tensorflow-lite
>
> Maybe it is the best to bump to Version 2.11.0 and they try it again with buildroot's own packages where they exist.
> But this will take some time, maybe next year for the 23.04 Release.
I bumped it to 2.11.0 and fixed the build issues I ran into:
https://patchwork.ozlabs.org/project/buildroot/patch/20221125160724.1725476-8-james.hilliard1@gmail.com/
>
> And next time i need to add the [Buildroot] tag to the subject so my mail sorting rule will work for my own mails...
I think you also accidentally dropped the mailing list from your reply as well.
>
> Best Regards
> Stefan
>
>
>
>
> From: James Hilliard <james.hilliard1@gmail.com>
> Sent: Thursday, November 24, 2022 15:54
> To: Hager Stefan <Stefan.Hager@ginzinger.com>
> Cc: buildroot@buildroot.org <buildroot@buildroot.org>; Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Subject: Re: [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package
>
> On Thu, Nov 24, 2022 at 10:14 AM Stefan Hager
> <stefan.hager@ginzinger.com> wrote:
> >
> > 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.
>
> This is an outdated release right? Are there issues with 2.11.0?
>
> >
> > 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.
>
> I'm unable to find any documentation indicating this is actually the case.
>
> I skimmed the cmakelists and it doesn't seem to have strict version
> requirements:
> https://github.com/tensorflow/tensorflow/blob/v2.11.0/tensorflow/lite/CMakeLists.txt
>
> Have you tried building against the normal buildroot versions of these packages?
>
> > 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.
>
> This is probably not the right approach, other packages may depend on
> or select the normal versions(flatbuffers seems especially problematic).
>
> >
> > 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
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot@buildroot.org
> > https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Buildroot] [RFC PATCH 02/10] tensorflow-lite-clog: new package
2022-11-24 14:48 ` Thomas Petazzoni via buildroot
@ 2022-11-25 16:21 ` James Hilliard
0 siblings, 0 replies; 19+ messages in thread
From: James Hilliard @ 2022-11-25 16:21 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: Stefan Hager, buildroot
On Thu, Nov 24, 2022 at 10:48 AM Thomas Petazzoni via buildroot
<buildroot@buildroot.org> wrote:
>
> Hello,
>
> On Thu, 24 Nov 2022 15:06:19 +0100
> Stefan Hager <stefan.hager@ginzinger.com> wrote:
>
> > This package adds external sources required by tensorflow-lite.
> > Nothing is built or installed within this package, but legal info and
> > source archive is created. The tensorflow-lite makefile copies the
> > files from this package and uses them for building or to provide
> > headers for the staging folder.
>
> Please wrap the commit logs to ~80 characters.
>
> Isn't there a better way? It's really horrible to duplicate all those
> packages that we already have in Buildroot :-/
Best I can tell it's entirely unnecessary, I got it to build without duplicating
packages like that and without most of the hacks:
https://patchwork.ozlabs.org/project/buildroot/list/?series=330091&submitter=&state=*&q=&archive=both&delegate=
>
> > +TENSORFLOW_LITE_CLOG_SITE_METHOD = git
> > +TENSORFLOW_LITE_CLOG_SITE = https://github.com/pytorch/cpuinfo
>
> Are you sure? This looks like the URL for the cpuinfo package, not the
> clog package.
>
> Thomas
> --
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering and training
> https://bootlin.com
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package
2022-11-25 16:16 ` James Hilliard
@ 2022-11-28 15:17 ` Hager Stefan
2022-11-28 18:02 ` James Hilliard
0 siblings, 1 reply; 19+ messages in thread
From: Hager Stefan @ 2022-11-28 15:17 UTC (permalink / raw)
To: James Hilliard; +Cc: buildroot@buildroot.org
[-- Attachment #1.1: Type: text/plain, Size: 24968 bytes --]
Hi James!
Thanks four your great work!
I was able to successfully build it.
Unfortunately i could not build (linking error) the example program label_image.
I use this to verify if the inference results are the same across different Versions
on the target hardware.
This is what i did:
$ make freescale_imx8mpevk_defconfig menuconfig
=> in Menuconfig: activated C++ Support in the Toolchain Section; activated tensorflow-lite; activated host environment-setup;
$ make
# everything built fine
$ source output/host/environment-setup
$ cd output/build/tensorflow-lite-2.11.0/tensorflow/lite/buildroot-build/examples/label_image/
$ make label_image
# linking error, full log:
Consolidate compiler generated dependencies of target fft2d_fftsg
[ 1%] Built target fft2d_fftsg
Consolidate compiler generated dependencies of target farmhash
[ 1%] Built target farmhash
Consolidate compiler generated dependencies of target fft2d_fftsg2d
[ 1%] Built target fft2d_fftsg2d
Consolidate compiler generated dependencies of target tensorflow-lite
[ 94%] Built target tensorflow-lite
[ 94%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/bitmap_helpers.cc.o
[ 95%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/label_image.cc.o
[ 95%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/xxx/buildroot/output/build/tensorflow-lite-2.11.0/tensorflow/core/util/stats_calculator.cc.o
[ 96%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/profiling/memory_info.cc.o
[ 96%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/profiling/profile_summarizer.cc.o
[ 96%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/profiling/profile_summary_formatter.cc.o
[ 97%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/profiling/time.cc.o
[ 97%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/tools/command_line_flags.cc.o
[ 98%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/tools/delegates/default_execution_provider.cc.o
[ 98%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/tools/delegates/delegate_provider.cc.o
[ 98%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/tools/evaluation/utils.cc.o
[100%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/tools/tool_params.cc.o
[100%] Linking CXX executable label_image
xxx/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: ../../libtensorflow-lite.so: undefined reference to `tsl::profiler::TraceMeRecorder::Record(tsl::profiler::TraceMeRecorder::Event&&)'
xxx/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: ../../libtensorflow-lite.so: undefined reference to `tsl::profiler::internal::g_trace_level'
xxx/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: ../../libtensorflow-lite.so: undefined reference to `tensorflow::profiler::ScopedMemoryDebugAnnotation::ThreadMemoryDebugAnnotation()'
xxx/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: ../../libtensorflow-lite.so: undefined reference to `tsl::profiler::GetCurrentTimeNanos()'
collect2: error: ld returned 1 exit status
make[3]: *** [examples/label_image/CMakeFiles/label_image.dir/build.make:351: examples/label_image/label_image] Error 1
make[2]: *** [CMakeFiles/Makefile2:436: examples/label_image/CMakeFiles/label_image.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:443: examples/label_image/CMakeFiles/label_image.dir/rule] Error 2
make: *** [Makefile:166: examples/label_image/CMakeFiles/label_image.dir/rule] Error 2
This did peviously work with tensorflow-lite v2.8.
Maybe i am missing something?
I guess this is broken in v2.11.0.
A fix may be in their master: https://github.com/tensorflow/tensorflow/commit/8562f9764937db51a4742fd10057463880579329
I can try to use their master branch to see if that issue was addressed in the next days. Alternatively i can Test v2.10.1.
Maybe we need to wait for the next release v2.12?
Best Regards
Stefan
From: James Hilliard <james.hilliard1@gmail.com>
Sent: Friday, November 25, 2022 17:16
To: Hager Stefan <Stefan.Hager@ginzinger.com>
Cc: buildroot <buildroot@buildroot.org>; Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package
On Fri, Nov 25, 2022 at 5:07 AM Hager Stefan <Stefan.Hager@ginzinger.com> wrote:
>
> Hi James!
>
> Tanks for your Feedback!
>
> Yes TFlite 2.8.0 is not the "latest" Release.
>
> I'm absolutly with you that using special Versions is a bad idea in general.
> On the other hand, it was my fear that it may be difficult to prove that everything works properly with newer Libs even if the build succeeds.
> It was hard work for me get it running and I was happy that everything works even with the known limitations. But i learned a lot ; )
It seems to build fine with normal libraries and without all the
manual copy hacks:
https://patchwork.ozlabs.org/project/buildroot/list/?series=330091&submitter=&state=*&q=&archive=both&delegate=
See if that works for you, I refactored your patchset and it seems to
build without
issues now using system libraries.
I also uploaded that series to my personal github if that's easier for
you to test:
https://github.com/jameshilliard/buildroot/tree/tensorflow-lite
>
> Maybe it is the best to bump to Version 2.11.0 and they try it again with buildroot's own packages where they exist.
> But this will take some time, maybe next year for the 23.04 Release.
I bumped it to 2.11.0 and fixed the build issues I ran into:
https://patchwork.ozlabs.org/project/buildroot/patch/20221125160724.1725476-8-james.hilliard1@gmail.com/
>
> And next time i need to add the [Buildroot] tag to the subject so my mail sorting rule will work for my own mails...
I think you also accidentally dropped the mailing list from your reply as well.
>
> Best Regards
> Stefan
>
>
>
>
> From: James Hilliard <james.hilliard1@gmail.com>
> Sent: Thursday, November 24, 2022 15:54
> To: Hager Stefan <Stefan.Hager@ginzinger.com>
> Cc: buildroot@buildroot.org <buildroot@buildroot.org>; Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Subject: Re: [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package
>
> On Thu, Nov 24, 2022 at 10:14 AM Stefan Hager
> <stefan.hager@ginzinger.com> wrote:
> >
> > 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.
>
> This is an outdated release right? Are there issues with 2.11.0?
>
> >
> > 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.
>
> I'm unable to find any documentation indicating this is actually the case.
>
> I skimmed the cmakelists and it doesn't seem to have strict version
> requirements:
> https://github.com/tensorflow/tensorflow/blob/v2.11.0/tensorflow/lite/CMakeLists.txt
>
> Have you tried building against the normal buildroot versions of these packages?
>
> > 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.
>
> This is probably not the right approach, other packages may depend on
> or select the normal versions(flatbuffers seems especially problematic).
>
> >
> > 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
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot@buildroot.org
> > https://lists.buildroot.org/mailman/listinfo/buildroot
From: James Hilliard <james.hilliard1@gmail.com>
Sent: Friday, November 25, 2022 17:16
To: Hager Stefan <Stefan.Hager@ginzinger.com>
Cc: buildroot <buildroot@buildroot.org>; Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package
On Fri, Nov 25, 2022 at 5:07 AM Hager Stefan <Stefan.Hager@ginzinger.com> wrote:
>
> Hi James!
>
> Tanks for your Feedback!
>
> Yes TFlite 2.8.0 is not the "latest" Release.
>
> I'm absolutly with you that using special Versions is a bad idea in general.
> On the other hand, it was my fear that it may be difficult to prove that everything works properly with newer Libs even if the build succeeds.
> It was hard work for me get it running and I was happy that everything works even with the known limitations. But i learned a lot ; )
It seems to build fine with normal libraries and without all the
manual copy hacks:
https://patchwork.ozlabs.org/project/buildroot/list/?series=330091&submitter=&state=*&q=&archive=both&delegate=
See if that works for you, I refactored your patchset and it seems to
build without
issues now using system libraries.
I also uploaded that series to my personal github if that's easier for
you to test:
https://github.com/jameshilliard/buildroot/tree/tensorflow-lite
>
> Maybe it is the best to bump to Version 2.11.0 and they try it again with buildroot's own packages where they exist.
> But this will take some time, maybe next year for the 23.04 Release.
I bumped it to 2.11.0 and fixed the build issues I ran into:
https://patchwork.ozlabs.org/project/buildroot/patch/20221125160724.1725476-8-james.hilliard1@gmail.com/
>
> And next time i need to add the [Buildroot] tag to the subject so my mail sorting rule will work for my own mails...
I think you also accidentally dropped the mailing list from your reply as well.
>
> Best Regards
> Stefan
>
>
>
>
> From: James Hilliard <james.hilliard1@gmail.com>
> Sent: Thursday, November 24, 2022 15:54
> To: Hager Stefan <Stefan.Hager@ginzinger.com>
> Cc: buildroot@buildroot.org <buildroot@buildroot.org>; Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Subject: Re: [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package
>
> On Thu, Nov 24, 2022 at 10:14 AM Stefan Hager
> <stefan.hager@ginzinger.com> wrote:
> >
> > 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.
>
> This is an outdated release right? Are there issues with 2.11.0?
>
> >
> > 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.
>
> I'm unable to find any documentation indicating this is actually the case.
>
> I skimmed the cmakelists and it doesn't seem to have strict version
> requirements:
> https://github.com/tensorflow/tensorflow/blob/v2.11.0/tensorflow/lite/CMakeLists.txt
>
> Have you tried building against the normal buildroot versions of these packages?
>
> > 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.
>
> This is probably not the right approach, other packages may depend on
> or select the normal versions(flatbuffers seems especially problematic).
>
> >
> > 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
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot@buildroot.org
> > https://lists.buildroot.org/mailman/listinfo/buildroot
[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 4625 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package
2022-11-28 15:17 ` Hager Stefan
@ 2022-11-28 18:02 ` James Hilliard
2022-11-30 6:43 ` Hager Stefan
0 siblings, 1 reply; 19+ messages in thread
From: James Hilliard @ 2022-11-28 18:02 UTC (permalink / raw)
To: Hager Stefan; +Cc: buildroot@buildroot.org
On Mon, Nov 28, 2022 at 11:17 AM Hager Stefan
<Stefan.Hager@ginzinger.com> wrote:
>
> Hi James!
>
> Thanks four your great work!
> I was able to successfully build it.
>
> Unfortunately i could not build (linking error) the example program label_image.
> I use this to verify if the inference results are the same across different Versions
> on the target hardware.
>
> This is what i did:
> $ make freescale_imx8mpevk_defconfig menuconfig
> => in Menuconfig: activated C++ Support in the Toolchain Section; activated tensorflow-lite; activated host environment-setup;
> $ make
> # everything built fine
>
> $ source output/host/environment-setup
> $ cd output/build/tensorflow-lite-2.11.0/tensorflow/lite/buildroot-build/examples/label_image/
> $ make label_image
> # linking error, full log:
>
> Consolidate compiler generated dependencies of target fft2d_fftsg
> [ 1%] Built target fft2d_fftsg
> Consolidate compiler generated dependencies of target farmhash
> [ 1%] Built target farmhash
> Consolidate compiler generated dependencies of target fft2d_fftsg2d
> [ 1%] Built target fft2d_fftsg2d
> Consolidate compiler generated dependencies of target tensorflow-lite
> [ 94%] Built target tensorflow-lite
> [ 94%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/bitmap_helpers.cc.o
> [ 95%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/label_image.cc.o
> [ 95%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/xxx/buildroot/output/build/tensorflow-lite-2.11.0/tensorflow/core/util/stats_calculator.cc.o
> [ 96%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/profiling/memory_info.cc.o
> [ 96%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/profiling/profile_summarizer.cc.o
> [ 96%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/profiling/profile_summary_formatter.cc.o
> [ 97%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/profiling/time.cc.o
> [ 97%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/tools/command_line_flags.cc.o
> [ 98%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/tools/delegates/default_execution_provider.cc.o
> [ 98%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/tools/delegates/delegate_provider.cc.o
> [ 98%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/tools/evaluation/utils.cc.o
> [100%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/tools/tool_params.cc.o
> [100%] Linking CXX executable label_image
> xxx/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: ../../libtensorflow-lite.so: undefined reference to `tsl::profiler::TraceMeRecorder::Record(tsl::profiler::TraceMeRecorder::Event&&)'
> xxx/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: ../../libtensorflow-lite.so: undefined reference to `tsl::profiler::internal::g_trace_level'
> xxx/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: ../../libtensorflow-lite.so: undefined reference to `tensorflow::profiler::ScopedMemoryDebugAnnotation::ThreadMemoryDebugAnnotation()'
> xxx/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: ../../libtensorflow-lite.so: undefined reference to `tsl::profiler::GetCurrentTimeNanos()'
> collect2: error: ld returned 1 exit status
> make[3]: *** [examples/label_image/CMakeFiles/label_image.dir/build.make:351: examples/label_image/label_image] Error 1
> make[2]: *** [CMakeFiles/Makefile2:436: examples/label_image/CMakeFiles/label_image.dir/all] Error 2
> make[1]: *** [CMakeFiles/Makefile2:443: examples/label_image/CMakeFiles/label_image.dir/rule] Error 2
> make: *** [Makefile:166: examples/label_image/CMakeFiles/label_image.dir/rule] Error 2
>
> This did peviously work with tensorflow-lite v2.8.
> Maybe i am missing something?
>
> I guess this is broken in v2.11.0.
> A fix may be in their master: https://github.com/tensorflow/tensorflow/commit/8562f9764937db51a4742fd10057463880579329
Fix is in master but it's not that specific commit, should be this one:
https://github.com/tensorflow/tensorflow/commit/081c2e4e3cf021efb2853a485a18b563e88f6117
Pushed the fix to my github branch and v2 series:
https://patchwork.ozlabs.org/project/buildroot/patch/20221128175851.1913859-8-james.hilliard1@gmail.com/
> I can try to use their master branch to see if that issue was addressed in the next days. Alternatively i can Test v2.10.1.
>
> Maybe we need to wait for the next release v2.12?
>
> Best Regards
> Stefan
>
> From: James Hilliard <james.hilliard1@gmail.com>
> Sent: Friday, November 25, 2022 17:16
> To: Hager Stefan <Stefan.Hager@ginzinger.com>
> Cc: buildroot <buildroot@buildroot.org>; Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Subject: Re: [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package
>
> On Fri, Nov 25, 2022 at 5:07 AM Hager Stefan <Stefan.Hager@ginzinger.com> wrote:
> >
> > Hi James!
> >
> > Tanks for your Feedback!
> >
> > Yes TFlite 2.8.0 is not the "latest" Release.
> >
> > I'm absolutly with you that using special Versions is a bad idea in general.
> > On the other hand, it was my fear that it may be difficult to prove that everything works properly with newer Libs even if the build succeeds.
> > It was hard work for me get it running and I was happy that everything works even with the known limitations. But i learned a lot ; )
>
> It seems to build fine with normal libraries and without all the
> manual copy hacks:
> https://patchwork.ozlabs.org/project/buildroot/list/?series=330091&submitter=&state=*&q=&archive=both&delegate=
>
> See if that works for you, I refactored your patchset and it seems to
> build without
> issues now using system libraries.
>
> I also uploaded that series to my personal github if that's easier for
> you to test:
> https://github.com/jameshilliard/buildroot/tree/tensorflow-lite
>
> >
> > Maybe it is the best to bump to Version 2.11.0 and they try it again with buildroot's own packages where they exist.
> > But this will take some time, maybe next year for the 23.04 Release.
>
> I bumped it to 2.11.0 and fixed the build issues I ran into:
> https://patchwork.ozlabs.org/project/buildroot/patch/20221125160724.1725476-8-james.hilliard1@gmail.com/
>
> >
> > And next time i need to add the [Buildroot] tag to the subject so my mail sorting rule will work for my own mails...
>
> I think you also accidentally dropped the mailing list from your reply as well.
>
> >
> > Best Regards
> > Stefan
> >
> >
> >
> >
> > From: James Hilliard <james.hilliard1@gmail.com>
> > Sent: Thursday, November 24, 2022 15:54
> > To: Hager Stefan <Stefan.Hager@ginzinger.com>
> > Cc: buildroot@buildroot.org <buildroot@buildroot.org>; Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> > Subject: Re: [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package
> >
> > On Thu, Nov 24, 2022 at 10:14 AM Stefan Hager
> > <stefan.hager@ginzinger.com> wrote:
> > >
> > > 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.
> >
> > This is an outdated release right? Are there issues with 2.11.0?
> >
> > >
> > > 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.
> >
> > I'm unable to find any documentation indicating this is actually the case.
> >
> > I skimmed the cmakelists and it doesn't seem to have strict version
> > requirements:
> > https://github.com/tensorflow/tensorflow/blob/v2.11.0/tensorflow/lite/CMakeLists.txt
> >
> > Have you tried building against the normal buildroot versions of these packages?
> >
> > > 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.
> >
> > This is probably not the right approach, other packages may depend on
> > or select the normal versions(flatbuffers seems especially problematic).
> >
> > >
> > > 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
> > >
> > > _______________________________________________
> > > buildroot mailing list
> > > buildroot@buildroot.org
> > > https://lists.buildroot.org/mailman/listinfo/buildroot
>
>
> From: James Hilliard <james.hilliard1@gmail.com>
> Sent: Friday, November 25, 2022 17:16
> To: Hager Stefan <Stefan.Hager@ginzinger.com>
> Cc: buildroot <buildroot@buildroot.org>; Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Subject: Re: [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package
>
> On Fri, Nov 25, 2022 at 5:07 AM Hager Stefan <Stefan.Hager@ginzinger.com> wrote:
> >
> > Hi James!
> >
> > Tanks for your Feedback!
> >
> > Yes TFlite 2.8.0 is not the "latest" Release.
> >
> > I'm absolutly with you that using special Versions is a bad idea in general.
> > On the other hand, it was my fear that it may be difficult to prove that everything works properly with newer Libs even if the build succeeds.
> > It was hard work for me get it running and I was happy that everything works even with the known limitations. But i learned a lot ; )
>
> It seems to build fine with normal libraries and without all the
> manual copy hacks:
> https://patchwork.ozlabs.org/project/buildroot/list/?series=330091&submitter=&state=*&q=&archive=both&delegate=
>
> See if that works for you, I refactored your patchset and it seems to
> build without
> issues now using system libraries.
>
> I also uploaded that series to my personal github if that's easier for
> you to test:
> https://github.com/jameshilliard/buildroot/tree/tensorflow-lite
>
> >
> > Maybe it is the best to bump to Version 2.11.0 and they try it again with buildroot's own packages where they exist.
> > But this will take some time, maybe next year for the 23.04 Release.
>
> I bumped it to 2.11.0 and fixed the build issues I ran into:
> https://patchwork.ozlabs.org/project/buildroot/patch/20221125160724.1725476-8-james.hilliard1@gmail.com/
>
> >
> > And next time i need to add the [Buildroot] tag to the subject so my mail sorting rule will work for my own mails...
>
> I think you also accidentally dropped the mailing list from your reply as well.
>
> >
> > Best Regards
> > Stefan
> >
> >
> >
> >
> > From: James Hilliard <james.hilliard1@gmail.com>
> > Sent: Thursday, November 24, 2022 15:54
> > To: Hager Stefan <Stefan.Hager@ginzinger.com>
> > Cc: buildroot@buildroot.org <buildroot@buildroot.org>; Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> > Subject: Re: [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package
> >
> > On Thu, Nov 24, 2022 at 10:14 AM Stefan Hager
> > <stefan.hager@ginzinger.com> wrote:
> > >
> > > 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.
> >
> > This is an outdated release right? Are there issues with 2.11.0?
> >
> > >
> > > 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.
> >
> > I'm unable to find any documentation indicating this is actually the case.
> >
> > I skimmed the cmakelists and it doesn't seem to have strict version
> > requirements:
> > https://github.com/tensorflow/tensorflow/blob/v2.11.0/tensorflow/lite/CMakeLists.txt
> >
> > Have you tried building against the normal buildroot versions of these packages?
> >
> > > 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.
> >
> > This is probably not the right approach, other packages may depend on
> > or select the normal versions(flatbuffers seems especially problematic).
> >
> > >
> > > 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
> > >
> > > _______________________________________________
> > > buildroot mailing list
> > > buildroot@buildroot.org
> > > https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package
2022-11-28 18:02 ` James Hilliard
@ 2022-11-30 6:43 ` Hager Stefan
0 siblings, 0 replies; 19+ messages in thread
From: Hager Stefan @ 2022-11-30 6:43 UTC (permalink / raw)
To: James Hilliard; +Cc: buildroot@buildroot.org
[-- Attachment #1.1: Type: text/plain, Size: 26828 bytes --]
Hi James!
Thanks for integrating the patch. I can confirm that it fixes the build issues of the label_image example.
It also run it on the target and the inference results of two tests were equal to previous tests with tensorflow-lite v2.8.0.
From my point of view it may be merged to master.
Best regards
Stefan
From: James Hilliard <james.hilliard1@gmail.com>
Sent: Monday, November 28, 2022 19:02
To: Hager Stefan <Stefan.Hager@ginzinger.com>
Cc: buildroot@buildroot.org <buildroot@buildroot.org>
Subject: Re: [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package
On Mon, Nov 28, 2022 at 11:17 AM Hager Stefan
<Stefan.Hager@ginzinger.com> wrote:
>
> Hi James!
>
> Thanks four your great work!
> I was able to successfully build it.
>
> Unfortunately i could not build (linking error) the example program label_image.
> I use this to verify if the inference results are the same across different Versions
> on the target hardware.
>
> This is what i did:
> $ make freescale_imx8mpevk_defconfig menuconfig
> => in Menuconfig: activated C++ Support in the Toolchain Section; activated tensorflow-lite; activated host environment-setup;
> $ make
> # everything built fine
>
> $ source output/host/environment-setup
> $ cd output/build/tensorflow-lite-2.11.0/tensorflow/lite/buildroot-build/examples/label_image/
> $ make label_image
> # linking error, full log:
>
> Consolidate compiler generated dependencies of target fft2d_fftsg
> [ 1%] Built target fft2d_fftsg
> Consolidate compiler generated dependencies of target farmhash
> [ 1%] Built target farmhash
> Consolidate compiler generated dependencies of target fft2d_fftsg2d
> [ 1%] Built target fft2d_fftsg2d
> Consolidate compiler generated dependencies of target tensorflow-lite
> [ 94%] Built target tensorflow-lite
> [ 94%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/bitmap_helpers.cc.o
> [ 95%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/label_image.cc.o
> [ 95%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/xxx/buildroot/output/build/tensorflow-lite-2.11.0/tensorflow/core/util/stats_calculator.cc.o
> [ 96%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/profiling/memory_info.cc.o
> [ 96%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/profiling/profile_summarizer.cc.o
> [ 96%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/profiling/profile_summary_formatter.cc.o
> [ 97%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/profiling/time.cc.o
> [ 97%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/tools/command_line_flags.cc.o
> [ 98%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/tools/delegates/default_execution_provider.cc.o
> [ 98%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/tools/delegates/delegate_provider.cc.o
> [ 98%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/tools/evaluation/utils.cc.o
> [100%] Building CXX object examples/label_image/CMakeFiles/label_image.dir/__/__/tools/tool_params.cc.o
> [100%] Linking CXX executable label_image
> xxx/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: ../../libtensorflow-lite.so: undefined reference to `tsl::profiler::TraceMeRecorder::Record(tsl::profiler::TraceMeRecorder::Event&&)'
> xxx/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: ../../libtensorflow-lite.so: undefined reference to `tsl::profiler::internal::g_trace_level'
> xxx/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: ../../libtensorflow-lite.so: undefined reference to `tensorflow::profiler::ScopedMemoryDebugAnnotation::ThreadMemoryDebugAnnotation()'
> xxx/buildroot/output/host/lib/gcc/aarch64-buildroot-linux-gnu/11.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld: ../../libtensorflow-lite.so: undefined reference to `tsl::profiler::GetCurrentTimeNanos()'
> collect2: error: ld returned 1 exit status
> make[3]: *** [examples/label_image/CMakeFiles/label_image.dir/build.make:351: examples/label_image/label_image] Error 1
> make[2]: *** [CMakeFiles/Makefile2:436: examples/label_image/CMakeFiles/label_image.dir/all] Error 2
> make[1]: *** [CMakeFiles/Makefile2:443: examples/label_image/CMakeFiles/label_image.dir/rule] Error 2
> make: *** [Makefile:166: examples/label_image/CMakeFiles/label_image.dir/rule] Error 2
>
> This did peviously work with tensorflow-lite v2.8.
> Maybe i am missing something?
>
> I guess this is broken in v2.11.0.
> A fix may be in their master: https://github.com/tensorflow/tensorflow/commit/8562f9764937db51a4742fd10057463880579329
Fix is in master but it's not that specific commit, should be this one:
https://github.com/tensorflow/tensorflow/commit/081c2e4e3cf021efb2853a485a18b563e88f6117
Pushed the fix to my github branch and v2 series:
https://patchwork.ozlabs.org/project/buildroot/patch/20221128175851.1913859-8-james.hilliard1@gmail.com/
> I can try to use their master branch to see if that issue was addressed in the next days. Alternatively i can Test v2.10.1.
>
> Maybe we need to wait for the next release v2.12?
>
> Best Regards
> Stefan
>
> From: James Hilliard <james.hilliard1@gmail.com>
> Sent: Friday, November 25, 2022 17:16
> To: Hager Stefan <Stefan.Hager@ginzinger.com>
> Cc: buildroot <buildroot@buildroot.org>; Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Subject: Re: [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package
>
> On Fri, Nov 25, 2022 at 5:07 AM Hager Stefan <Stefan.Hager@ginzinger.com> wrote:
> >
> > Hi James!
> >
> > Tanks for your Feedback!
> >
> > Yes TFlite 2.8.0 is not the "latest" Release.
> >
> > I'm absolutly with you that using special Versions is a bad idea in general.
> > On the other hand, it was my fear that it may be difficult to prove that everything works properly with newer Libs even if the build succeeds.
> > It was hard work for me get it running and I was happy that everything works even with the known limitations. But i learned a lot ; )
>
> It seems to build fine with normal libraries and without all the
> manual copy hacks:
> https://patchwork.ozlabs.org/project/buildroot/list/?series=330091&submitter=&state=*&q=&archive=both&delegate=
>
> See if that works for you, I refactored your patchset and it seems to
> build without
> issues now using system libraries.
>
> I also uploaded that series to my personal github if that's easier for
> you to test:
> https://github.com/jameshilliard/buildroot/tree/tensorflow-lite
>
> >
> > Maybe it is the best to bump to Version 2.11.0 and they try it again with buildroot's own packages where they exist.
> > But this will take some time, maybe next year for the 23.04 Release.
>
> I bumped it to 2.11.0 and fixed the build issues I ran into:
> https://patchwork.ozlabs.org/project/buildroot/patch/20221125160724.1725476-8-james.hilliard1@gmail.com/
>
> >
> > And next time i need to add the [Buildroot] tag to the subject so my mail sorting rule will work for my own mails...
>
> I think you also accidentally dropped the mailing list from your reply as well.
>
> >
> > Best Regards
> > Stefan
> >
> >
> >
> >
> > From: James Hilliard <james.hilliard1@gmail.com>
> > Sent: Thursday, November 24, 2022 15:54
> > To: Hager Stefan <Stefan.Hager@ginzinger.com>
> > Cc: buildroot@buildroot.org <buildroot@buildroot.org>; Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> > Subject: Re: [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package
> >
> > On Thu, Nov 24, 2022 at 10:14 AM Stefan Hager
> > <stefan.hager@ginzinger.com> wrote:
> > >
> > > 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.
> >
> > This is an outdated release right? Are there issues with 2.11.0?
> >
> > >
> > > 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.
> >
> > I'm unable to find any documentation indicating this is actually the case.
> >
> > I skimmed the cmakelists and it doesn't seem to have strict version
> > requirements:
> > https://github.com/tensorflow/tensorflow/blob/v2.11.0/tensorflow/lite/CMakeLists.txt
> >
> > Have you tried building against the normal buildroot versions of these packages?
> >
> > > 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.
> >
> > This is probably not the right approach, other packages may depend on
> > or select the normal versions(flatbuffers seems especially problematic).
> >
> > >
> > > 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
> > >
> > > _______________________________________________
> > > buildroot mailing list
> > > buildroot@buildroot.org
> > > https://lists.buildroot.org/mailman/listinfo/buildroot
>
>
> From: James Hilliard <james.hilliard1@gmail.com>
> Sent: Friday, November 25, 2022 17:16
> To: Hager Stefan <Stefan.Hager@ginzinger.com>
> Cc: buildroot <buildroot@buildroot.org>; Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Subject: Re: [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package
>
> On Fri, Nov 25, 2022 at 5:07 AM Hager Stefan <Stefan.Hager@ginzinger.com> wrote:
> >
> > Hi James!
> >
> > Tanks for your Feedback!
> >
> > Yes TFlite 2.8.0 is not the "latest" Release.
> >
> > I'm absolutly with you that using special Versions is a bad idea in general.
> > On the other hand, it was my fear that it may be difficult to prove that everything works properly with newer Libs even if the build succeeds.
> > It was hard work for me get it running and I was happy that everything works even with the known limitations. But i learned a lot ; )
>
> It seems to build fine with normal libraries and without all the
> manual copy hacks:
> https://patchwork.ozlabs.org/project/buildroot/list/?series=330091&submitter=&state=*&q=&archive=both&delegate=
>
> See if that works for you, I refactored your patchset and it seems to
> build without
> issues now using system libraries.
>
> I also uploaded that series to my personal github if that's easier for
> you to test:
> https://github.com/jameshilliard/buildroot/tree/tensorflow-lite
>
> >
> > Maybe it is the best to bump to Version 2.11.0 and they try it again with buildroot's own packages where they exist.
> > But this will take some time, maybe next year for the 23.04 Release.
>
> I bumped it to 2.11.0 and fixed the build issues I ran into:
> https://patchwork.ozlabs.org/project/buildroot/patch/20221125160724.1725476-8-james.hilliard1@gmail.com/
>
> >
> > And next time i need to add the [Buildroot] tag to the subject so my mail sorting rule will work for my own mails...
>
> I think you also accidentally dropped the mailing list from your reply as well.
>
> >
> > Best Regards
> > Stefan
> >
> >
> >
> >
> > From: James Hilliard <james.hilliard1@gmail.com>
> > Sent: Thursday, November 24, 2022 15:54
> > To: Hager Stefan <Stefan.Hager@ginzinger.com>
> > Cc: buildroot@buildroot.org <buildroot@buildroot.org>; Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> > Subject: Re: [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package
> >
> > On Thu, Nov 24, 2022 at 10:14 AM Stefan Hager
> > <stefan.hager@ginzinger.com> wrote:
> > >
> > > 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.
> >
> > This is an outdated release right? Are there issues with 2.11.0?
> >
> > >
> > > 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.
> >
> > I'm unable to find any documentation indicating this is actually the case.
> >
> > I skimmed the cmakelists and it doesn't seem to have strict version
> > requirements:
> > https://github.com/tensorflow/tensorflow/blob/v2.11.0/tensorflow/lite/CMakeLists.txt
> >
> > Have you tried building against the normal buildroot versions of these packages?
> >
> > > 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.
> >
> > This is probably not the right approach, other packages may depend on
> > or select the normal versions(flatbuffers seems especially problematic).
> >
> > >
> > > 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
> > >
> > > _______________________________________________
> > > buildroot mailing list
> > > buildroot@buildroot.org
> > > https://lists.buildroot.org/mailman/listinfo/buildroot
[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 4625 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2022-11-30 6:43 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-24 14:06 [Buildroot] [RFC PATCH 00/10] tensorflow-lite: new package Stefan Hager
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 01/10] tensorflow-lite-abseil-cpp: " Stefan Hager
2022-11-24 14:46 ` Thomas Petazzoni via buildroot
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 02/10] tensorflow-lite-clog: " Stefan Hager
2022-11-24 14:48 ` Thomas Petazzoni via buildroot
2022-11-25 16:21 ` James Hilliard
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 03/10] tensorflow-lite-abseil-cpuinfo: " Stefan Hager
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 04/10] tensorflow-lite-eigen: " Stefan Hager
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 05/10] tensorflow-lite-farmhash: " Stefan Hager
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 06/10] tensorflow-lite-fft2d: " Stefan Hager
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 07/10] tensorflow-lite-flatbuffers: " Stefan Hager
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 08/10] tensorflow-lite-gemmlowp: " Stefan Hager
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 09/10] tensorflow-lite-ruy: " Stefan Hager
2022-11-24 14:06 ` [Buildroot] [RFC PATCH 10/10] tensorflow-lite: " Stefan Hager
2022-11-24 14:54 ` [Buildroot] [RFC PATCH 00/10] " James Hilliard
[not found] ` <AM5PR06MB315361D4448EE9C17B1C3F65840E9@AM5PR06MB3153.eurprd06.prod.outlook.com>
2022-11-25 16:16 ` James Hilliard
2022-11-28 15:17 ` Hager Stefan
2022-11-28 18:02 ` James Hilliard
2022-11-30 6:43 ` Hager Stefan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox