* Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4
@ 2020-12-16 13:07 hongxu
2020-12-16 13:07 ` [meta-tensorflow][PATCH 1/25] openjdk-8-native: 212b04 -> 275b01 hongxu
` (24 more replies)
0 siblings, 25 replies; 33+ messages in thread
From: hongxu @ 2020-12-16 13:07 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
# Build and Run
## 1. Clone away
```
$ mkdir <ts-project>
$ cd <ts-project>
$ git clone git://git.yoctoproject.org/meta-tensorflow
$ git clone git://git.openembedded.org/meta-openembedded
$ git clone git://git.openembedded.org/openembedded-core oe-core
$ cd oe-core
$ git clone git://git.openembedded.org/bitbake
```
## 2. Prepare build
```
$ . <ts-project>/oe-core/oe-init-build-env <build>
# Build qemux86-64 which runqemu supports kvm.
$ echo 'MACHINE = "qemux86-64"' >> conf/local.conf
$ echo 'IMAGE_INSTALL_append = " tensorflow"' >> conf/local.conf
Edit conf/bblayers.conf to include other layers
BBLAYERS ?= " \
<ts-project>/oe-core/meta \
<ts-project>/meta-openembedded/meta-python \
<ts-project>/meta-openembedded/meta-oe \
<ts-project>/meta-tensorflow \
"
```
## 3. Build image
```
cd <build>
$ bitbake core-image-minimal
```
## 4. Start qemu with slrip + kvm + 5GB memory:
```
$ runqemu qemux86-64 core-image-minimal slirp kvm qemuparams="-m 5120"
```
## 5. Verify the install
```
root@qemux86-64:~# python3 -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
tf.Tensor(-3304.6208, shape=(), dtype=float32)
## 6. Run tutorial case
### Refer: https://www.tensorflow.org/tutorials
```
root@qemux86-64:~# cat >code-v2.py <<ENDOF
import tensorflow as tf
mnist = tf.keras.datasets.mnist
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0
model = tf.keras.models.Sequential([
tf.keras.layers.Flatten(input_shape=(28, 28)),
tf.keras.layers.Dense(128, activation='relu'),
tf.keras.layers.Dropout(0.2),
tf.keras.layers.Dense(10)
])
predictions = model(x_train[:1]).numpy()
tf.nn.softmax(predictions).numpy()
loss_fn = tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True)
loss_fn(y_train[:1], predictions).numpy()
model.compile(optimizer='adam',
loss=loss_fn,
metrics=['accuracy'])
model.fit(x_train, y_train, epochs=5)
model.evaluate(x_test, y_test, verbose=2)
probability_model = tf.keras.Sequential([
model,
tf.keras.layers.Softmax()
])
probability_model(x_test[:5])
ENDOF
root@qemux86-64:~# python3 ./code-v2.py
2020-12-15 08:16:44.171593: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:116] None of the MLIR optimization passes are enabled (registered 2)
2020-12-15 08:16:44.184464: I tensorflow/core/platform/profile_utils/cpu_utils.cc:112] CPU Frequency: 3099995000 Hz
Epoch 1/5
1875/1875 [==============================] - 14s 7ms/step - loss: 0.4833 - accuracy: 0.8595
Epoch 2/5
1875/1875 [==============================] - 13s 7ms/step - loss: 0.1549 - accuracy: 0.9558
Epoch 3/5
1875/1875 [==============================] - 13s 7ms/step - loss: 0.1135 - accuracy: 0.9651
Epoch 4/5
1875/1875 [==============================] - 13s 7ms/step - loss: 0.0889 - accuracy: 0.9729
Epoch 5/5
1875/1875 [==============================] - 13s 7ms/step - loss: 0.0741 - accuracy: 0.9777
313/313 - 1s - loss: 0.0757 - accuracy: 0.9757
```
## 7. TensorFlow/TensorFlow Lite C++ Image Recognition Demo
```
root@qemux86-64:~# time label_image
2020-12-15 08:18:34.853885: I tensorflow/core/platform/profile_utils/cpu_utils.cc:112] CPU Frequency: 3099995000 Hz
2020-12-15 08:18:41.565167: I tensorflow/examples/label_image/main.cc:252] military uniform (653): 0.834306
2020-12-15 08:18:41.567874: I tensorflow/examples/label_image/main.cc:252] mortarboard (668): 0.0218696
2020-12-15 08:18:41.568936: I tensorflow/examples/label_image/main.cc:252] academic gown (401): 0.0103581
2020-12-15 08:18:41.569985: I tensorflow/examples/label_image/main.cc:252] pickelhaube (716): 0.00800819
2020-12-15 08:18:41.571025: I tensorflow/examples/label_image/main.cc:252] bulletproof vest (466): 0.00535086
real 0m7.178s
user 0m6.101s
sys 0m0.893s
root@qemux86-64:~# time label_image.lite
INFO: Loaded model /usr/share/label_image/mobilenet_v1_1.0_224_quant.tflite
INFO: resolved reporter
INFO: invoked
INFO: average time: 213.584 ms
INFO: 0.780392: 653 military uniform
INFO: 0.105882: 907 Windsor tie
INFO: 0.0156863: 458 bow tie
INFO: 0.0117647: 466 bulletproof vest
INFO: 0.00784314: 835 suit
real 0m0.233s
user 0m0.216s
sys 0m0.012s
^ permalink raw reply [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 1/25] openjdk-8-native: 212b04 -> 275b01
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
@ 2020-12-16 13:07 ` hongxu
2020-12-16 16:49 ` [yocto] " Kent Dorfman
2020-12-16 13:07 ` [meta-tensorflow][PATCH 2/25] bazel-native: 0.21.0 -> 3.1.0 hongxu
` (23 subsequent siblings)
24 siblings, 1 reply; 33+ messages in thread
From: hongxu @ 2020-12-16 13:07 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
...njdk-8-native_212b04.bb => openjdk-8-native_275b01.bb} | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
rename recipes-devtools/openjdk/{openjdk-8-native_212b04.bb => openjdk-8-native_275b01.bb} (78%)
diff --git a/recipes-devtools/openjdk/openjdk-8-native_212b04.bb b/recipes-devtools/openjdk/openjdk-8-native_275b01.bb
similarity index 78%
rename from recipes-devtools/openjdk/openjdk-8-native_212b04.bb
rename to recipes-devtools/openjdk/openjdk-8-native_275b01.bb
index 788612a..dcc1780 100644
--- a/recipes-devtools/openjdk/openjdk-8-native_212b04.bb
+++ b/recipes-devtools/openjdk/openjdk-8-native_275b01.bb
@@ -3,13 +3,13 @@ builds using source code from OpenJDK project"
LICENSE = "GPL-2.0-with-classpath-exception"
LIC_FILES_CHKSUM = "file://LICENSE;md5=3e0b59f8fac05c3c03d4a26bbda13f8f"
-SRC_URI[md5sum] = "8082ad8dafec378f2a4b24cbfdb4a9a4"
-SRC_URI[sha256sum] = "ef6a3050a1c3477a6e13c24d10ab36decad548649a260559d466467401db15de"
+SRC_URI[md5sum] = "52c1f769ab67b58b4300713fb5d46a47"
+SRC_URI[sha256sum] = "fccaa6cc14571813dbb427ac08d5acd034782a2654e6090ad4d63e7200011ac4"
SRC_URI = " \
- https://github.com/ojdkbuild/contrib_jdk8u-ci/releases/download/jdk8u212-b04/jdk-8u212-ojdkbuild-linux-x64.zip \
+ https://github.com/ojdkbuild/contrib_jdk8u-ci/releases/download/jdk8u275-b01/jdk-8u275-ojdkbuild-linux-x64.zip \
"
-S = "${WORKDIR}/jdk-8u212-ojdkbuild-linux-x64"
+S = "${WORKDIR}/jdk-8u275-ojdkbuild-linux-x64"
do_patch[noexec] = "1"
do_configure[noexec] = "1"
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 2/25] bazel-native: 0.21.0 -> 3.1.0
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
2020-12-16 13:07 ` [meta-tensorflow][PATCH 1/25] openjdk-8-native: 212b04 -> 275b01 hongxu
@ 2020-12-16 13:07 ` hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 3/25] tensorflow: 1.13.0 -> 2.4.0 hongxu
` (22 subsequent siblings)
24 siblings, 0 replies; 33+ messages in thread
From: hongxu @ 2020-12-16 13:07 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
Rebase patches to 3.1.0:
- 0001-HttpDownloader-save-download-tarball-to-distdir.patch
- 0001-fix-unzip-command-not-found.patch
- 0001-python3.patch
Drop backport patch:
- 0001-Rename-gettid-functions.patch
Tweak options according to [1]
[1] https://docs.bazel.build/versions/master/install-compile-source.html#bootstrap-unix-bootstrap
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
...native_0.21.0.bb => bazel-native_3.1.0.bb} | 7 +-
...der-save-download-tarball-to-distdir.patch | 119 ++++++++++--------
.../files/0001-Rename-gettid-functions.patch | 65 ----------
.../0001-fix-unzip-command-not-found.patch | 20 +--
.../bazel/files/0001-python3.patch | 32 ++---
5 files changed, 95 insertions(+), 148 deletions(-)
rename recipes-devtools/bazel/{bazel-native_0.21.0.bb => bazel-native_3.1.0.bb} (77%)
delete mode 100644 recipes-devtools/bazel/files/0001-Rename-gettid-functions.patch
diff --git a/recipes-devtools/bazel/bazel-native_0.21.0.bb b/recipes-devtools/bazel/bazel-native_3.1.0.bb
similarity index 77%
rename from recipes-devtools/bazel/bazel-native_0.21.0.bb
rename to recipes-devtools/bazel/bazel-native_3.1.0.bb
index f1baa33..f3efde1 100644
--- a/recipes-devtools/bazel/bazel-native_0.21.0.bb
+++ b/recipes-devtools/bazel/bazel-native_3.1.0.bb
@@ -2,12 +2,11 @@ DESCRIPTION = "Bazel build and test tool"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
-SRC_URI[md5sum] = "8c8240b178a35c0f3c1bc03017550270"
-SRC_URI[sha256sum] = "6ccb831e683179e0cfb351cb11ea297b4db48f9eab987601c038aa0f83037db4"
+SRC_URI[md5sum] = "381ca27503c566ce5e489d1ba07d1d25"
+SRC_URI[sha256sum] = "d7f40d0cac95a06cea6cb5b7f7769085257caebc3ee84269dd9298da760d5615"
SRC_URI = "https://github.com/bazelbuild/bazel/releases/download/${PV}/bazel-${PV}-dist.zip \
file://0001-HttpDownloader-save-download-tarball-to-distdir.patch \
- file://0001-Rename-gettid-functions.patch \
file://0001-fix-unzip-command-not-found.patch \
file://0001-python3.patch \
"
@@ -30,7 +29,7 @@ do_compile () {
export JAVA_HOME="${STAGING_LIBDIR_NATIVE}/jvm/openjdk-8-native"
TMPDIR="${TOPDIR}/bazel" \
VERBOSE=yes \
- EXTRA_BAZEL_ARGS="--distdir=${TS_DL_DIR} --python_path=python3" \
+ EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk --python_path=python3" \
./compile.sh
}
diff --git a/recipes-devtools/bazel/files/0001-HttpDownloader-save-download-tarball-to-distdir.patch b/recipes-devtools/bazel/files/0001-HttpDownloader-save-download-tarball-to-distdir.patch
index 605756a..cdc270d 100644
--- a/recipes-devtools/bazel/files/0001-HttpDownloader-save-download-tarball-to-distdir.patch
+++ b/recipes-devtools/bazel/files/0001-HttpDownloader-save-download-tarball-to-distdir.patch
@@ -1,6 +1,6 @@
-From e31a37bc9cb53de5085e885b190652f994209cf6 Mon Sep 17 00:00:00 2001
+From 7225fc4a62a06b654fe7d04a2446a594888a7b8c Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Tue, 23 Apr 2019 05:21:40 -0400
+Date: Tue, 8 Dec 2020 10:58:52 +0800
Subject: [PATCH] HttpDownloader: save download tarball to distdir
It is helpful for collecting tarball url which supports offline build.
@@ -9,62 +9,75 @@ Upstream-Status: Inappropriate [oe specific]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
- .../repository/downloader/HttpDownloader.java | 50 ++++++++++++++--------
- 1 file changed, 32 insertions(+), 18 deletions(-)
+ .../downloader/DownloadManager.java | 62 ++++++++++++-------
+ 1 file changed, 38 insertions(+), 24 deletions(-)
-diff --git a/src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/HttpDownloader.java b/src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/HttpDownloader.java
-index 18d10d2..cf71ac4 100755
---- a/src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/HttpDownloader.java
-+++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/HttpDownloader.java
-@@ -204,26 +204,29 @@ public class HttpDownloader {
+diff --git a/src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/DownloadManager.java b/src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/DownloadManager.java
+index a89077e..ccaadb3 100755
+--- a/src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/DownloadManager.java
++++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/downloader/DownloadManager.java
+@@ -152,33 +152,36 @@ public class DownloadManager {
+ } else if (!dir.isDirectory()) {
eventHandler.handle(Event.warn("distdir " + dir + " is not a directory"));
} else {
- boolean match = false;
-- Path candidate = dir.getRelative(destination.getBaseName());
-- try {
-- match = RepositoryCache.getChecksum(KeyType.SHA256, candidate).equals(sha256);
-- } catch (IOException e) {
-- // Not finding anything in a distdir is a normal case, so handle it absolutely
-- // quietly. In fact, it is not uncommon to specify a whole list of dist dirs,
-- // with the asumption that only one will contain an entry.
-- }
-- if (match) {
-- if (isCachingByProvidedSha256) {
-- try {
-- repositoryCache.put(sha256, candidate, KeyType.SHA256);
-- } catch (IOException e) {
-- eventHandler.handle(
-- Event.warn("Failed to copy " + candidate + " to repository cache: " + e));
-+ String[] basenames = {destination.getBaseName(), destination.getBaseName()+"_"+sha256};
-+ for (String basename: basenames) {
-+ Path candidate = dir.getRelative(basename);
-+ try {
-+ match = RepositoryCache.getChecksum(KeyType.SHA256, candidate).equals(sha256);
-+ } catch (IOException e) {
-+ // Not finding anything in a distdir is a normal case, so handle it absolutely
-+ // quietly. In fact, it is not uncommon to specify a whole list of dist dirs,
-+ // with the asumption that only one will contain an entry.
-+ }
-+ if (match) {
-+ if (isCachingByProvidedSha256) {
-+ try {
-+ repositoryCache.put(sha256, candidate, KeyType.SHA256);
-+ } catch (IOException e) {
-+ eventHandler.handle(
-+ Event.warn("Failed to copy " + candidate + " to repository cache: " + e));
-+ }
+- for (String name : candidateFileNames) {
++ for (String candidateFileName : candidateFileNames) {
+ boolean match = false;
+- Path candidate = dir.getRelative(name);
+- try {
+- eventHandler.post(
+- new CacheProgress(
+- mainUrl.toString(), "Checking " + cacheKeyType + " of " + candidate));
+- match = RepositoryCache.getChecksum(cacheKeyType, candidate).equals(cacheKey);
+- } catch (IOException e) {
+- // Not finding anything in a distdir is a normal case, so handle it absolutely
+- // quietly. In fact, it is common to specify a whole list of dist dirs,
+- // with the assumption that only one will contain an entry.
+- } finally {
+- eventHandler.post(new CacheProgress(mainUrl.toString()));
+- }
+- if (match) {
+- if (isCachingByProvidedChecksum) {
+- try {
+- repositoryCache.put(cacheKey, candidate, cacheKeyType, canonicalId);
+- } catch (IOException e) {
+- eventHandler.handle(
+- Event.warn("Failed to copy " + candidate + " to repository cache: " + e));
++ String[] names = {candidateFileName, candidateFileName+"_"+cacheKey};
++ for (String name: names) {
++ Path candidate = dir.getRelative(name);
++ try {
++ eventHandler.post(
++ new CacheProgress(
++ mainUrl.toString(), "Checking " + cacheKeyType + " of " + candidate));
++ match = RepositoryCache.getChecksum(cacheKeyType, candidate).equals(cacheKey);
++ } catch (IOException e) {
++ // Not finding anything in a distdir is a normal case, so handle it absolutely
++ // quietly. In fact, it is common to specify a whole list of dist dirs,
++ // with the assumption that only one will contain an entry.
++ } finally {
++ eventHandler.post(new CacheProgress(mainUrl.toString()));
++ }
++ if (match) {
++ if (isCachingByProvidedChecksum) {
++ try {
++ repositoryCache.put(cacheKey, candidate, cacheKeyType, canonicalId);
++ } catch (IOException e) {
++ eventHandler.handle(
++ Event.warn("Failed to copy " + candidate + " to repository cache: " + e));
++ }
+ }
++ FileSystemUtils.createDirectoryAndParents(destination.getParentDirectory());
++ FileSystemUtils.copyFile(candidate, destination);
++ return destination;
}
-+ FileSystemUtils.createDirectoryAndParents(destination.getParentDirectory());
-+ FileSystemUtils.copyFile(candidate, destination);
-+ return destination;
+- FileSystemUtils.createDirectoryAndParents(destination.getParentDirectory());
+- FileSystemUtils.copyFile(candidate, destination);
+- return destination;
}
-- FileSystemUtils.createDirectoryAndParents(destination.getParentDirectory());
-- FileSystemUtils.copyFile(candidate, destination);
-- return destination;
}
}
- }
-@@ -264,6 +267,17 @@ public class HttpDownloader {
+@@ -200,6 +203,17 @@ public class DownloadManager {
eventHandler.handle(Event.info("SHA256 (" + urls.get(0) + ") = " + newSha256));
}
@@ -73,7 +86,7 @@ index 18d10d2..cf71ac4 100755
+ FileSystemUtils.createDirectoryAndParents(dir);
+
+ if (dir.isDirectory()) {
-+ Path dl_mirror = dir.getRelative(destination.getBaseName()+"_"+sha256);
++ Path dl_mirror = dir.getRelative(destination.getBaseName()+"_"+checksum.get().toString());
+ if (!dl_mirror.exists())
+ FileSystemUtils.copyFile(destination, dl_mirror);
+ }
@@ -83,5 +96,5 @@ index 18d10d2..cf71ac4 100755
}
--
-2.8.1
+2.18.2
diff --git a/recipes-devtools/bazel/files/0001-Rename-gettid-functions.patch b/recipes-devtools/bazel/files/0001-Rename-gettid-functions.patch
deleted file mode 100644
index ca37531..0000000
--- a/recipes-devtools/bazel/files/0001-Rename-gettid-functions.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From a0b885aeb95a7ae9e93aea303a1edde74f71edac Mon Sep 17 00:00:00 2001
-From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Fri, 3 Apr 2020 10:25:49 +0800
-Subject: [PATCH] Rename gettid() functions.
-
-glibc 2.30 will declare its own gettid; see
-https://sourceware.org/git/?p=glibc.git;a=commit;h=1d0fc213824eaa2a8f8c4385daaa698ee8fb7c92.
-Rename the grpc versions to avoid naming conflicts.
-
-Signed-off-by: Benjamin Peterson <benjamin@dropbox.com>
-Upstream-Status: Backport [https://github.com/grpc/grpc/commit/57586a1ca7f17b1916aed3dea4ff8de872dbf853]
-
-Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
----
- third_party/grpc/src/core/support/log_linux.c | 4 ++--
- third_party/grpc/src/core/support/log_posix.c | 4 ++--
- 2 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/third_party/grpc/src/core/support/log_linux.c b/third_party/grpc/src/core/support/log_linux.c
-index 93a0c1b..367c921 100755
---- a/third_party/grpc/src/core/support/log_linux.c
-+++ b/third_party/grpc/src/core/support/log_linux.c
-@@ -54,7 +54,7 @@
- #include <sys/syscall.h>
- #include <unistd.h>
-
--static long gettid(void) { return syscall(__NR_gettid); }
-+static long sys_gettid(void) { return syscall(__NR_gettid); }
-
- void gpr_log(const char *file, int line, gpr_log_severity severity,
- const char *format, ...) {
-@@ -95,7 +95,7 @@ void gpr_default_log(gpr_log_func_args *args) {
-
- gpr_asprintf(&prefix, "%s%s.%09d %7tu %s:%d]",
- gpr_log_severity_string(args->severity), time_buffer,
-- (int)(now.tv_nsec), gettid(), display_file, args->line);
-+ (int)(now.tv_nsec), sys_gettid(), display_file, args->line);
-
- fprintf(stderr, "%-60s %s\n", prefix, args->message);
- gpr_free(prefix);
-diff --git a/third_party/grpc/src/core/support/log_posix.c b/third_party/grpc/src/core/support/log_posix.c
-index 3ff171f..f0420a7 100755
---- a/third_party/grpc/src/core/support/log_posix.c
-+++ b/third_party/grpc/src/core/support/log_posix.c
-@@ -45,7 +45,7 @@
- #include <time.h>
- #include <pthread.h>
-
--static intptr_t gettid(void) { return (intptr_t)pthread_self(); }
-+static intptr_t sys_gettid(void) { return (intptr_t)pthread_self(); }
-
- void gpr_log(const char *file, int line, gpr_log_severity severity,
- const char *format, ...) {
-@@ -95,7 +95,7 @@ void gpr_default_log(gpr_log_func_args *args) {
-
- fprintf(stderr, "%s%s.%09d %7tu %s:%d] %s\n",
- gpr_log_severity_string(args->severity), time_buffer,
-- (int)(now.tv_nsec), gettid(), display_file, args->line,
-+ (int)(now.tv_nsec), sys_gettid(), display_file, args->line,
- args->message);
- }
-
---
-2.17.1
-
diff --git a/recipes-devtools/bazel/files/0001-fix-unzip-command-not-found.patch b/recipes-devtools/bazel/files/0001-fix-unzip-command-not-found.patch
index 9fc7f03..eccc34a 100644
--- a/recipes-devtools/bazel/files/0001-fix-unzip-command-not-found.patch
+++ b/recipes-devtools/bazel/files/0001-fix-unzip-command-not-found.patch
@@ -1,6 +1,6 @@
-From e00e75dc8bc3c1153633e1ba7cb98a0a58658e86 Mon Sep 17 00:00:00 2001
+From 23e2aff67a03127572641c7286e306c2a20990e2 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Sat, 4 Apr 2020 12:48:01 +0800
+Date: Tue, 8 Dec 2020 11:05:13 +0800
Subject: [PATCH] fix unzip: command not found
If host does not provide unzip, build bazel will fail even though
@@ -18,18 +18,18 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java
-index fc4aad75..e1686732 100755
+index 16252df..e7cd609 100755
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java
-@@ -420,7 +420,7 @@ public class BazelRuleClassProvider {
- // from the local machine. For now, this can be overridden with --action_env=PATH=<value>, so
- // at least there's a workaround.
- if (os != OS.WINDOWS) {
-- return "/bin:/usr/bin";
+@@ -469,7 +469,7 @@ public class BazelRuleClassProvider {
+ // Note that --action_env does not propagate to the host config, so it is not a viable
+ // workaround when a genrule is itself built in the host config (e.g. nested genrules). See
+ // #8536.
+- return "/bin:/usr/bin:/usr/local/bin";
+ return System.getenv("PATH");
}
- // Attempt to compute the MSYS root (the real Windows path of "/") from `sh`.
+ String newPath = "";
--
-2.17.1
+2.18.2
diff --git a/recipes-devtools/bazel/files/0001-python3.patch b/recipes-devtools/bazel/files/0001-python3.patch
index 50eaaf4..93eee2d 100644
--- a/recipes-devtools/bazel/files/0001-python3.patch
+++ b/recipes-devtools/bazel/files/0001-python3.patch
@@ -1,6 +1,6 @@
-From f3dcad42a53e78efdb87adbc98121dc66b53ec5f Mon Sep 17 00:00:00 2001
+From e43263d6163f7ba1622b268e93635bf42493f758 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Sun, 5 Apr 2020 23:40:31 +0800
+Date: Tue, 8 Dec 2020 11:09:44 +0800
Subject: [PATCH] set python3 interpreter
Since many distrobution choose python3, and drop python2,
@@ -20,28 +20,28 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
-index 0ff5d15..997cfc9 100755
+index 2c0ae4d..ae39cc9 100755
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
-@@ -185,7 +185,7 @@ public class BazelPythonSemantics implements PythonSemantics {
- .addOutput(executable)
- .setShellCommand(
- shExecutable,
-- "echo '#!/usr/bin/env python' | cat - "
-+ "echo '#!/usr/bin/env python3' | cat - "
- + zipFile.getExecPathString()
- + " > "
- + executable.getExecPathString())
+@@ -237,7 +237,7 @@ public class BazelPythonSemantics implements PythonSemantics {
+ PathFragment shExecutable = ShToolchain.getPathOrError(ruleContext);
+ // TODO(#8685): Remove this special-case handling as part of making the proper shebang a
+ // property of the Python toolchain configuration.
+- String pythonExecutableName = OS.getCurrent() == OS.OPENBSD ? "python3" : "python";
++ String pythonExecutableName = OS.getCurrent() == OS.OPENBSD ? "python3" : "python3";
+ ruleContext.registerAction(
+ new SpawnAction.Builder()
+ .addInput(zipFile)
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt
-index 129ce90..959e3a5 100755
+index 59c00e8..31d29a4 100755
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
- import os
- import re
+ from __future__ import absolute_import
+ from __future__ import division
--
-2.17.1
+2.18.2
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 3/25] tensorflow: 1.13.0 -> 2.4.0
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
2020-12-16 13:07 ` [meta-tensorflow][PATCH 1/25] openjdk-8-native: 212b04 -> 275b01 hongxu
2020-12-16 13:07 ` [meta-tensorflow][PATCH 2/25] bazel-native: 0.21.0 -> 3.1.0 hongxu
@ 2020-12-16 13:08 ` hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 4/25] add python3-gast 0.3.3 hongxu
` (21 subsequent siblings)
24 siblings, 0 replies; 33+ messages in thread
From: hongxu @ 2020-12-16 13:08 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
Refresh patches to 2.4.0
- 0001-support-musl.patch
- 0001-third_party-eigen_archive-workaround-ice-failure-whi.patch
- 0001-use-local-bazel-to-workaround-bazel-paralle-issue.patch
- 0001-add-yocto-toolchain-to-support-cross-compiling.patch
- 0001-fix-build-tensorflow-lite-examples-label_image-label.patch
- 0001-label_image.lite-tweak-default-model-location.patch
Drop backported patches
- 0001-Fix-TensorFlow-on-Python-3.8-logger-issue.patch
- 0001-Provide-overload-to-cope-with-const-ness-change-of-N.patch
- 0001-Rename-gettid-functions.patch
- 0001-SyntaxError-around-async-keyword-on-Python-3.7.patch
- 0001-fix-compilation-error.patch
Minor change on LICENSE, copy year
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
...ensorFlow-on-Python-3.8-logger-issue.patch | 55 --------
...-to-cope-with-const-ness-change-of-N.patch | 52 --------
.../files/0001-Rename-gettid-functions.patch | 125 ------------------
...r-around-async-keyword-on-Python-3.7.patch | 116 ----------------
...toolchain-to-support-cross-compiling.patch | 60 ++++-----
...flow-lite-examples-label_image-label.patch | 38 +++---
.../files/0001-fix-compilation-error.patch | 58 --------
...ge.lite-tweak-default-model-location.patch | 21 +--
.../tensorflow/files/0001-support-musl.patch | 39 +++---
...n_archive-workaround-ice-failure-whi.patch | 121 ++++++++++++-----
...el-to-workaround-bazel-paralle-issue.patch | 24 ++--
...e_1.13.0.bb => tensorflow-native_2.4.0.bb} | 0
recipes-framework/tensorflow/tensorflow.inc | 11 +-
...nsorflow_1.13.0.bb => tensorflow_2.4.0.bb} | 1 +
14 files changed, 183 insertions(+), 538 deletions(-)
delete mode 100644 recipes-framework/tensorflow/files/0001-Fix-TensorFlow-on-Python-3.8-logger-issue.patch
delete mode 100644 recipes-framework/tensorflow/files/0001-Provide-overload-to-cope-with-const-ness-change-of-N.patch
delete mode 100644 recipes-framework/tensorflow/files/0001-Rename-gettid-functions.patch
delete mode 100644 recipes-framework/tensorflow/files/0001-SyntaxError-around-async-keyword-on-Python-3.7.patch
delete mode 100644 recipes-framework/tensorflow/files/0001-fix-compilation-error.patch
rename recipes-framework/tensorflow/{tensorflow-native_1.13.0.bb => tensorflow-native_2.4.0.bb} (100%)
rename recipes-framework/tensorflow/{tensorflow_1.13.0.bb => tensorflow_2.4.0.bb} (99%)
diff --git a/recipes-framework/tensorflow/files/0001-Fix-TensorFlow-on-Python-3.8-logger-issue.patch b/recipes-framework/tensorflow/files/0001-Fix-TensorFlow-on-Python-3.8-logger-issue.patch
deleted file mode 100644
index 714cfed..0000000
--- a/recipes-framework/tensorflow/files/0001-Fix-TensorFlow-on-Python-3.8-logger-issue.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From db8840ea06bee6c8384d88edba2faa027ed74c02 Mon Sep 17 00:00:00 2001
-From: Yong Tang <yong.tang.github@outlook.com>
-Date: Sun, 3 Nov 2019 19:52:04 +0000
-Subject: [PATCH] Fix TensorFlow on Python 3.8 logger issue
-
-This fix tries to address the issue raised in 33799
-where running tensorflow on python 3.8 (Ubuntu 18.04)
-raised the following error:
-```
-TypeError: _logger_find_caller() takes from 0 to 1 positional arguments but 2 were given
-```
-
-The issue was that findCaller changed in Python 3.8
-
-This PR fixes the issue.
-
-This PR fixes 33799
-
-Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
-
-Upstream-Status: Backport [https://github.com/tensorflow/tensorflow/pull/33953/commits/ea3063c929c69f738bf65bc99dad1159803e772f]
-
-Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
----
- tensorflow/python/platform/tf_logging.py | 13 +++++++++++--
- 1 file changed, 11 insertions(+), 2 deletions(-)
-
-diff --git a/tensorflow/python/platform/tf_logging.py b/tensorflow/python/platform/tf_logging.py
-index 813bcb89be..4862e70e4d 100644
---- a/tensorflow/python/platform/tf_logging.py
-+++ b/tensorflow/python/platform/tf_logging.py
-@@ -57,9 +57,18 @@ def _get_caller(offset=3):
- f = f.f_back
- return None, None
-
--
- # The definition of `findCaller` changed in Python 3.2
--if _sys.version_info.major >= 3 and _sys.version_info.minor >= 2:
-+if _sys.version_info.major >= 3 and _sys.version_info.minor >= 8:
-+ def _logger_find_caller(stack_info=False, stacklevel=1): # pylint: disable=g-wrong-blank-lines
-+ code, frame = _get_caller(4)
-+ sinfo = None
-+ if stack_info:
-+ sinfo = '\n'.join(_traceback.format_stack())
-+ if code:
-+ return (code.co_filename, frame.f_lineno, code.co_name, sinfo)
-+ else:
-+ return '(unknown file)', 0, '(unknown function)', sinfo
-+elif _sys.version_info.major >= 3 and _sys.version_info.minor >= 2:
- def _logger_find_caller(stack_info=False): # pylint: disable=g-wrong-blank-lines
- code, frame = _get_caller(4)
- sinfo = None
---
-2.17.1
-
diff --git a/recipes-framework/tensorflow/files/0001-Provide-overload-to-cope-with-const-ness-change-of-N.patch b/recipes-framework/tensorflow/files/0001-Provide-overload-to-cope-with-const-ness-change-of-N.patch
deleted file mode 100644
index 8d9411c..0000000
--- a/recipes-framework/tensorflow/files/0001-Provide-overload-to-cope-with-const-ness-change-of-N.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 75ea0b31477d6ba9e990e296bbbd8ca4e7eebadf Mon Sep 17 00:00:00 2001
-From: Christian Sigg <csigg@google.com>
-Date: Fri, 26 Jun 2020 05:08:10 -0700
-Subject: [PATCH] Provide overload to cope with const-ness change of NumPy's
- PyUFuncGenericFunction.
-
-See https://github.com/tensorflow/tensorflow/issues/40688, https://github.com/tensorflow/tensorflow/pull/40654.
-
-PiperOrigin-RevId: 318452381
-Change-Id: Icc5152f2b020ef19882a49e3c86ac80bbe048d64
-
-Upstream-Status: Backport
-Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
-
----
- tensorflow/python/lib/core/bfloat16.cc | 8 +++++++-
- 1 file changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/tensorflow/python/lib/core/bfloat16.cc b/tensorflow/python/lib/core/bfloat16.cc
-index feb01f11a1..bb6b720feb 100644
---- a/tensorflow/python/lib/core/bfloat16.cc
-+++ b/tensorflow/python/lib/core/bfloat16.cc
-@@ -517,7 +517,7 @@ bool RegisterBfloat16Cast(int numpy_type, bool cast_is_safe) {
- }
-
- template <typename InType, typename OutType, typename Functor>
--void BinaryUFunc(char** args, npy_intp* dimensions, npy_intp* steps,
-+void BinaryUFunc(char** args, const npy_intp* dimensions, const npy_intp* steps,
- void* data) {
- const char* i0 = args[0];
- const char* i1 = args[1];
-@@ -532,11 +532,17 @@ void BinaryUFunc(char** args, npy_intp* dimensions, npy_intp* steps,
- }
- }
-
-+// Numpy changed const-ness of PyUFuncGenericFunction, provide overload.
- template <typename Functor>
- void CompareUFunc(char** args, npy_intp* dimensions, npy_intp* steps,
- void* data) {
- BinaryUFunc<bfloat16, npy_bool, Functor>(args, dimensions, steps, data);
- }
-+template <typename Functor>
-+void CompareUFunc(char** args, const npy_intp* dimensions,
-+ const npy_intp* steps, void* data) {
-+ BinaryUFunc<bfloat16, npy_bool, Functor>(args, dimensions, steps, data);
-+}
-
- struct Bfloat16EqFunctor {
- npy_bool operator()(bfloat16 a, bfloat16 b) { return a == b; }
---
-2.21.0
-
diff --git a/recipes-framework/tensorflow/files/0001-Rename-gettid-functions.patch b/recipes-framework/tensorflow/files/0001-Rename-gettid-functions.patch
deleted file mode 100644
index 1e42ad3..0000000
--- a/recipes-framework/tensorflow/files/0001-Rename-gettid-functions.patch
+++ /dev/null
@@ -1,125 +0,0 @@
-From cf196efd43e489c91e29f7509529a4cc1e68b8b2 Mon Sep 17 00:00:00 2001
-From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Fri, 3 Apr 2020 11:11:35 +0800
-Subject: [PATCH] Rename the grpc versions to avoid naming conflicts
-
-Backport patch from grpc upstream to fix grpc conflicts issue
-
-Upstream-Status: Backport
-
-Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
----
- tensorflow/workspace.bzl | 1 +
- .../0001-Rename-gettid-functions.patch | 88 +++++++++++++++++++
- 2 files changed, 89 insertions(+)
- create mode 100644 third_party/systemlibs/0001-Rename-gettid-functions.patch
-
-diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
-index a281803f41..66679e686d 100755
---- a/tensorflow/workspace.bzl
-+++ b/tensorflow/workspace.bzl
-@@ -466,6 +466,7 @@ def tf_workspace(path_prefix = "", tf_repo_name = ""):
- sha256 = "1aa84387232dda273ea8fdfe722622084f72c16f7b84bfc519ac7759b71cdc91",
- strip_prefix = "grpc-69b6c047bc767b4d80e7af4d00ccb7c45b683dae",
- system_build_file = clean_dep("//third_party/systemlibs:grpc.BUILD"),
-+ patch_file = clean_dep("//third_party/systemlibs:0001-Rename-gettid-functions.patch"),
- urls = [
- "https://mirror.bazel.build/github.com/grpc/grpc/archive/69b6c047bc767b4d80e7af4d00ccb7c45b683dae.tar.gz",
- "https://github.com/grpc/grpc/archive/69b6c047bc767b4d80e7af4d00ccb7c45b683dae.tar.gz",
-diff --git a/third_party/systemlibs/0001-Rename-gettid-functions.patch b/third_party/systemlibs/0001-Rename-gettid-functions.patch
-new file mode 100644
-index 0000000000..be338568ae
---- /dev/null
-+++ b/third_party/systemlibs/0001-Rename-gettid-functions.patch
-@@ -0,0 +1,88 @@
-+From fb56354fe381c705f930484117b01442a233063d Mon Sep 17 00:00:00 2001
-+From: Hongxu Jia <hongxu.jia@windriver.com>
-+Date: Fri, 3 Apr 2020 11:03:02 +0800
-+Subject: [PATCH] Rename gettid() functions.
-+
-+glibc 2.30 will declare its own gettid; see
-+https://sourceware.org/git/?p=glibc.git;a=commit;h=1d0fc213824eaa2a8f8c4385daaa698ee8fb7c92.
-+Rename the grpc versions to avoid naming conflicts.
-+
-+Signed-off-by: Benjamin Peterson <benjamin@dropbox.com>
-+Upstream-Status: Backport [https://github.com/grpc/grpc/commit/57586a1ca7f17b1916aed3dea4ff8de872dbf853]
-+
-+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
-+---
-+ src/core/lib/gpr/log_linux.cc | 4 ++--
-+ src/core/lib/gpr/log_posix.cc | 4 ++--
-+ src/core/lib/iomgr/ev_epollex_linux.cc | 4 ++--
-+ 3 files changed, 6 insertions(+), 6 deletions(-)
-+
-+diff --git a/src/core/lib/gpr/log_linux.cc b/src/core/lib/gpr/log_linux.cc
-+index 561276f..8b597b4 100644
-+--- a/src/core/lib/gpr/log_linux.cc
-++++ b/src/core/lib/gpr/log_linux.cc
-+@@ -40,7 +40,7 @@
-+ #include <time.h>
-+ #include <unistd.h>
-+
-+-static long gettid(void) { return syscall(__NR_gettid); }
-++static long sys_gettid(void) { return syscall(__NR_gettid); }
-+
-+ void gpr_log(const char* file, int line, gpr_log_severity severity,
-+ const char* format, ...) {
-+@@ -70,7 +70,7 @@ void gpr_default_log(gpr_log_func_args* args) {
-+ gpr_timespec now = gpr_now(GPR_CLOCK_REALTIME);
-+ struct tm tm;
-+ static __thread long tid = 0;
-+- if (tid == 0) tid = gettid();
-++ if (tid == 0) tid = sys_gettid();
-+
-+ timer = static_cast<time_t>(now.tv_sec);
-+ final_slash = strrchr(args->file, '/');
-+diff --git a/src/core/lib/gpr/log_posix.cc b/src/core/lib/gpr/log_posix.cc
-+index 0acb225..cd0b702 100644
-+--- a/src/core/lib/gpr/log_posix.cc
-++++ b/src/core/lib/gpr/log_posix.cc
-+@@ -30,7 +30,7 @@
-+ #include <string.h>
-+ #include <time.h>
-+
-+-static intptr_t gettid(void) { return (intptr_t)pthread_self(); }
-++static intptr_t sys_gettid(void) { return (intptr_t)pthread_self(); }
-+
-+ void gpr_log(const char* file, int line, gpr_log_severity severity,
-+ const char* format, ...) {
-+@@ -85,7 +85,7 @@ void gpr_default_log(gpr_log_func_args* args) {
-+ char* prefix;
-+ gpr_asprintf(&prefix, "%s%s.%09d %7tu %s:%d]",
-+ gpr_log_severity_string(args->severity), time_buffer,
-+- (int)(now.tv_nsec), gettid(), display_file, args->line);
-++ (int)(now.tv_nsec), sys_gettid(), display_file, args->line);
-+
-+ fprintf(stderr, "%-70s %s\n", prefix, args->message);
-+ gpr_free(prefix);
-+diff --git a/src/core/lib/iomgr/ev_epollex_linux.cc b/src/core/lib/iomgr/ev_epollex_linux.cc
-+index 06a382c..371bd19 100644
-+--- a/src/core/lib/iomgr/ev_epollex_linux.cc
-++++ b/src/core/lib/iomgr/ev_epollex_linux.cc
-+@@ -1150,7 +1150,7 @@ static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker,
-+ }
-+
-+ #ifndef NDEBUG
-+-static long gettid(void) { return syscall(__NR_gettid); }
-++static long sys_gettid(void) { return syscall(__NR_gettid); }
-+ #endif
-+
-+ /* pollset->mu lock must be held by the caller before calling this.
-+@@ -1170,7 +1170,7 @@ static grpc_error* pollset_work(grpc_pollset* pollset,
-+ #define WORKER_PTR (&worker)
-+ #endif
-+ #ifndef NDEBUG
-+- WORKER_PTR->originator = gettid();
-++ WORKER_PTR->originator = sys_gettid();
-+ #endif
-+ if (grpc_polling_trace.enabled()) {
-+ gpr_log(GPR_INFO,
-+--
-+2.17.1
-+
---
-2.17.1
-
diff --git a/recipes-framework/tensorflow/files/0001-SyntaxError-around-async-keyword-on-Python-3.7.patch b/recipes-framework/tensorflow/files/0001-SyntaxError-around-async-keyword-on-Python-3.7.patch
deleted file mode 100644
index 75cb572..0000000
--- a/recipes-framework/tensorflow/files/0001-SyntaxError-around-async-keyword-on-Python-3.7.patch
+++ /dev/null
@@ -1,116 +0,0 @@
-From 8abbdce7a7ec7428b7f657e313ee0b6642c1de76 Mon Sep 17 00:00:00 2001
-From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Thu, 14 Feb 2019 10:45:55 +0800
-Subject: [PATCH] SyntaxError around async keyword on Python 3.7
-
-Backport a fix from upstream astor to fix the error
-
-Upstream-Status: Pending
-
-Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
----
- tensorflow/workspace.bzl | 1 +
- ...-Don-t-use-async-as-a-keyword-argument-94.patch | 79 ++++++++++++++++++++++
- 2 files changed, 80 insertions(+)
- create mode 100644 third_party/systemlibs/0001-Don-t-use-async-as-a-keyword-argument-94.patch
-
-diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
-index aefab03..a281803 100755
---- a/tensorflow/workspace.bzl
-+++ b/tensorflow/workspace.bzl
-@@ -278,6 +278,7 @@ def tf_workspace(path_prefix = "", tf_repo_name = ""):
- tf_http_archive(
- name = "astor_archive",
- build_file = clean_dep("//third_party:astor.BUILD"),
-+ patch_file = clean_dep("//third_party/systemlibs:0001-Don-t-use-async-as-a-keyword-argument-94.patch"),
- sha256 = "ff6d2e2962d834acb125cc4dcc80c54a8c17c253f4cc9d9c43b5102a560bb75d",
- strip_prefix = "astor-0.6.2",
- system_build_file = clean_dep("//third_party/systemlibs:astor.BUILD"),
-diff --git a/third_party/systemlibs/0001-Don-t-use-async-as-a-keyword-argument-94.patch b/third_party/systemlibs/0001-Don-t-use-async-as-a-keyword-argument-94.patch
-new file mode 100644
-index 0000000..aafb172
---- /dev/null
-+++ b/third_party/systemlibs/0001-Don-t-use-async-as-a-keyword-argument-94.patch
-@@ -0,0 +1,79 @@
-+From fe1ef7f9d746847c157197e4cb2ab6505fe19faf Mon Sep 17 00:00:00 2001
-+From: Berker Peksag <berker.peksag@gmail.com>
-+Date: Fri, 23 Mar 2018 16:50:21 +0300
-+Subject: [PATCH] Don't use 'async' as a keyword argument (#94)
-+
-+Fixes #86
-+
-+Upstream-Status: Backport[https://github.com/berkerpeksag/astor.git]
-+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
-+---
-+ astor/code_gen.py | 18 +++++++++---------
-+ 1 file changed, 9 insertions(+), 9 deletions(-)
-+
-+diff --git a/astor/code_gen.py b/astor/code_gen.py
-+index 7c27f70..47d6acc 100644
-+--- a/astor/code_gen.py
-++++ b/astor/code_gen.py
-+@@ -308,8 +308,8 @@ class SourceGenerator(ExplicitNodeVisitor):
-+ self.statement(node)
-+ self.generic_visit(node)
-+
-+- def visit_FunctionDef(self, node, async=False):
-+- prefix = 'async ' if async else ''
-++ def visit_FunctionDef(self, node, is_async=False):
-++ prefix = 'async ' if is_async else ''
-+ self.decorators(node, 1 if self.indentation else 2)
-+ self.statement(node, '%sdef %s' % (prefix, node.name), '(')
-+ self.visit_arguments(node.args)
-+@@ -322,7 +322,7 @@ class SourceGenerator(ExplicitNodeVisitor):
-+
-+ # introduced in Python 3.5
-+ def visit_AsyncFunctionDef(self, node):
-+- self.visit_FunctionDef(node, async=True)
-++ self.visit_FunctionDef(node, is_async=True)
-+
-+ def visit_ClassDef(self, node):
-+ have_args = []
-+@@ -364,24 +364,24 @@ class SourceGenerator(ExplicitNodeVisitor):
-+ self.else_body(else_)
-+ break
-+
-+- def visit_For(self, node, async=False):
-++ def visit_For(self, node, is_async=False):
-+ set_precedence(node, node.target)
-+- prefix = 'async ' if async else ''
-++ prefix = 'async ' if is_async else ''
-+ self.statement(node, '%sfor ' % prefix,
-+ node.target, ' in ', node.iter, ':')
-+ self.body_or_else(node)
-+
-+ # introduced in Python 3.5
-+ def visit_AsyncFor(self, node):
-+- self.visit_For(node, async=True)
-++ self.visit_For(node, is_async=True)
-+
-+ def visit_While(self, node):
-+ set_precedence(node, node.test)
-+ self.statement(node, 'while ', node.test, ':')
-+ self.body_or_else(node)
-+
-+- def visit_With(self, node, async=False):
-+- prefix = 'async ' if async else ''
-++ def visit_With(self, node, is_async=False):
-++ prefix = 'async ' if is_async else ''
-+ self.statement(node, '%swith ' % prefix)
-+ if hasattr(node, "context_expr"): # Python < 3.3
-+ self.visit_withitem(node)
-+@@ -392,7 +392,7 @@ class SourceGenerator(ExplicitNodeVisitor):
-+
-+ # new for Python 3.5
-+ def visit_AsyncWith(self, node):
-+- self.visit_With(node, async=True)
-++ self.visit_With(node, is_async=True)
-+
-+ # new for Python 3.3
-+ def visit_withitem(self, node):
-+--
-+2.7.4
-+
---
-2.7.4
-
diff --git a/recipes-framework/tensorflow/files/0001-add-yocto-toolchain-to-support-cross-compiling.patch b/recipes-framework/tensorflow/files/0001-add-yocto-toolchain-to-support-cross-compiling.patch
index 5fa5f91..8b42572 100644
--- a/recipes-framework/tensorflow/files/0001-add-yocto-toolchain-to-support-cross-compiling.patch
+++ b/recipes-framework/tensorflow/files/0001-add-yocto-toolchain-to-support-cross-compiling.patch
@@ -1,6 +1,6 @@
-From dd303f745d159a2359c81922a2171a409998a71d Mon Sep 17 00:00:00 2001
+From d4d9365e0731afcfbc3a07bb97a689bf7da81151 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Thu, 31 Jan 2019 20:37:26 +0800
+Date: Wed, 9 Dec 2020 09:41:10 +0800
Subject: [PATCH] add yocto toolchain to support cross compiling
Upstream-Status: Inappropriate [oe specific]
@@ -15,12 +15,12 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
5 files changed, 27 insertions(+)
diff --git a/WORKSPACE b/WORKSPACE
-index 7057d3f..869c180 100644
+index 9db1d9b80eb..6aa952642f2 100644
--- a/WORKSPACE
+++ b/WORKSPACE
-@@ -53,6 +53,12 @@ android_configure(name="local_config_android")
- load("@local_config_android//:android.bzl", "android_workspace")
- android_workspace()
+@@ -12,6 +12,12 @@ http_archive(
+ ],
+ )
+new_local_repository(
+ name = "yocto_compiler",
@@ -28,17 +28,18 @@ index 7057d3f..869c180 100644
+ build_file = "//:BUILD.yocto_compiler",
+)
+
- # Please add all new TensorFlow dependencies in workspace.bzl.
- tf_workspace()
-
+ # Load tf_repositories() before loading dependencies for other repository so
+ # that dependencies like com_google_protobuf won't be overridden.
+ load("//tensorflow:workspace.bzl", "tf_repositories")
diff --git a/tensorflow/BUILD b/tensorflow/BUILD
-index 823ad8f..6270301 100644
+index 56b33a493fc..85e172afa03 100644
--- a/tensorflow/BUILD
+++ b/tensorflow/BUILD
-@@ -100,6 +100,15 @@ config_setting(
+@@ -125,6 +125,15 @@ config_setting(
+ visibility = ["//visibility:public"],
)
- config_setting(
++config_setting(
+ name = "yocto_armeabi",
+ values = {
+ "crosstool_top": "@local_config_yocto_compiler//:toolchain",
@@ -47,24 +48,23 @@ index 823ad8f..6270301 100644
+ visibility = ["//visibility:public"],
+)
+
-+config_setting(
+ config_setting(
name = "android_arm",
values = {
- "crosstool_top": "//external:android/crosstool",
diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
-index aefab03..12c6fab 100755
+index a6ea0094dde..f6c47187c54 100755
--- a/tensorflow/workspace.bzl
+++ b/tensorflow/workspace.bzl
-@@ -12,6 +12,7 @@ load("//third_party/sycl:sycl_configure.bzl", "sycl_configure")
- load("//third_party/systemlibs:syslibs_configure.bzl", "syslibs_configure")
+@@ -10,6 +10,7 @@ load("//third_party/systemlibs:syslibs_configure.bzl", "syslibs_configure")
+ load("//third_party/toolchains/remote:configure.bzl", "remote_execution_configure")
load("//third_party/toolchains/clang6:repo.bzl", "clang6_configure")
load("//third_party/toolchains/cpus/arm:arm_compiler_configure.bzl", "arm_compiler_configure")
+load("//third_party/toolchains/yocto:yocto_compiler_configure.bzl", "yocto_compiler_configure")
+ load("//third_party/toolchains/embedded/arm-linux:arm_linux_toolchain_configure.bzl", "arm_linux_toolchain_configure")
load("//third_party:repo.bzl", "tf_http_archive")
load("//third_party/clang_toolchain:cc_configure_clang.bzl", "cc_download_clang_toolchain")
- load("@io_bazel_rules_closure//closure/private:java_import_external.bzl", "java_import_external")
-@@ -76,6 +77,13 @@ def tf_workspace(path_prefix = "", tf_repo_name = ""):
- remote_config_repo = "../arm_compiler",
+@@ -116,6 +117,13 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):
+ remote_config_repo_aarch64 = "../aarch64_compiler",
)
+ # Point //external/local_config_yocto_compiler to //external/yocto_compiler
@@ -74,25 +74,25 @@ index aefab03..12c6fab 100755
+ remote_config_repo = "../yocto_compiler",
+ )
+
- mkl_repository(
- name = "mkl_linux",
- build_file = clean_dep("//third_party/mkl:mkl.BUILD"),
+ # TFLite crossbuild toolchain for embeddeds Linux
+ arm_linux_toolchain_configure(
+ name = "local_config_embedded_arm",
diff --git a/third_party/aws/BUILD.bazel b/third_party/aws/BUILD.bazel
-index 5426f79..b106b12 100644
+index d9e40703caa..e1058edaba4 100644
--- a/third_party/aws/BUILD.bazel
+++ b/third_party/aws/BUILD.bazel
-@@ -24,6 +24,9 @@ cc_library(
- "@org_tensorflow//tensorflow:raspberry_pi_armeabi": glob([
+@@ -30,6 +30,9 @@ cc_library(
+ "@org_tensorflow//tensorflow:freebsd": glob([
"aws-cpp-sdk-core/source/platform/linux-shared/*.cpp",
]),
+ "@org_tensorflow//tensorflow:yocto_armeabi": glob([
+ "aws-cpp-sdk-core/source/platform/linux-shared/*.cpp",
+ ]),
"//conditions:default": [],
- }) + glob([
- "aws-cpp-sdk-core/include/**/*.h",
+ }) + select({
+ "//conditions:default": glob([
diff --git a/third_party/repo.bzl b/third_party/repo.bzl
-index bad6d20..9823cab 100644
+index ef729b5223d..39ec07eb328 100644
--- a/third_party/repo.bzl
+++ b/third_party/repo.bzl
@@ -16,6 +16,7 @@
@@ -104,5 +104,5 @@ index bad6d20..9823cab 100644
def _is_windows(ctx):
--
-2.7.4
+2.18.2
diff --git a/recipes-framework/tensorflow/files/0001-fix-build-tensorflow-lite-examples-label_image-label.patch b/recipes-framework/tensorflow/files/0001-fix-build-tensorflow-lite-examples-label_image-label.patch
index ba40d51..10b25bd 100644
--- a/recipes-framework/tensorflow/files/0001-fix-build-tensorflow-lite-examples-label_image-label.patch
+++ b/recipes-framework/tensorflow/files/0001-fix-build-tensorflow-lite-examples-label_image-label.patch
@@ -1,6 +1,6 @@
-From 1930f8aabbfe00debd2914f759cb5ac263215d49 Mon Sep 17 00:00:00 2001
+From 6b0a33d63954991637903028af4cfdd9a59cff0b Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Sun, 24 Feb 2019 03:33:00 -0500
+Date: Wed, 9 Dec 2020 09:47:49 +0800
Subject: [PATCH] fix build //tensorflow/lite/examples/label_image:label_image
failure
@@ -16,37 +16,35 @@ Upstream-Status: Inappropriate [oe specific]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
- tensorflow/lite/kernels/internal/BUILD | 10 ++++++++++
- 1 file changed, 10 insertions(+)
+ tensorflow/lite/kernels/internal/BUILD | 8 ++++++++
+ 1 file changed, 8 insertions(+)
diff --git a/tensorflow/lite/kernels/internal/BUILD b/tensorflow/lite/kernels/internal/BUILD
-index 4be3226..959a9f0 100644
+index 94135c6adbe..9a07177e93a 100644
--- a/tensorflow/lite/kernels/internal/BUILD
+++ b/tensorflow/lite/kernels/internal/BUILD
-@@ -93,6 +93,13 @@ config_setting(
+@@ -116,6 +116,13 @@ config_setting(
+ },
)
- config_setting(
++config_setting(
+ name = "armeabi",
+ values = {
+ "cpu": "armeabi",
+ },
+)
+
-+config_setting(
+ config_setting(
name = "haswell",
values = {
- "cpu": "haswell",
-@@ -504,6 +511,9 @@ cc_library(
- ":armeabi-v7a": [
- ":neon_tensor_utils",
- ],
-+ ":armeabi": [
-+ ":neon_tensor_utils",
-+ ],
- ":armv7a": [
- ":neon_tensor_utils",
- ],
+@@ -772,6 +779,7 @@ cc_library(
+ ":arm",
+ ":arm64-v8a",
+ ":armeabi-v7a",
++ ":armeabi",
+ ":armhf",
+ ":armv7a",
+ ":ios_armv7",
--
-2.8.1
+2.18.2
diff --git a/recipes-framework/tensorflow/files/0001-fix-compilation-error.patch b/recipes-framework/tensorflow/files/0001-fix-compilation-error.patch
deleted file mode 100644
index 995b83b..0000000
--- a/recipes-framework/tensorflow/files/0001-fix-compilation-error.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From c1d33029372d7b4d3b5cc1d52d92c414c97ca763 Mon Sep 17 00:00:00 2001
-From: Chen Qi <Qi.Chen@windriver.com>
-Date: Fri, 21 Feb 2020 11:45:04 +0800
-Subject: [PATCH] fix compilation error
-
-This fix references https://github.com/tensorflow/tensorflow/issues/34197.
-
-Upstream-Status: Pending
-
-Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
----
- tensorflow/python/eager/pywrap_tfe_src.cc | 2 +-
- tensorflow/python/lib/core/bfloat16.cc | 2 +-
- tensorflow/python/lib/core/ndarray_tensor_bridge.cc | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/tensorflow/python/eager/pywrap_tfe_src.cc b/tensorflow/python/eager/pywrap_tfe_src.cc
-index 9ce500bc08..6c6cb215f2 100644
---- a/tensorflow/python/eager/pywrap_tfe_src.cc
-+++ b/tensorflow/python/eager/pywrap_tfe_src.cc
-@@ -1216,7 +1216,7 @@ static PyTypeObject TFE_Py_Tape_Type = {
- sizeof(TFE_Py_Tape), /* tp_basicsize */
- 0, /* tp_itemsize */
- &TFE_Py_Tape_Delete, /* tp_dealloc */
-- nullptr, /* tp_print */
-+ NULL, /* tp_print */
- nullptr, /* tp_getattr */
- nullptr, /* tp_setattr */
- nullptr, /* tp_reserved */
-diff --git a/tensorflow/python/lib/core/bfloat16.cc b/tensorflow/python/lib/core/bfloat16.cc
-index fde3a83770..9b8fa97958 100644
---- a/tensorflow/python/lib/core/bfloat16.cc
-+++ b/tensorflow/python/lib/core/bfloat16.cc
-@@ -317,7 +317,7 @@ PyTypeObject PyBfloat16_Type = {
- sizeof(PyBfloat16), // tp_basicsize
- 0, // tp_itemsize
- nullptr, // tp_dealloc
-- nullptr, // tp_print
-+ NULL, // tp_print
- nullptr, // tp_getattr
- nullptr, // tp_setattr
- nullptr, // tp_compare / tp_reserved
-diff --git a/tensorflow/python/lib/core/ndarray_tensor_bridge.cc b/tensorflow/python/lib/core/ndarray_tensor_bridge.cc
-index 0d5838505f..50c1f885f4 100644
---- a/tensorflow/python/lib/core/ndarray_tensor_bridge.cc
-+++ b/tensorflow/python/lib/core/ndarray_tensor_bridge.cc
-@@ -86,7 +86,7 @@ PyTypeObject TensorReleaserType = {
- 0, /* tp_itemsize */
- /* methods */
- TensorReleaser_dealloc, /* tp_dealloc */
-- nullptr, /* tp_print */
-+ NULL, /* tp_print */
- nullptr, /* tp_getattr */
- nullptr, /* tp_setattr */
- nullptr, /* tp_compare */
---
-2.17.1
-
diff --git a/recipes-framework/tensorflow/files/0001-label_image.lite-tweak-default-model-location.patch b/recipes-framework/tensorflow/files/0001-label_image.lite-tweak-default-model-location.patch
index 9185c54..597021a 100644
--- a/recipes-framework/tensorflow/files/0001-label_image.lite-tweak-default-model-location.patch
+++ b/recipes-framework/tensorflow/files/0001-label_image.lite-tweak-default-model-location.patch
@@ -1,32 +1,35 @@
-From 6d519e53de0a47cebb72111608f7424d7585c6bb Mon Sep 17 00:00:00 2001
+From dd73bef88a23d29299bc6e2f3c892ed81d65a86c Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Tue, 5 Mar 2019 22:06:34 -0500
+Date: Wed, 9 Dec 2020 09:53:30 +0800
Subject: [PATCH] label_image.lite: tweak default model location
Upstream-Status: Inappropriate [oe specific]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
- tensorflow/lite/examples/label_image/label_image.h | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
+ tensorflow/lite/examples/label_image/label_image.h | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/tensorflow/lite/examples/label_image/label_image.h b/tensorflow/lite/examples/label_image/label_image.h
-index 88b047f..c541fec 100644
+index 1c00edb6558..a5bcf8c64d8 100644
--- a/tensorflow/lite/examples/label_image/label_image.h
+++ b/tensorflow/lite/examples/label_image/label_image.h
-@@ -29,9 +29,9 @@ struct Settings {
+@@ -34,10 +34,12 @@ struct Settings {
int loop_count = 1;
float input_mean = 127.5f;
float input_std = 127.5f;
- string model_name = "./mobilenet_quant_v1_224.tflite";
++ string model_name = "/usr/share/label_image/mobilenet_v1_1.0_224_quant.tflite";
+ tflite::FlatBufferModel* model;
- string input_bmp_name = "./grace_hopper.bmp";
- string labels_file_name = "./labels.txt";
-+ string model_name = "/usr/share/label_image/mobilenet_v1_1.0_224_quant.tflite";
+ string input_bmp_name = "/usr/share/label_image/grace_hopper.bmp";
+ string labels_file_name = "/usr/share/label_image/labels_mobilenet_quant_v1_224.txt";
- string input_layer_type = "uint8_t";
++
++
int number_of_threads = 4;
int number_of_results = 5;
+ int max_profiling_buffer_entries = 1024;
--
-2.8.1
+2.18.2
diff --git a/recipes-framework/tensorflow/files/0001-support-musl.patch b/recipes-framework/tensorflow/files/0001-support-musl.patch
index f76041b..355b0cb 100644
--- a/recipes-framework/tensorflow/files/0001-support-musl.patch
+++ b/recipes-framework/tensorflow/files/0001-support-musl.patch
@@ -1,6 +1,6 @@
-From 02e58aa624aa6c330984474b9119c6b29a1ed77d Mon Sep 17 00:00:00 2001
+From a37010bee0ef08a2b42c10fc6ca1f3bd793b0e6a Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Thu, 14 Feb 2019 10:26:27 -0500
+Date: Tue, 8 Dec 2020 17:06:52 +0800
Subject: [PATCH] support musl
Build fails looking for `execinfo.h` when building against musl
@@ -10,40 +10,41 @@ Build fails looking for `execinfo.h` when building against musl
execinfo.h: No such file or directory
Upstream-Status: Pending
+
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
- tensorflow/core/platform/default/stacktrace.h | 3 ++-
- tensorflow/core/platform/stacktrace_handler.cc | 3 ++-
+ tensorflow/core/platform/default/stacktrace.h | 3 ++-
+ tensorflow/core/platform/default/stacktrace_handler.cc | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/tensorflow/core/platform/default/stacktrace.h b/tensorflow/core/platform/default/stacktrace.h
-index c8e297f..8fecf05 100644
+index 0a8c124ff51..db7945611d3 100644
--- a/tensorflow/core/platform/default/stacktrace.h
+++ b/tensorflow/core/platform/default/stacktrace.h
-@@ -18,7 +18,8 @@ limitations under the License.
-
+@@ -20,7 +20,8 @@ limitations under the License.
#include "tensorflow/core/platform/platform.h"
- #if !defined(IS_MOBILE_PLATFORM) && defined(PLATFORM_POSIX) && \
-- (defined(__clang__) || defined(__GNUC__))
-+ (defined(__clang__) || defined(__GNUC__)) && \
+ // clang-format on
+
+-#if !defined(IS_MOBILE_PLATFORM) && (defined(__clang__) || defined(__GNUC__))
++#if !defined(IS_MOBILE_PLATFORM) && (defined(__clang__) || defined(__GNUC__)) && \
+ defined(__GLIBC__)
- #define TF_GENERATE_BACKTRACE
+ #define TF_HAS_STACKTRACE
#endif
-diff --git a/tensorflow/core/platform/stacktrace_handler.cc b/tensorflow/core/platform/stacktrace_handler.cc
-index ff31c97..41d62f7 100644
---- a/tensorflow/core/platform/stacktrace_handler.cc
-+++ b/tensorflow/core/platform/stacktrace_handler.cc
+diff --git a/tensorflow/core/platform/default/stacktrace_handler.cc b/tensorflow/core/platform/default/stacktrace_handler.cc
+index 70fcdc27042..f38fe71c917 100644
+--- a/tensorflow/core/platform/default/stacktrace_handler.cc
++++ b/tensorflow/core/platform/default/stacktrace_handler.cc
@@ -16,7 +16,8 @@ limitations under the License.
#include "tensorflow/core/platform/platform.h"
- #if !defined(PLATFORM_GOOGLE) && !defined(IS_MOBILE_PLATFORM) && \
-- defined(PLATFORM_POSIX) && (defined(__clang__) || defined(__GNUC__))
-+ defined(PLATFORM_POSIX) && (defined(__clang__) || defined(__GNUC__)) && \
+ #if !defined(IS_MOBILE_PLATFORM) && defined(PLATFORM_POSIX) && \
+- (defined(__clang__) || defined(__GNUC__))
++ (defined(__clang__) || defined(__GNUC__)) && \
+ defined(__GLIBC__)
#define TF_GENERATE_STACKTRACE
#endif
--
-2.8.1
+2.18.2
diff --git a/recipes-framework/tensorflow/files/0001-third_party-eigen_archive-workaround-ice-failure-whi.patch b/recipes-framework/tensorflow/files/0001-third_party-eigen_archive-workaround-ice-failure-whi.patch
index 354e988..5b6c292 100644
--- a/recipes-framework/tensorflow/files/0001-third_party-eigen_archive-workaround-ice-failure-whi.patch
+++ b/recipes-framework/tensorflow/files/0001-third_party-eigen_archive-workaround-ice-failure-whi.patch
@@ -1,6 +1,6 @@
-From dc5a05a06ad107141a9914635cd96bf7d60b9c25 Mon Sep 17 00:00:00 2001
+From 66ce33e48d8e48743d923fe2c152079604c9c386 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Mon, 6 Apr 2020 16:09:01 +0800
+Date: Tue, 8 Dec 2020 17:42:01 +0800
Subject: [PATCH] third_party/eigen_archive:workaround ice failure while
building from source with gcc 7.3.1
@@ -14,34 +14,46 @@ Upstream-Status: Inappropriate [wr-installer specific]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
- tensorflow/workspace.bzl | 1 +
- ...ailure-while-building-from-source-wi.patch | 38 +++++++++++++++++++
- 2 files changed, 39 insertions(+)
- create mode 100644 third_party/systemlibs/0001-workaround-ice-failure-while-building-from-source-wi.patch
+ third_party/eigen3/gpu_packet_math.patch | 97 +++++++++++++++++-------
+ 1 file changed, 70 insertions(+), 27 deletions(-)
-diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
-index 66679e686d..983f6a19b4 100755
---- a/tensorflow/workspace.bzl
-+++ b/tensorflow/workspace.bzl
-@@ -138,6 +138,7 @@ def tf_workspace(path_prefix = "", tf_repo_name = ""):
- build_file = clean_dep("//third_party:eigen.BUILD"),
- sha256 = "753fbb58d0a49b6bcbcfb126ebfa2e21fc97f7471529ba835a096008ce588d8a",
- strip_prefix = "eigen-eigen-9f48e814419e",
-+ patch_file = clean_dep("//third_party/systemlibs:0001-workaround-ice-failure-while-building-from-source-wi.patch"),
- urls = [
- "https://mirror.bazel.build/bitbucket.org/eigen/eigen/get/9f48e814419e.tar.gz",
- "https://bitbucket.org/eigen/eigen/get/9f48e814419e.tar.gz",
-diff --git a/third_party/systemlibs/0001-workaround-ice-failure-while-building-from-source-wi.patch b/third_party/systemlibs/0001-workaround-ice-failure-while-building-from-source-wi.patch
-new file mode 100644
-index 0000000000..d6c06b61e6
---- /dev/null
-+++ b/third_party/systemlibs/0001-workaround-ice-failure-while-building-from-source-wi.patch
-@@ -0,0 +1,38 @@
-+From c6748051ee8a5526801ce2070856061eb82ebe12 Mon Sep 17 00:00:00 2001
+diff --git a/third_party/eigen3/gpu_packet_math.patch b/third_party/eigen3/gpu_packet_math.patch
+index c0f466c24d3..9ebced7be41 100644
+--- a/third_party/eigen3/gpu_packet_math.patch
++++ b/third_party/eigen3/gpu_packet_math.patch
+@@ -1,32 +1,30 @@
+-diff -ru a/Eigen/src/Geometry/arch/Geometry_SSE.h b/Eigen/src/Geometry/arch/Geometry_SSE.h
+---- a/Eigen/src/Geometry/arch/Geometry_SSE.h
+-+++ b/Eigen/src/Geometry/arch/Geometry_SSE.h
+-@@ -33,13 +33,14 @@
+- Packet4f b = be.template packet<BAlignment,Packet4f>(0);
+- Packet4f s1 = pmul(vec4f_swizzle1(a,1,2,0,2),vec4f_swizzle1(b,2,0,1,2));
+- Packet4f s2 = pmul(vec4f_swizzle1(a,3,3,3,1),vec4f_swizzle1(b,0,1,2,1));
+-- pstoret<float,Packet4f,ResAlignment>(
+-- &res.x(),
+-- padd(psub(pmul(a,vec4f_swizzle1(b,3,3,3,3)),
+-- pmul(vec4f_swizzle1(a,2,0,1,0),
+-- vec4f_swizzle1(b,1,2,0,0))),
+-- pxor(mask,padd(s1,s2))));
+--
+-+ pstoret<float, Packet4f, ResAlignment>(
+-+ &res.x(),
+-+ padd<Packet4f>(
+-+ psub<Packet4f>(pmul<Packet4f>(a, vec4f_swizzle1(b, 3, 3, 3, 3)),
+-+ pmul<Packet4f>(vec4f_swizzle1(a, 2, 0, 1, 0),
+-+ vec4f_swizzle1(b, 1, 2, 0, 0))),
+-+ pxor<Packet4f>(mask, padd(s1, s2))));
+-+
+- return res;
+- }
+- };
+-diff -ru a/Eigen/src/Core/GenericPacketMath.h b/Eigen/src/Core/GenericPacketMath.h
++From 791079e4f45c8ab706c6384b3efde387db09557b Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
-+Date: Mon, 6 Apr 2020 15:55:21 +0800
-+Subject: [PATCH] workaround ice failure while building from source with gcc
-+ 7.3.1
++Date: Tue, 8 Dec 2020 17:32:22 +0800
++Subject: [PATCH] 1. gpu_packet_math
++
++2. workaround ice failure while building from source with gcc 7.3.1
+
+The root cause is gcc ice issue:
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89752
@@ -53,14 +65,55 @@ index 0000000000..d6c06b61e6
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
-+ unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h | 4 +++-
-+ 1 file changed, 3 insertions(+), 1 deletion(-)
++ Eigen/src/Core/GenericPacketMath.h | 46 ++++++++-----------
++ Eigen/src/Geometry/arch/Geometry_SSE.h | 15 +++---
++ .../Eigen/CXX11/src/Tensor/TensorReduction.h | 4 +-
++ 3 files changed, 31 insertions(+), 34 deletions(-)
+
++diff --git a/Eigen/src/Core/GenericPacketMath.h b/Eigen/src/Core/GenericPacketMath.h
++index fad9453..d8bbc76 100644
+ --- a/Eigen/src/Core/GenericPacketMath.h
+ +++ b/Eigen/src/Core/GenericPacketMath.h
+-@@ -255,49 +255,43 @@
++@@ -255,49 +255,43 @@ EIGEN_DEVICE_FUNC inline std::complex<RealScalar> ptrue(const std::complex<RealS
+ return std::complex<RealScalar>(b, b);
+ }
+
+@@ -96,3 +94,48 @@ diff -ru a/Eigen/src/Core/GenericPacketMath.h b/Eigen/src/Core/GenericPacketMath
+ }
+
+ /** \internal \returns the bitwise and of \a a and not \a b */
++diff --git a/Eigen/src/Geometry/arch/Geometry_SSE.h b/Eigen/src/Geometry/arch/Geometry_SSE.h
++index 108cc9f..43677f4 100644
++--- a/Eigen/src/Geometry/arch/Geometry_SSE.h
+++++ b/Eigen/src/Geometry/arch/Geometry_SSE.h
++@@ -33,13 +33,14 @@ struct quat_product<Architecture::SSE, Derived, OtherDerived, float>
++ Packet4f b = be.template packet<BAlignment,Packet4f>(0);
++ Packet4f s1 = pmul(vec4f_swizzle1(a,1,2,0,2),vec4f_swizzle1(b,2,0,1,2));
++ Packet4f s2 = pmul(vec4f_swizzle1(a,3,3,3,1),vec4f_swizzle1(b,0,1,2,1));
++- pstoret<float,Packet4f,ResAlignment>(
++- &res.x(),
++- padd(psub(pmul(a,vec4f_swizzle1(b,3,3,3,3)),
++- pmul(vec4f_swizzle1(a,2,0,1,0),
++- vec4f_swizzle1(b,1,2,0,0))),
++- pxor(mask,padd(s1,s2))));
++-
+++ pstoret<float, Packet4f, ResAlignment>(
+++ &res.x(),
+++ padd<Packet4f>(
+++ psub<Packet4f>(pmul<Packet4f>(a, vec4f_swizzle1(b, 3, 3, 3, 3)),
+++ pmul<Packet4f>(vec4f_swizzle1(a, 2, 0, 1, 0),
+++ vec4f_swizzle1(b, 1, 2, 0, 0))),
+++ pxor<Packet4f>(mask, padd(s1, s2))));
+++
++ return res;
++ }
++ };
+diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h b/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h
-+index bda1147..e2d7113 100644
++index 0a65591..0b00a31 100644
+--- a/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h
++++ b/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h
-+@@ -798,8 +798,10 @@ struct TensorEvaluator<const TensorReductionOp<Op, Dims, ArgType, MakePointer_>,
++@@ -815,8 +815,10 @@ struct TensorReductionEvaluatorBase<const TensorReductionOp<Op, Dims, ArgType, M
+ const Index firstIndex = firstInput(index);
+ for (Index i = 0; i < PacketSize; ++i) {
+ Op reducer(m_reducer);
@@ -73,8 +126,8 @@ index 0000000000..d6c06b61e6
+ } else if (PreservingInnerMostDims) {
+ const Index firstIndex = firstInput(index);
+--
-+2.17.1
++2.18.2
+
--
-2.17.1
+2.18.2
diff --git a/recipes-framework/tensorflow/files/0001-use-local-bazel-to-workaround-bazel-paralle-issue.patch b/recipes-framework/tensorflow/files/0001-use-local-bazel-to-workaround-bazel-paralle-issue.patch
index 14e8e47..e7b666e 100644
--- a/recipes-framework/tensorflow/files/0001-use-local-bazel-to-workaround-bazel-paralle-issue.patch
+++ b/recipes-framework/tensorflow/files/0001-use-local-bazel-to-workaround-bazel-paralle-issue.patch
@@ -1,6 +1,6 @@
-From ecc7014fe42ac0bc7bc502f2671a8da09c90d6ea Mon Sep 17 00:00:00 2001
+From 71e1fc302b41523aa4852ddf780cb2a42cf03f20 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Wed, 13 Mar 2019 17:55:08 +0800
+Date: Tue, 8 Dec 2020 17:11:48 +0800
Subject: [PATCH] use local bazel to workaround bazel paralle issue
Upstream-Status: Inappropriate [oe specific]
@@ -11,18 +11,18 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.py b/configure.py
-index 4f8cae2..2121a90 100644
+index b4907775d93..2a85871e52e 100644
--- a/configure.py
+++ b/configure.py
-@@ -454,7 +454,7 @@ def check_bazel_version(min_version, max_version):
- print('Cannot find bazel. Please install bazel.')
- sys.exit(0)
- curr_version = run_shell(
-- ['bazel', '--batch', '--bazelrc=/dev/null', 'version'])
-+ ['../bazel/bazel', '--batch', '--bazelrc=/dev/null', 'version'])
+@@ -480,7 +480,7 @@ def check_bazel_version(min_version, max_version):
+ sys.exit(1)
- for line in curr_version.split('\n'):
- if 'Build label: ' in line:
+ stderr = open(os.devnull, 'wb')
+- curr_version = run_shell(['bazel', '--version'],
++ curr_version = run_shell(['../bazel/bazel', '--version'],
+ allow_non_zero=True,
+ stderr=stderr)
+ if curr_version.startswith('bazel '):
--
-2.7.4
+2.18.2
diff --git a/recipes-framework/tensorflow/tensorflow-native_1.13.0.bb b/recipes-framework/tensorflow/tensorflow-native_2.4.0.bb
similarity index 100%
rename from recipes-framework/tensorflow/tensorflow-native_1.13.0.bb
rename to recipes-framework/tensorflow/tensorflow-native_2.4.0.bb
diff --git a/recipes-framework/tensorflow/tensorflow.inc b/recipes-framework/tensorflow/tensorflow.inc
index a729bdd..cd6518c 100644
--- a/recipes-framework/tensorflow/tensorflow.inc
+++ b/recipes-framework/tensorflow/tensorflow.inc
@@ -1,18 +1,13 @@
DESCRIPTION = "TensorFlow C/C++ Libraries"
LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=01e86893010a1b87e69a213faa753ebd"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=64a34301f8e355f57ec992c2af3e5157"
DEPENDS = "bazel-native protobuf-native util-linux-native protobuf"
-SRCREV = "c8875cbb1341f6ca14dd0ec908f1dde7d67f7808"
-SRC_URI = "git://github.com/tensorflow/tensorflow.git;branch=r1.13 \
- file://0001-SyntaxError-around-async-keyword-on-Python-3.7.patch \
+SRCREV = "97c3fef64ba9937a52af2d72fb4104b6e541d4b2"
+SRC_URI = "git://github.com/tensorflow/tensorflow.git;branch=r2.4 \
file://0001-support-musl.patch \
file://0001-use-local-bazel-to-workaround-bazel-paralle-issue.patch \
- file://0001-fix-compilation-error.patch \
- file://0001-Fix-TensorFlow-on-Python-3.8-logger-issue.patch \
- file://0001-Rename-gettid-functions.patch \
file://0001-third_party-eigen_archive-workaround-ice-failure-whi.patch \
- file://0001-Provide-overload-to-cope-with-const-ness-change-of-N.patch \
"
S = "${WORKDIR}/git"
diff --git a/recipes-framework/tensorflow/tensorflow_1.13.0.bb b/recipes-framework/tensorflow/tensorflow_2.4.0.bb
similarity index 99%
rename from recipes-framework/tensorflow/tensorflow_1.13.0.bb
rename to recipes-framework/tensorflow/tensorflow_2.4.0.bb
index 90b152b..aeb1a80 100644
--- a/recipes-framework/tensorflow/tensorflow_1.13.0.bb
+++ b/recipes-framework/tensorflow/tensorflow_2.4.0.bb
@@ -30,6 +30,7 @@ RDEPENDS_${PN} += " \
python3-grpcio \
python3-absl \
python3-astor \
+ python3-astunparse \
python3-gast \
python3-termcolor \
tensorboard \
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 4/25] add python3-gast 0.3.3
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
` (2 preceding siblings ...)
2020-12-16 13:08 ` [meta-tensorflow][PATCH 3/25] tensorflow: 1.13.0 -> 2.4.0 hongxu
@ 2020-12-16 13:08 ` hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 5/25] python3-opt-einsum: add 3.3.0 hongxu
` (20 subsequent siblings)
24 siblings, 0 replies; 33+ messages in thread
From: hongxu @ 2020-12-16 13:08 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
The tensorflow requires the this version, as newer versions are
incompatible with the rest of the ecosystem [1]
[1] https://github.com/tensorflow/tensorflow/commit/710f3c83b4147eb76e748efcc218325c4978726c
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
recipes-devtools/python/python3-gast_0.3.3.bb | 12 ++++++++++++
1 file changed, 12 insertions(+)
create mode 100644 recipes-devtools/python/python3-gast_0.3.3.bb
diff --git a/recipes-devtools/python/python3-gast_0.3.3.bb b/recipes-devtools/python/python3-gast_0.3.3.bb
new file mode 100644
index 0000000..da3c477
--- /dev/null
+++ b/recipes-devtools/python/python3-gast_0.3.3.bb
@@ -0,0 +1,12 @@
+SUMMARY = "A generic AST to represent Python3's Abstract Syntax Tree(AST)."
+HOMEPAGE = "https://github.com/serge-sans-paille/gast"
+SECTION = "devel/python"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=a3ad9b6802e713fc5e307e1230f1ea90"
+
+SRC_URI[md5sum] = "213b1820f576db14ed4fdf57efbfa67f"
+SRC_URI[sha256sum] = "b881ef288a49aa81440d2c5eb8aeefd4c2bb8993d5f50edae7413a85bfdb3b57"
+
+inherit pypi setuptools3
+
+BBCLASSEXTEND = "native"
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 5/25] python3-opt-einsum: add 3.3.0
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
` (3 preceding siblings ...)
2020-12-16 13:08 ` [meta-tensorflow][PATCH 4/25] add python3-gast 0.3.3 hongxu
@ 2020-12-16 13:08 ` hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 6/25] python3-google-pasta: add 0.2.0 hongxu
` (19 subsequent siblings)
24 siblings, 0 replies; 33+ messages in thread
From: hongxu @ 2020-12-16 13:08 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
It is required by tensorflow 2.4
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
.../python/python3-opt-einsum_3.3.0.bb | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
create mode 100644 recipes-devtools/python/python3-opt-einsum_3.3.0.bb
diff --git a/recipes-devtools/python/python3-opt-einsum_3.3.0.bb b/recipes-devtools/python/python3-opt-einsum_3.3.0.bb
new file mode 100644
index 0000000..16f3a6d
--- /dev/null
+++ b/recipes-devtools/python/python3-opt-einsum_3.3.0.bb
@@ -0,0 +1,16 @@
+SUMMARY = "A tensor contraction order optimizer"
+HOMEPAGE = "https://github.com/dgasmith/opt_einsum"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=5ab423c88cf3e69553decf93419f53ac"
+
+SRC_URI[md5sum] = "acf0a3997aab84b4e9a854296cc34971"
+SRC_URI[sha256sum] = "59f6475f77bbc37dcf7cd748519c0ec60722e91e63ca114e68821c0c54a46549"
+
+inherit pypi setuptools3
+
+SRCNAME = "opt_einsum"
+PYPI_SRC_URI = "https://files.pythonhosted.org/packages/source/o/${PYPI_PACKAGE}/${SRCNAME}-${PV}.tar.gz"
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+BBCLASSEXTEND = "native"
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 6/25] python3-google-pasta: add 0.2.0
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
` (4 preceding siblings ...)
2020-12-16 13:08 ` [meta-tensorflow][PATCH 5/25] python3-opt-einsum: add 3.3.0 hongxu
@ 2020-12-16 13:08 ` hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 7/25] python3-astunparse: add 1.6.3 hongxu
` (18 subsequent siblings)
24 siblings, 0 replies; 33+ messages in thread
From: hongxu @ 2020-12-16 13:08 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
It is required by tensorflow 2.4
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
.../python/python3-google-pasta_0.2.0.bb | 12 ++++++++++++
1 file changed, 12 insertions(+)
create mode 100644 recipes-devtools/python/python3-google-pasta_0.2.0.bb
diff --git a/recipes-devtools/python/python3-google-pasta_0.2.0.bb b/recipes-devtools/python/python3-google-pasta_0.2.0.bb
new file mode 100644
index 0000000..50a363c
--- /dev/null
+++ b/recipes-devtools/python/python3-google-pasta_0.2.0.bb
@@ -0,0 +1,12 @@
+SUMMARY = "The AST-based Python refactoring library"
+HOMEPAGE = "https://github.com/google/pasta"
+SECTION = "devel/python"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://PKG-INFO;md5=a10102394a800f3fa4a3df0934d57bb1"
+
+SRC_URI[md5sum] = "7c218a4a0d84303b9319352040fbfce6"
+SRC_URI[sha256sum] = "c9f2c8dfc8f96d0d5808299920721be30c9eec37f2389f28904f454565c8a16e"
+
+inherit pypi setuptools3
+
+BBCLASSEXTEND = "native"
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 7/25] python3-astunparse: add 1.6.3
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
` (5 preceding siblings ...)
2020-12-16 13:08 ` [meta-tensorflow][PATCH 6/25] python3-google-pasta: add 0.2.0 hongxu
@ 2020-12-16 13:08 ` hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 8/25] tensorflow-estimator: 1.13 -> 2.4 hongxu
` (17 subsequent siblings)
24 siblings, 0 replies; 33+ messages in thread
From: hongxu @ 2020-12-16 13:08 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
It is required by tensorflow 2.4
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
recipes-devtools/python/python3-astunparse_1.6.3.bb | 12 ++++++++++++
1 file changed, 12 insertions(+)
create mode 100644 recipes-devtools/python/python3-astunparse_1.6.3.bb
diff --git a/recipes-devtools/python/python3-astunparse_1.6.3.bb b/recipes-devtools/python/python3-astunparse_1.6.3.bb
new file mode 100644
index 0000000..c8977b8
--- /dev/null
+++ b/recipes-devtools/python/python3-astunparse_1.6.3.bb
@@ -0,0 +1,12 @@
+SUMMARY = "An AST unparser for Python"
+HOMEPAGE = "https://github.com/simonpercivall/astunparse"
+SECTION = "devel/python"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=7a7c771110c28a37480b73d07ad6d2a1"
+
+SRC_URI[md5sum] = "2cea4d8e49beba7684bac890e73d6a40"
+SRC_URI[sha256sum] = "5ad93a8456f0d084c3456d059fd9a92cce667963232cbf763eac3bc5b7940872"
+
+inherit pypi setuptools3
+
+BBCLASSEXTEND = "native"
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 8/25] tensorflow-estimator: 1.13 -> 2.4
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
` (6 preceding siblings ...)
2020-12-16 13:08 ` [meta-tensorflow][PATCH 7/25] python3-astunparse: add 1.6.3 hongxu
@ 2020-12-16 13:08 ` hongxu
2021-01-04 10:30 ` Marek Belisko
2020-12-16 13:08 ` [meta-tensorflow][PATCH 9/25] bazel-native/bazel.bbclass: use default Bazel toolchain to build Yocto native tools hongxu
` (16 subsequent siblings)
24 siblings, 1 reply; 33+ messages in thread
From: hongxu @ 2020-12-16 13:08 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
.../0001-customize-for-yocto.patch | 28 +++++++++++++++++++
.../tensorflow/tensorflow-estimator_1.13.bb | 12 ++++++--
2 files changed, 37 insertions(+), 3 deletions(-)
create mode 100644 recipes-framework/tensorflow/tensorflow-estimator/0001-customize-for-yocto.patch
diff --git a/recipes-framework/tensorflow/tensorflow-estimator/0001-customize-for-yocto.patch b/recipes-framework/tensorflow/tensorflow-estimator/0001-customize-for-yocto.patch
new file mode 100644
index 0000000..e9b66d5
--- /dev/null
+++ b/recipes-framework/tensorflow/tensorflow-estimator/0001-customize-for-yocto.patch
@@ -0,0 +1,28 @@
+From a1bcf09a43fc44ad5e04c441ee45cc23d16cf7d2 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 9 Dec 2020 17:59:01 +0800
+Subject: [PATCH] customize for yocto
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ tensorflow_estimator/tools/pip_package/build_pip_package.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tensorflow_estimator/tools/pip_package/build_pip_package.sh b/tensorflow_estimator/tools/pip_package/build_pip_package.sh
+index d4953a6..e08cd8a 100755
+--- a/tensorflow_estimator/tools/pip_package/build_pip_package.sh
++++ b/tensorflow_estimator/tools/pip_package/build_pip_package.sh
+@@ -38,7 +38,7 @@ function prepare_src() {
+
+ # Verifies all expected files are in pip.
+ # Creates init files in all directory in pip.
+- python tensorflow_estimator/tools/pip_package/create_pip_helper.py --pip-root "${TMPDIR}/tensorflow_estimator/" --bazel-root "./tensorflow_estimator"
++ nativepython3 tensorflow_estimator/tools/pip_package/create_pip_helper.py --pip-root "${TMPDIR}/tensorflow_estimator/" --bazel-root "./tensorflow_estimator"
+ }
+
+ function build_wheel() {
+--
+2.18.2
+
diff --git a/recipes-framework/tensorflow/tensorflow-estimator_1.13.bb b/recipes-framework/tensorflow/tensorflow-estimator_1.13.bb
index f3a5098..5b2fe5d 100644
--- a/recipes-framework/tensorflow/tensorflow-estimator_1.13.bb
+++ b/recipes-framework/tensorflow/tensorflow-estimator_1.13.bb
@@ -3,9 +3,10 @@ learning programming."
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=01e86893010a1b87e69a213faa753ebd"
-SRC_URI = "git://github.com/tensorflow/estimator.git;branch=r1.13 \
+SRC_URI = "git://github.com/tensorflow/estimator.git;branch=r2.4 \
+ file://0001-customize-for-yocto.patch \
"
-SRCREV = "340703eed78ba4854862f749ed94f91598826e79"
+SRCREV = "c3e7f2b5bbcc35185ef71797955a28cadce28f60"
S = "${WORKDIR}/git"
inherit python3native bazel
@@ -19,12 +20,18 @@ DEPENDS += " \
python3-astor-native \
python3-gast-native \
python3-termcolor-native \
+ python3-wrapt-native \
+ python3-opt-einsum-native \
+ python3-astunparse-native \
+ flatbuffers-native \
tensorflow-native \
"
do_compile () {
unset CC
export TMPDIR="${WORKDIR}"
+ export PYTHON_BIN_PATH="${PYTHON}"
+
${BAZEL} build \
--subcommands --explain=${T}/explain.log \
--verbose_explanations --verbose_failures \
@@ -32,7 +39,6 @@ do_compile () {
--python_path="${PYTHON}" \
//tensorflow_estimator/tools/pip_package:build_pip_package
- PYTHON_BIN_PATH="${PYTHON}" \
${S}/bazel-bin/tensorflow_estimator/tools/pip_package/build_pip_package \
${WORKDIR}/estimator_pip
}
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 9/25] bazel-native/bazel.bbclass: use default Bazel toolchain to build Yocto native tools
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
` (7 preceding siblings ...)
2020-12-16 13:08 ` [meta-tensorflow][PATCH 8/25] tensorflow-estimator: 1.13 -> 2.4 hongxu
@ 2020-12-16 13:08 ` hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 10/25] bazel-native/bazel.bbclass: replace deprecated --local_resources hongxu
` (15 subsequent siblings)
24 siblings, 0 replies; 33+ messages in thread
From: hongxu @ 2020-12-16 13:08 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
While using the default Bazel C++ toolchain to build Yocto native tools
(bazel build --host_crosstool_top=@bazel_tools//tools/cpp:toolchain),
it failed with `bazel references a path outside of the execution root',
Add Yocto native sysroot dir (YOCTO_NATIVE_SYSROOT) to
builtin_include_directories could fix the issue
If not set YOCTO_NATIVE_SYSROOT, use NOT_SET_YOCTO_NATIVE_SYSROOT
to replace as a warning
Set YOCTO_NATIVE_SYSROOT in bazel.bbclass
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
classes/bazel.bbclass | 2 +
recipes-devtools/bazel/bazel-native_3.1.0.bb | 1 +
...-sysroot-dir-to-the-default-Bazel-to.patch | 39 +++++++++++++++++++
3 files changed, 42 insertions(+)
create mode 100644 recipes-devtools/bazel/files/0001-add-Yocto-native-sysroot-dir-to-the-default-Bazel-to.patch
diff --git a/classes/bazel.bbclass b/classes/bazel.bbclass
index 65d2932..b4c2a7f 100644
--- a/classes/bazel.bbclass
+++ b/classes/bazel.bbclass
@@ -109,3 +109,5 @@ EXPORT_FUNCTIONS do_configure
CCACHE_DISABLE = "1"
inherit unsupportarch
+
+export YOCTO_NATIVE_SYSROOT="${BAZEL_OUTPUTBASE_DIR}/external/yocto_compiler/recipe-sysroot-native"
diff --git a/recipes-devtools/bazel/bazel-native_3.1.0.bb b/recipes-devtools/bazel/bazel-native_3.1.0.bb
index f3efde1..0555f2f 100644
--- a/recipes-devtools/bazel/bazel-native_3.1.0.bb
+++ b/recipes-devtools/bazel/bazel-native_3.1.0.bb
@@ -9,6 +9,7 @@ SRC_URI = "https://github.com/bazelbuild/bazel/releases/download/${PV}/bazel-${P
file://0001-HttpDownloader-save-download-tarball-to-distdir.patch \
file://0001-fix-unzip-command-not-found.patch \
file://0001-python3.patch \
+ file://0001-add-Yocto-native-sysroot-dir-to-the-default-Bazel-to.patch \
"
inherit native python3native
diff --git a/recipes-devtools/bazel/files/0001-add-Yocto-native-sysroot-dir-to-the-default-Bazel-to.patch b/recipes-devtools/bazel/files/0001-add-Yocto-native-sysroot-dir-to-the-default-Bazel-to.patch
new file mode 100644
index 0000000..b08c65a
--- /dev/null
+++ b/recipes-devtools/bazel/files/0001-add-Yocto-native-sysroot-dir-to-the-default-Bazel-to.patch
@@ -0,0 +1,39 @@
+From 707ba08068432262b3d02b29804c00afe7133ff6 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 10 Dec 2020 16:12:51 +0800
+Subject: [PATCH] add Yocto native sysroot dir to the default Bazel toolchain
+
+While using the default Bazel C++ toolchain to build Yocto native tools
+(bazel build --host_crosstool_top=@bazel_tools//tools/cpp:toolchain),
+it failed `bazel references a path outside of the execution root',
+
+Add Yocto native sysroot dir (YOCTO_NATIVE_SYSROOT) to
+builtin_include_directories could fix the issue
+
+If not set YOCTO_NATIVE_SYSROOT, use NOT_SET_YOCTO_NATIVE_SYSROOT
+to replace as a warning
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ tools/cpp/unix_cc_configure.bzl | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/tools/cpp/unix_cc_configure.bzl b/tools/cpp/unix_cc_configure.bzl
+index 84f5479..e17aa9d 100755
+--- a/tools/cpp/unix_cc_configure.bzl
++++ b/tools/cpp/unix_cc_configure.bzl
+@@ -424,6 +424,9 @@ def configure_unix_toolchain(repository_ctx, cpu_value, overriden_tools):
+ ),
+ )
+
++ # Customize for Yocto
++ builtin_include_directories.append(get_env_var(repository_ctx,"YOCTO_NATIVE_SYSROOT", "NOT_SET_YOCTO_NATIVE_SYSROOT"))
++
+ write_builtin_include_directory_paths(repository_ctx, cc, builtin_include_directories)
+ repository_ctx.template(
+ "BUILD",
+--
+2.18.2
+
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 10/25] bazel-native/bazel.bbclass: replace deprecated --local_resources
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
` (8 preceding siblings ...)
2020-12-16 13:08 ` [meta-tensorflow][PATCH 9/25] bazel-native/bazel.bbclass: use default Bazel toolchain to build Yocto native tools hongxu
@ 2020-12-16 13:08 ` hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 11/25] tensorflow: update cross compile support hongxu
` (14 subsequent siblings)
24 siblings, 0 replies; 33+ messages in thread
From: hongxu @ 2020-12-16 13:08 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
1. Use --local_ram_resources and --local_cpu_resources to replace
deprecated --local_resources
2. Add options to bazel-native build
|ERROR: --local_resources is deprecated. Please use --local_ram_resources and/or --local_cpu_resources
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
classes/bazel.bbclass | 2 +-
recipes-devtools/bazel/bazel-native_3.1.0.bb | 12 +++++++++++-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/classes/bazel.bbclass b/classes/bazel.bbclass
index b4c2a7f..2a64156 100644
--- a/classes/bazel.bbclass
+++ b/classes/bazel.bbclass
@@ -75,7 +75,7 @@ bazel_do_configure () {
cat > "${S}/bazelrc" <<-EOF
build --verbose_failures
build --spawn_strategy=standalone --genrule_strategy=standalone
-build --jobs=${BAZEL_JOBS} --local_resources=4096,${BAZEL_JOBS},1.0
+buuld --jobs=${BAZEL_JOBS} --local_ram_resources=4096 --local_cpu_resources=${BAZEL_JOBS}
test --verbose_failures --verbose_test_summary
test --spawn_strategy=standalone --genrule_strategy=standalone
diff --git a/recipes-devtools/bazel/bazel-native_3.1.0.bb b/recipes-devtools/bazel/bazel-native_3.1.0.bb
index 0555f2f..1336da8 100644
--- a/recipes-devtools/bazel/bazel-native_3.1.0.bb
+++ b/recipes-devtools/bazel/bazel-native_3.1.0.bb
@@ -26,11 +26,21 @@ DEPENDS = "coreutils-native \
S="${WORKDIR}"
TS_DL_DIR ??= "${DL_DIR}"
+
+BAZEL_JOBS ??= "4"
+EXTRA_BAZEL_ARGS = " \
+ --host_javabase=@local_jdk//:jdk \
+ --python_path=python3 \
+ --jobs=${BAZEL_JOBS} \
+ --local_ram_resources=4096 \
+ --local_cpu_resources=${BAZEL_JOBS} \
+"
+
do_compile () {
export JAVA_HOME="${STAGING_LIBDIR_NATIVE}/jvm/openjdk-8-native"
TMPDIR="${TOPDIR}/bazel" \
VERBOSE=yes \
- EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk --python_path=python3" \
+ EXTRA_BAZEL_ARGS="${EXTRA_BAZEL_ARGS}" \
./compile.sh
}
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 11/25] tensorflow: update cross compile support
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
` (9 preceding siblings ...)
2020-12-16 13:08 ` [meta-tensorflow][PATCH 10/25] bazel-native/bazel.bbclass: replace deprecated --local_resources hongxu
@ 2020-12-16 13:08 ` hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 12/25] tensorflow: fix Multiple shlib providers for libtensorflow_framework.so hongxu
` (13 subsequent siblings)
24 siblings, 0 replies; 33+ messages in thread
From: hongxu @ 2020-12-16 13:08 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
- CROSSTOOL files are no longer supported after Bazel v0.26+,
so converted over to the new toolchain config format
- Support 32 bit x86 and 64 bit x86 for Yocto
- Support 32 bit arm and 64 bit arm (aarch64) for Yocto
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
classes/bazel.bbclass | 7 +-
classes/unsupportarch.bbclass | 13 +-
...support-32-bit-x64-and-arm-for-yocto.patch | 129 ++++++
recipes-framework/tensorflow/files/BUILD | 56 ---
recipes-framework/tensorflow/files/BUILD.in | 40 ++
.../tensorflow/files/cc_config.bzl.tpl | 411 ++++++++++++++++++
.../files/yocto_compiler_configure.bzl | 26 +-
...or_1.13.bb => tensorflow-estimator_2.4.bb} | 0
.../tensorflow/tensorflow_2.4.0.bb | 21 +-
9 files changed, 634 insertions(+), 69 deletions(-)
create mode 100644 recipes-framework/tensorflow/files/0001-support-32-bit-x64-and-arm-for-yocto.patch
delete mode 100644 recipes-framework/tensorflow/files/BUILD
create mode 100644 recipes-framework/tensorflow/files/BUILD.in
create mode 100644 recipes-framework/tensorflow/files/cc_config.bzl.tpl
rename recipes-framework/tensorflow/{tensorflow-estimator_1.13.bb => tensorflow-estimator_2.4.bb} (100%)
diff --git a/classes/bazel.bbclass b/classes/bazel.bbclass
index 2a64156..5a76244 100644
--- a/classes/bazel.bbclass
+++ b/classes/bazel.bbclass
@@ -75,13 +75,16 @@ bazel_do_configure () {
cat > "${S}/bazelrc" <<-EOF
build --verbose_failures
build --spawn_strategy=standalone --genrule_strategy=standalone
-buuld --jobs=${BAZEL_JOBS} --local_ram_resources=4096 --local_cpu_resources=${BAZEL_JOBS}
+build --jobs=${BAZEL_JOBS} --local_ram_resources=4096 --local_cpu_resources=${BAZEL_JOBS}
test --verbose_failures --verbose_test_summary
test --spawn_strategy=standalone --genrule_strategy=standalone
build --linkopt=-Wl,--no-as-needed
build --host_linkopt=-Wl,--no-as-needed
+build --host_conlyopt=-D_PYTHON_INCLUDE_NATIVE --host_cxxopt=-D_PYTHON_INCLUDE_NATIVE
+build --conlyopt=-D_PYTHON_INCLUDE_TARGET --cxxopt=-D_PYTHON_INCLUDE_TARGET
+
build --strip=never
build --python_path=python3
@@ -108,6 +111,8 @@ EXPORT_FUNCTIONS do_configure
CCACHE_DISABLE = "1"
+PSEUDO_IGNORE_PATHS .= ",${WORKDIR}/bazel"
+
inherit unsupportarch
export YOCTO_NATIVE_SYSROOT="${BAZEL_OUTPUTBASE_DIR}/external/yocto_compiler/recipe-sysroot-native"
diff --git a/classes/unsupportarch.bbclass b/classes/unsupportarch.bbclass
index 8aecca3..f169c35 100644
--- a/classes/unsupportarch.bbclass
+++ b/classes/unsupportarch.bbclass
@@ -1,8 +1,11 @@
-UNSUPPORTED_TARGET_ARCH ??= "powerpc"
-UNSUPPORTED_TARGET_ARCH_mipsarchn32_append = " mips64"
+BAZEL_TARGET_CPU ??= ""
+BAZEL_TARGET_CPU_x86 = "x86"
+BAZEL_TARGET_CPU_x86-64 = "k8"
+BAZEL_TARGET_CPU_arm = "arm"
+BAZEL_TARGET_CPU_aarch64 = "aarch64"
python __anonymous() {
- target_arch = d.getVar("TARGET_ARCH")
- if target_arch in d.getVar("UNSUPPORTED_TARGET_ARCH").split():
- raise bb.parse.SkipPackage("TensorFlow does not support Target Arch '%s'" % target_arch)
+ if not d.getVar("BAZEL_TARGET_CPU"):
+ target_arch = d.getVar("TARGET_ARCH")
+ raise bb.parse.SkipPackage("BAZEL_TARGET_CPU is not set\nTensorFlow does not support Target Arch '%s'" % target_arch)
}
diff --git a/recipes-framework/tensorflow/files/0001-support-32-bit-x64-and-arm-for-yocto.patch b/recipes-framework/tensorflow/files/0001-support-32-bit-x64-and-arm-for-yocto.patch
new file mode 100644
index 0000000..7324136
--- /dev/null
+++ b/recipes-framework/tensorflow/files/0001-support-32-bit-x64-and-arm-for-yocto.patch
@@ -0,0 +1,129 @@
+From 52b0c97764b65e4351aa2005217b0827d94b842f Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Sat, 12 Dec 2020 21:41:29 +0800
+Subject: [PATCH] support 32 bit x64 and arm for yocto
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ tensorflow/BUILD | 1 -
+ tensorflow/workspace.bzl | 1 +
+ .../0001-XNNPACK-support-32-bit-x86.patch | 29 +++++++++++++++++++
+ third_party/aws/BUILD.bazel | 6 ++++
+ third_party/aws/aws-c-common.bazel | 9 ++++++
+ third_party/cpuinfo/BUILD.bazel | 1 -
+ 6 files changed, 45 insertions(+), 2 deletions(-)
+ create mode 100644 third_party/0001-XNNPACK-support-32-bit-x86.patch
+
+diff --git a/tensorflow/BUILD b/tensorflow/BUILD
+index 85e172afa03..4d2d90cd755 100644
+--- a/tensorflow/BUILD
++++ b/tensorflow/BUILD
+@@ -86,7 +86,6 @@ config_setting(
+ config_setting(
+ name = "android_x86",
+ values = {
+- "crosstool_top": "//external:android/crosstool",
+ "cpu": "x86",
+ },
+ visibility = ["//visibility:public"],
+diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
+index f6c47187c54..fce3c53fff0 100755
+--- a/tensorflow/workspace.bzl
++++ b/tensorflow/workspace.bzl
+@@ -140,6 +140,7 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):
+ name = "XNNPACK",
+ sha256 = "4b199c96fb2d551450b48eb5549843b41c023ad200aa86760a7c56d0dc0da806",
+ strip_prefix = "XNNPACK-68447302abcfad0d4b6b19a1efe7d7eef8833f4a",
++ patch_file = clean_dep("//third_party:0001-XNNPACK-support-32-bit-x86.patch"),
+ urls = [
+ "https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/XNNPACK/archive/68447302abcfad0d4b6b19a1efe7d7eef8833f4a.zip",
+ "https://github.com/google/XNNPACK/archive/68447302abcfad0d4b6b19a1efe7d7eef8833f4a.zip",
+diff --git a/third_party/0001-XNNPACK-support-32-bit-x86.patch b/third_party/0001-XNNPACK-support-32-bit-x86.patch
+new file mode 100644
+index 00000000000..9e9ae3bb554
+--- /dev/null
++++ b/third_party/0001-XNNPACK-support-32-bit-x86.patch
+@@ -0,0 +1,29 @@
++From be12104d25bf9a74daeabd6eae388291196ebdc1 Mon Sep 17 00:00:00 2001
++From: Hongxu Jia <hongxu.jia@windriver.com>
++Date: Fri, 11 Dec 2020 23:29:23 +0800
++Subject: [PATCH] XNNPACK: support 32 bit x86
++
++Use android_x86 as a workaround to support 32 bit x86
++
++Upstream-Status: Inappropriate [oe specific]
++
++Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
++---
++ BUILD.bazel | 1 -
++ 1 file changed, 1 deletion(-)
++
++diff --git a/BUILD.bazel b/BUILD.bazel
++index ec7d05a..be0beba 100644
++--- a/BUILD.bazel
+++++ b/BUILD.bazel
++@@ -6475,7 +6475,6 @@ config_setting(
++ config_setting(
++ name = "android_x86",
++ values = {
++- "crosstool_top": "//external:android/crosstool",
++ "cpu": "x86",
++ },
++ )
++--
++2.18.2
++
+diff --git a/third_party/aws/BUILD.bazel b/third_party/aws/BUILD.bazel
+index e1058edaba4..a86591997f3 100644
+--- a/third_party/aws/BUILD.bazel
++++ b/third_party/aws/BUILD.bazel
+@@ -33,6 +33,12 @@ cc_library(
+ "@org_tensorflow//tensorflow:yocto_armeabi": glob([
+ "aws-cpp-sdk-core/source/platform/linux-shared/*.cpp",
+ ]),
++ "@org_tensorflow//tensorflow:android_x86": glob([
++ "aws-cpp-sdk-core/source/platform/linux-shared/*.cpp",
++ ]),
++ "@org_tensorflow//tensorflow:arm": glob([
++ "aws-cpp-sdk-core/source/platform/linux-shared/*.cpp",
++ ]),
+ "//conditions:default": [],
+ }) + select({
+ "//conditions:default": glob([
+diff --git a/third_party/aws/aws-c-common.bazel b/third_party/aws/aws-c-common.bazel
+index ab9406805c2..d1078b0d701 100644
+--- a/third_party/aws/aws-c-common.bazel
++++ b/third_party/aws/aws-c-common.bazel
+@@ -12,6 +12,15 @@ load("@org_tensorflow//third_party:common.bzl", "template_rule")
+ cc_library(
+ name = "aws-c-common",
+ srcs = select({
++ "@org_tensorflow//tensorflow:arm": glob([
++ "source/posix/*.c",
++ ]),
++ "@org_tensorflow//tensorflow:android_x86": glob([
++ "source/posix/*.c",
++ ]),
++ "@org_tensorflow//tensorflow:yocto_armeabi": glob([
++ "source/posix/*.c",
++ ]),
+ "@org_tensorflow//tensorflow:linux_aarch64": glob([
+ "source/posix/*.c",
+ ]),
+diff --git a/third_party/cpuinfo/BUILD.bazel b/third_party/cpuinfo/BUILD.bazel
+index 9b007cc0daa..1fca02facfc 100644
+--- a/third_party/cpuinfo/BUILD.bazel
++++ b/third_party/cpuinfo/BUILD.bazel
+@@ -248,7 +248,6 @@ config_setting(
+ config_setting(
+ name = "android_x86",
+ values = {
+- "crosstool_top": "//external:android/crosstool",
+ "cpu": "x86",
+ },
+ visibility = ["//visibility:public"],
+--
+2.18.2
+
diff --git a/recipes-framework/tensorflow/files/BUILD b/recipes-framework/tensorflow/files/BUILD
deleted file mode 100644
index fd1f99a..0000000
--- a/recipes-framework/tensorflow/files/BUILD
+++ /dev/null
@@ -1,56 +0,0 @@
-package(default_visibility = ["//visibility:public"])
-
-cc_toolchain_suite(
- name = "toolchain",
- toolchains = {
- "armeabi|compiler": ":cc-compiler-armeabi",
- "local|compiler": ":cc-compiler-local",
- "armeabi": ":cc-compiler-armeabi",
- "k8": ":cc-compiler-local",
- "piii": ":cc-compiler-local",
- "arm": ":cc-compiler-local",
- "s390x": ":cc-compiler-local",
- },
-)
-
-filegroup(
- name = "empty",
- srcs = [],
-)
-
-filegroup(
- name = "arm_linux_all_files",
- srcs = [
- "@yocto_compiler//:compiler_pieces",
- ],
-)
-
-cc_toolchain(
- name = "cc-compiler-local",
- all_files = ":empty",
- compiler_files = ":empty",
- cpu = "local",
- dwp_files = ":empty",
- dynamic_runtime_libs = [":empty"],
- linker_files = ":empty",
- objcopy_files = ":empty",
- static_runtime_libs = [":empty"],
- strip_files = ":empty",
- supports_param_files = 1,
- toolchain_identifier = "local_linux",
-)
-
-cc_toolchain(
- name = "cc-compiler-armeabi",
- all_files = ":arm_linux_all_files",
- compiler_files = ":arm_linux_all_files",
- cpu = "armeabi",
- dwp_files = ":empty",
- dynamic_runtime_libs = [":empty"],
- linker_files = ":arm_linux_all_files",
- objcopy_files = "arm_linux_all_files",
- static_runtime_libs = [":empty"],
- strip_files = "arm_linux_all_files",
- supports_param_files = 1,
- toolchain_identifier = "yocto-linux-gnueabihf",
-)
diff --git a/recipes-framework/tensorflow/files/BUILD.in b/recipes-framework/tensorflow/files/BUILD.in
new file mode 100644
index 0000000..2e230a6
--- /dev/null
+++ b/recipes-framework/tensorflow/files/BUILD.in
@@ -0,0 +1,40 @@
+package(default_visibility = ["//visibility:public"])
+
+load(":cc_config.bzl", "cc_toolchain_config")
+
+cc_toolchain_suite(
+ name = "toolchain",
+ toolchains = {
+ "%%CPU%%": ":cc-compiler-yocto",
+ },
+)
+
+filegroup(
+ name = "empty",
+ srcs = [],
+)
+
+filegroup(
+ name = "yocto_linux_all_files",
+ srcs = [
+ "@yocto_compiler//:compiler_pieces",
+ ],
+)
+
+cc_toolchain_config(
+ name = "yocto_config",
+ cpu = "%%CPU%%",
+)
+
+cc_toolchain(
+ name = "cc-compiler-yocto",
+ all_files = ":yocto_linux_all_files",
+ compiler_files = ":yocto_linux_all_files",
+ dwp_files = ":empty",
+ linker_files = ":yocto_linux_all_files",
+ objcopy_files = "yocto_linux_all_files",
+ strip_files = "yocto_linux_all_files",
+ supports_param_files = 1,
+ toolchain_config = ":yocto_config",
+ toolchain_identifier = "yocto-linux-toolchain",
+)
diff --git a/recipes-framework/tensorflow/files/cc_config.bzl.tpl b/recipes-framework/tensorflow/files/cc_config.bzl.tpl
new file mode 100644
index 0000000..7ab7ea8
--- /dev/null
+++ b/recipes-framework/tensorflow/files/cc_config.bzl.tpl
@@ -0,0 +1,411 @@
+load("@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
+ "action_config",
+ "artifact_name_pattern",
+ "env_entry",
+ "env_set",
+ "feature",
+ "feature_set",
+ "flag_group",
+ "flag_set",
+ "make_variable",
+ "tool",
+ "tool_path",
+ "variable_with_value",
+ "with_feature_set",
+)
+load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
+
+def _impl(ctx):
+ toolchain_identifier = "yocto-linux-toolchain"
+ host_system_name = ctx.attr.cpu
+ target_system_name = ctx.attr.cpu
+ target_cpu = ctx.attr.cpu
+ target_libc = ctx.attr.cpu
+ abi_version = ctx.attr.cpu
+ abi_libc_version = ctx.attr.cpu
+
+ compiler = "compiler"
+
+ cc_target_os = None
+
+ builtin_sysroot = None
+
+ all_compile_actions = [
+ ACTION_NAMES.c_compile,
+ ACTION_NAMES.cpp_compile,
+ ACTION_NAMES.linkstamp_compile,
+ ACTION_NAMES.assemble,
+ ACTION_NAMES.preprocess_assemble,
+ ACTION_NAMES.cpp_header_parsing,
+ ACTION_NAMES.cpp_module_compile,
+ ACTION_NAMES.cpp_module_codegen,
+ ACTION_NAMES.clif_match,
+ ACTION_NAMES.lto_backend,
+ ]
+
+ all_cpp_compile_actions = [
+ ACTION_NAMES.cpp_compile,
+ ACTION_NAMES.linkstamp_compile,
+ ACTION_NAMES.cpp_header_parsing,
+ ACTION_NAMES.cpp_module_compile,
+ ACTION_NAMES.cpp_module_codegen,
+ ACTION_NAMES.clif_match,
+ ]
+
+ preprocessor_compile_actions = [
+ ACTION_NAMES.c_compile,
+ ACTION_NAMES.cpp_compile,
+ ACTION_NAMES.linkstamp_compile,
+ ACTION_NAMES.preprocess_assemble,
+ ACTION_NAMES.cpp_header_parsing,
+ ACTION_NAMES.cpp_module_compile,
+ ACTION_NAMES.clif_match,
+ ]
+
+ codegen_compile_actions = [
+ ACTION_NAMES.c_compile,
+ ACTION_NAMES.cpp_compile,
+ ACTION_NAMES.linkstamp_compile,
+ ACTION_NAMES.assemble,
+ ACTION_NAMES.preprocess_assemble,
+ ACTION_NAMES.cpp_module_codegen,
+ ACTION_NAMES.lto_backend,
+ ]
+
+ all_link_actions = [
+ ACTION_NAMES.cpp_link_executable,
+ ACTION_NAMES.cpp_link_dynamic_library,
+ ACTION_NAMES.cpp_link_nodeps_dynamic_library,
+ ]
+
+ objcopy_embed_data_action = action_config(
+ action_name = "objcopy_embed_data",
+ enabled = True,
+ tools = [tool(path = "/usr/bin/objcopy")],
+ )
+
+ action_configs = []
+
+ opt_feature = feature(name = "opt")
+
+ dbg_feature = feature(name = "dbg")
+
+ sysroot_feature = feature(
+ name = "sysroot",
+ enabled = True,
+ flag_sets = [
+ flag_set(
+ actions = [
+ ACTION_NAMES.preprocess_assemble,
+ ACTION_NAMES.linkstamp_compile,
+ ACTION_NAMES.c_compile,
+ ACTION_NAMES.cpp_compile,
+ ACTION_NAMES.cpp_header_parsing,
+ ACTION_NAMES.cpp_module_compile,
+ ACTION_NAMES.cpp_module_codegen,
+ ACTION_NAMES.lto_backend,
+ ACTION_NAMES.clif_match,
+ ACTION_NAMES.cpp_link_executable,
+ ACTION_NAMES.cpp_link_dynamic_library,
+ ACTION_NAMES.cpp_link_nodeps_dynamic_library,
+ ],
+ flag_groups = [
+ flag_group(
+ flags = ["--sysroot=%{YOCTO_COMPILER_PATH}%/recipe-sysroot"],
+ expand_if_available = "sysroot",
+ ),
+ ],
+ ),
+ ],
+ )
+
+ unfiltered_compile_flags_feature = feature(
+ name = "unfiltered_compile_flags",
+ enabled = True,
+ flag_sets = [
+ flag_set(
+ actions = [
+ ACTION_NAMES.assemble,
+ ACTION_NAMES.preprocess_assemble,
+ ACTION_NAMES.linkstamp_compile,
+ ACTION_NAMES.c_compile,
+ ACTION_NAMES.cpp_compile,
+ ACTION_NAMES.cpp_header_parsing,
+ ACTION_NAMES.cpp_module_compile,
+ ACTION_NAMES.cpp_module_codegen,
+ ACTION_NAMES.lto_backend,
+ ACTION_NAMES.clif_match,
+ ],
+ flag_groups = [
+ flag_group(
+ flags = [
+ "-Wno-builtin-macro-redefined",
+ "-D__DATE__=\"redacted\"",
+ "-D__TIMESTAMP__=\"redacted\"",
+ "-D__TIME__=\"redacted\"",
+ "-no-canonical-prefixes",
+ "-fno-canonical-system-headers",
+ ],
+ ),
+ ],
+ ),
+ ],
+ )
+
+ objcopy_embed_flags_feature = feature(
+ name = "objcopy_embed_flags",
+ enabled = True,
+ flag_sets = [
+ flag_set(
+ actions = ["objcopy_embed_data"],
+ flag_groups = [flag_group(flags = ["-I", "binary"])],
+ ),
+ ],
+ )
+
+ default_compile_flags_feature = feature(
+ name = "default_compile_flags",
+ enabled = True,
+ flag_sets = [
+ flag_set(
+ actions = [
+ ACTION_NAMES.assemble,
+ ACTION_NAMES.preprocess_assemble,
+ ACTION_NAMES.linkstamp_compile,
+ ACTION_NAMES.c_compile,
+ ACTION_NAMES.cpp_compile,
+ ACTION_NAMES.cpp_header_parsing,
+ ACTION_NAMES.cpp_module_compile,
+ ACTION_NAMES.cpp_module_codegen,
+ ACTION_NAMES.lto_backend,
+ ACTION_NAMES.clif_match,
+ ],
+ flag_groups = [
+ flag_group(
+ flags = [
+ "-fstack-protector",
+ ],
+ ),
+ ],
+ ),
+ flag_set(
+ actions = [
+ ACTION_NAMES.assemble,
+ ACTION_NAMES.preprocess_assemble,
+ ACTION_NAMES.linkstamp_compile,
+ ACTION_NAMES.c_compile,
+ ACTION_NAMES.cpp_compile,
+ ACTION_NAMES.cpp_header_parsing,
+ ACTION_NAMES.cpp_module_compile,
+ ACTION_NAMES.cpp_module_codegen,
+ ACTION_NAMES.lto_backend,
+ ACTION_NAMES.clif_match,
+ ],
+ flag_groups = [flag_group(flags = ["-g"])],
+ with_features = [with_feature_set(features = ["dbg"])],
+ ),
+ flag_set(
+ actions = [
+ ACTION_NAMES.assemble,
+ ACTION_NAMES.preprocess_assemble,
+ ACTION_NAMES.linkstamp_compile,
+ ACTION_NAMES.c_compile,
+ ACTION_NAMES.cpp_compile,
+ ACTION_NAMES.cpp_header_parsing,
+ ACTION_NAMES.cpp_module_compile,
+ ACTION_NAMES.cpp_module_codegen,
+ ACTION_NAMES.lto_backend,
+ ACTION_NAMES.clif_match,
+ ],
+ flag_groups = [
+ flag_group(
+ flags = [
+ "-g0",
+ "-O2",
+ "-DNDEBUG",
+ "-ffunction-sections",
+ "-fdata-sections",
+ ],
+ ),
+ ],
+ with_features = [with_feature_set(features = ["opt"])],
+ ),
+ flag_set(
+ actions = [
+ ACTION_NAMES.linkstamp_compile,
+ ACTION_NAMES.cpp_compile,
+ ACTION_NAMES.cpp_header_parsing,
+ ACTION_NAMES.cpp_module_compile,
+ ACTION_NAMES.cpp_module_codegen,
+ ACTION_NAMES.lto_backend,
+ ACTION_NAMES.clif_match,
+ ],
+ flag_groups = [
+ flag_group(
+ flags = [
+ # Include target pyconfig.h
+ "-D_PYTHON_INCLUDE_TARGET",
+ ],
+ ),
+ ],
+ ),
+ ],
+ )
+
+ default_link_flags_feature = feature(
+ name = "default_link_flags",
+ enabled = True,
+ flag_sets = [
+ flag_set(
+ actions = all_link_actions,
+ flag_groups = [
+ flag_group(
+ flags = [
+ "-lstdc++",
+ "-Wl,-z,relro,-z,now",
+ "-no-canonical-prefixes",
+ "-pass-exit-codes",
+ "-Wl,--build-id=md5",
+ "-Wl,--hash-style=gnu",
+ ],
+ ),
+ ],
+ ),
+ flag_set(
+ actions = all_link_actions,
+ flag_groups = [flag_group(flags = ["-Wl,--gc-sections"])],
+ with_features = [with_feature_set(features = ["opt"])],
+ ),
+ ],
+ )
+
+ supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True)
+
+ supports_pic_feature = feature(name = "supports_pic", enabled = True)
+
+ user_compile_flags_feature = feature(
+ name = "user_compile_flags",
+ enabled = True,
+ flag_sets = [
+ flag_set(
+ actions = [
+ ACTION_NAMES.assemble,
+ ACTION_NAMES.preprocess_assemble,
+ ACTION_NAMES.linkstamp_compile,
+ ACTION_NAMES.c_compile,
+ ACTION_NAMES.cpp_compile,
+ ACTION_NAMES.cpp_header_parsing,
+ ACTION_NAMES.cpp_module_compile,
+ ACTION_NAMES.cpp_module_codegen,
+ ACTION_NAMES.lto_backend,
+ ACTION_NAMES.clif_match,
+ ],
+ flag_groups = [
+ flag_group(
+ flags = ["%{user_compile_flags}"],
+ iterate_over = "user_compile_flags",
+ expand_if_available = "user_compile_flags",
+ ),
+ ],
+ ),
+ ],
+ )
+
+ features = [
+ default_compile_flags_feature,
+ default_link_flags_feature,
+ supports_dynamic_linker_feature,
+ supports_pic_feature,
+ opt_feature,
+ dbg_feature,
+ user_compile_flags_feature,
+ sysroot_feature,
+ unfiltered_compile_flags_feature,
+ ]
+
+ cxx_builtin_include_directories = [
+ "%{YOCTO_COMPILER_PATH}%",
+ ]
+
+ artifact_name_patterns = []
+
+ make_variables = []
+
+ tool_paths = [
+ tool_path(
+ name = "ar",
+ path = "%{YOCTO_COMPILER_PATH}%/recipe-sysroot-native/usr/bin/%{CT_NAME}%/%{CT_NAME}%-ar",
+ ),
+ tool_path(name = "compat-ld", path = "/bin/false"),
+ tool_path(
+ name = "cpp",
+ path = "%{YOCTO_COMPILER_PATH}%/recipe-sysroot-native/usr/bin/%{CT_NAME}%/%{CT_NAME}%-cpp",
+ ),
+ tool_path(
+ name = "dwp",
+ path = "%{YOCTO_COMPILER_PATH}%/recipe-sysroot-native/usr/bin/%{CT_NAME}%/%{CT_NAME}%-dwp",
+ ),
+ tool_path(
+ name = "gcc",
+ path = "%{YOCTO_COMPILER_PATH}%/recipe-sysroot-native/usr/bin/%{CT_NAME}%/%{CT_NAME}%-gcc",
+ ),
+ tool_path(
+ name = "gcov",
+ path = "%{YOCTO_COMPILER_PATH}%/recipe-sysroot-native/usr/bin/%{CT_NAME}%/%{CT_NAME}%-gcov",
+ ),
+ tool_path(
+ name = "ld",
+ path = "%{YOCTO_COMPILER_PATH}%/recipe-sysroot-native/usr/bin/%{CT_NAME}%/%{CT_NAME}%-ld",
+ ),
+ tool_path(
+ name = "nm",
+ path = "%{YOCTO_COMPILER_PATH}%/recipe-sysroot-native/usr/bin/%{CT_NAME}%/%{CT_NAME}%-nm",
+ ),
+ tool_path(
+ name = "objcopy",
+ path = "%{YOCTO_COMPILER_PATH}%/recipe-sysroot-native/usr/bin/%{CT_NAME}%/%{CT_NAME}%-objcopy",
+ ),
+ tool_path(
+ name = "objdump",
+ path = "%{YOCTO_COMPILER_PATH}%/recipe-sysroot-native/usr/bin/%{CT_NAME}%/%{CT_NAME}%-objdump",
+ ),
+ tool_path(
+ name = "strip",
+ path = "%{YOCTO_COMPILER_PATH}%/recipe-sysroot-native/usr/bin/%{CT_NAME}%/%{CT_NAME}%-strip",
+ ),
+ ]
+
+ out = ctx.actions.declare_file(ctx.label.name)
+ ctx.actions.write(out, "Fake executable")
+ return [
+ cc_common.create_cc_toolchain_config_info(
+ ctx = ctx,
+ features = features,
+ action_configs = action_configs,
+ artifact_name_patterns = artifact_name_patterns,
+ cxx_builtin_include_directories = cxx_builtin_include_directories,
+ toolchain_identifier = toolchain_identifier,
+ host_system_name = host_system_name,
+ target_system_name = target_system_name,
+ target_cpu = target_cpu,
+ target_libc = target_libc,
+ compiler = compiler,
+ abi_version = abi_version,
+ abi_libc_version = abi_libc_version,
+ tool_paths = tool_paths,
+ make_variables = make_variables,
+ builtin_sysroot = builtin_sysroot,
+ cc_target_os = cc_target_os
+ ),
+ DefaultInfo(
+ executable = out,
+ ),
+ ]
+cc_toolchain_config = rule(
+ implementation = _impl,
+ attrs = {
+ "cpu": attr.string(mandatory=True),
+ },
+ provides = [CcToolchainConfigInfo],
+ executable = True,
+)
diff --git a/recipes-framework/tensorflow/files/yocto_compiler_configure.bzl b/recipes-framework/tensorflow/files/yocto_compiler_configure.bzl
index 19c7cd1..403df06 100644
--- a/recipes-framework/tensorflow/files/yocto_compiler_configure.bzl
+++ b/recipes-framework/tensorflow/files/yocto_compiler_configure.bzl
@@ -9,11 +9,31 @@ def _tpl(repository_ctx, tpl, substitutions={}, out=None):
Label("//third_party/toolchains/yocto:%s.tpl" % tpl),
substitutions)
-
def _yocto_compiler_configure_impl(repository_ctx):
- _tpl(repository_ctx, "CROSSTOOL")
- repository_ctx.symlink(repository_ctx.attr.build_file, "BUILD")
+ # We need to find a cross-compilation include directory for Python, so look
+ # for an environment variable. Be warned, this crosstool template is only
+ # regenerated on the first run of Bazel, so if you change the variable after
+ # it may not be reflected in later builds. Doing a shutdown and clean of Bazel
+ # doesn't fix this, you'll need to delete the generated file at something like:
+ # external/local_config_arm_compiler/CROSSTOOL in your Bazel install.
+ if "CROSSTOOL_PYTHON_INCLUDE_PATH" in repository_ctx.os.environ:
+ python_include_path = repository_ctx.os.environ["CROSSTOOL_PYTHON_INCLUDE_PATH"]
+ else:
+ python_include_path = "/buildarea/raid5/hjia/wrlinux-20/build_master-wr_ts_intel_2020120722/build/tmp-glibc/work/corei7-64-wrs-linux/tensorflow/2.4.0-r0/recipe-sysroot/usr/include/python3.9"
+
+ if "CT_NAME" in repository_ctx.os.environ:
+ cross_tool_name = repository_ctx.os.environ["CT_NAME"]
+ else:
+ cross_tool_name = "x86_64-wrs-linux"
+ _tpl(repository_ctx, "cc_config.bzl", {
+ "%{YOCTO_COMPILER_PATH}%": str(repository_ctx.path(
+ repository_ctx.attr.remote_config_repo,
+ )),
+ "%{PYTHON_INCLUDE_PATH}%": python_include_path,
+ "%{CT_NAME}%": cross_tool_name,
+ })
+ repository_ctx.symlink(repository_ctx.attr.build_file, "BUILD")
yocto_compiler_configure = repository_rule(
implementation = _yocto_compiler_configure_impl,
diff --git a/recipes-framework/tensorflow/tensorflow-estimator_1.13.bb b/recipes-framework/tensorflow/tensorflow-estimator_2.4.bb
similarity index 100%
rename from recipes-framework/tensorflow/tensorflow-estimator_1.13.bb
rename to recipes-framework/tensorflow/tensorflow-estimator_2.4.bb
diff --git a/recipes-framework/tensorflow/tensorflow_2.4.0.bb b/recipes-framework/tensorflow/tensorflow_2.4.0.bb
index aeb1a80..ba441a7 100644
--- a/recipes-framework/tensorflow/tensorflow_2.4.0.bb
+++ b/recipes-framework/tensorflow/tensorflow_2.4.0.bb
@@ -6,9 +6,11 @@ SRC_URI += " \
file://0001-label_image-tweak-default-model-location.patch \
file://0001-label_image.lite-tweak-default-model-location.patch \
file://0001-CheckFeatureOrDie-use-warning-to-avoid-die.patch \
- file://BUILD \
+ file://0001-support-32-bit-x64-and-arm-for-yocto.patch \
+ file://BUILD.in \
file://BUILD.yocto_compiler \
file://CROSSTOOL.tpl \
+ file://cc_config.bzl.tpl \
file://yocto_compiler_configure.bzl \
"
@@ -33,6 +35,11 @@ RDEPENDS_${PN} += " \
python3-astunparse \
python3-gast \
python3-termcolor \
+ python3-wrapt \
+ python3-opt-einsum \
+ python3-google-pasta \
+ python3-typing-extensions \
+ flatbuffers-python3 \
tensorboard \
tensorflow-estimator \
"
@@ -40,8 +47,9 @@ RDEPENDS_${PN} += " \
export PYTHON_BIN_PATH="${PYTHON}"
export PYTHON_LIB_PATH="${STAGING_LIBDIR_NATIVE}/${PYTHON_DIR}/site-packages"
+export CROSSTOOL_PYTHON_INCLUDE_PATH="${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}"
+
do_configure_append () {
- CROSSTOOL_PYTHON_INCLUDE_PATH="${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}"
if [ ! -e ${CROSSTOOL_PYTHON_INCLUDE_PATH}/pyconfig-target.h ];then
mv ${CROSSTOOL_PYTHON_INCLUDE_PATH}/pyconfig.h ${CROSSTOOL_PYTHON_INCLUDE_PATH}/pyconfig-target.h
fi
@@ -61,8 +69,10 @@ do_configure_append () {
ENDOF
mkdir -p ${S}/third_party/toolchains/yocto/
- install -m 644 ${WORKDIR}/BUILD ${S}/third_party/toolchains/yocto/
+ sed "s#%%CPU%%#${BAZEL_TARGET_CPU}#g" ${WORKDIR}/BUILD.in > ${S}/third_party/toolchains/yocto/BUILD
+ chmod 644 ${S}/third_party/toolchains/yocto/BUILD
install -m 644 ${WORKDIR}/CROSSTOOL.tpl ${S}/third_party/toolchains/yocto/
+ install -m 644 ${WORKDIR}/cc_config.bzl.tpl ${S}/third_party/toolchains/yocto/
install -m 644 ${WORKDIR}/yocto_compiler_configure.bzl ${S}/third_party/toolchains/yocto/
install -m 644 ${WORKDIR}/BUILD.yocto_compiler ${S}
@@ -82,14 +92,16 @@ ENDOF
TF_ARGS_EXTRA ??= ""
TF_TARGET_EXTRA ??= ""
do_compile () {
+ export CT_NAME=$(echo ${HOST_PREFIX} | rev | cut -c 2- | rev)
unset CC
${BAZEL} build \
${TF_ARGS_EXTRA} \
-c opt \
- --cpu=armeabi \
+ --cpu=${BAZEL_TARGET_CPU} \
--subcommands --explain=${T}/explain.log \
--verbose_explanations --verbose_failures \
--crosstool_top=@local_config_yocto_compiler//:toolchain \
+ --host_crosstool_top=@bazel_tools//tools/cpp:toolchain \
--verbose_failures \
--copt -DTF_LITE_DISABLE_X86_NEON \
//tensorflow:libtensorflow.so \
@@ -159,6 +171,7 @@ do_install() {
FILES_${PN}-dev = ""
INSANE_SKIP_${PN} += "dev-so \
+ already-stripped \
"
FILES_${PN} += "${libdir}/* ${datadir}/*"
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 12/25] tensorflow: fix Multiple shlib providers for libtensorflow_framework.so
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
` (10 preceding siblings ...)
2020-12-16 13:08 ` [meta-tensorflow][PATCH 11/25] tensorflow: update cross compile support hongxu
@ 2020-12-16 13:08 ` hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 13/25] classes/bazel.bbclass: clean up bazel files before do_clean hongxu
` (12 subsequent siblings)
24 siblings, 0 replies; 33+ messages in thread
From: hongxu @ 2020-12-16 13:08 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
|ERROR: tensorflow: Multiple shlib providers for
libtensorflow_framework.so.2: tensorflow, tensorflow (used by files:
tmp-glibc/work/core2-64-wrs-linux/tensorflow/2.4.0-r0/packages-split/
tensorflow/usr/lib64/python3.9/site-packages/tensorflow/python/
_pywrap_tf_session.so)
Remove the duplicate one
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
recipes-framework/tensorflow/tensorflow_2.4.0.bb | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/recipes-framework/tensorflow/tensorflow_2.4.0.bb b/recipes-framework/tensorflow/tensorflow_2.4.0.bb
index ba441a7..af66397 100644
--- a/recipes-framework/tensorflow/tensorflow_2.4.0.bb
+++ b/recipes-framework/tensorflow/tensorflow_2.4.0.bb
@@ -120,8 +120,6 @@ do_install() {
${D}${libdir}
install -m 644 ${S}/bazel-bin/tensorflow/libtensorflow_cc.so \
${D}${libdir}
- install -m 644 ${S}/bazel-bin/tensorflow/libtensorflow_framework.so \
- ${D}${libdir}
install -d ${D}${sbindir}
install -m 755 ${S}/bazel-bin/tensorflow/tools/benchmark/benchmark_model \
@@ -165,7 +163,7 @@ do_install() {
mv $app ${D}${sbindir}
done
- rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/tensorflow/libtensorflow_framework.so
+ mv ${D}${PYTHON_SITEPACKAGES_DIR}/tensorflow/libtensorflow_framework.so* ${D}${libdir}
)
}
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 13/25] classes/bazel.bbclass: clean up bazel files before do_clean
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
` (11 preceding siblings ...)
2020-12-16 13:08 ` [meta-tensorflow][PATCH 12/25] tensorflow: fix Multiple shlib providers for libtensorflow_framework.so hongxu
@ 2020-12-16 13:08 ` hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 14/25] python3-google-auth: 1.6.3 -> 1.24.0 hongxu
` (11 subsequent siblings)
24 siblings, 0 replies; 33+ messages in thread
From: hongxu @ 2020-12-16 13:08 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
classes/bazel.bbclass | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/classes/bazel.bbclass b/classes/bazel.bbclass
index 5a76244..3ace2ba 100644
--- a/classes/bazel.bbclass
+++ b/classes/bazel.bbclass
@@ -75,7 +75,7 @@ bazel_do_configure () {
cat > "${S}/bazelrc" <<-EOF
build --verbose_failures
build --spawn_strategy=standalone --genrule_strategy=standalone
-build --jobs=${BAZEL_JOBS} --local_ram_resources=4096 --local_cpu_resources=${BAZEL_JOBS}
+#build --jobs=${BAZEL_JOBS} --local_ram_resources=4096 --local_cpu_resources=${BAZEL_JOBS}
test --verbose_failures --verbose_test_summary
test --spawn_strategy=standalone --genrule_strategy=standalone
@@ -116,3 +116,13 @@ PSEUDO_IGNORE_PATHS .= ",${WORKDIR}/bazel"
inherit unsupportarch
export YOCTO_NATIVE_SYSROOT="${BAZEL_OUTPUTBASE_DIR}/external/yocto_compiler/recipe-sysroot-native"
+
+do_clean[prefuncs] += "clean_bazel"
+clean_bazel() {
+ if [ -d ${S} ]; then
+ cd ${S}
+ if [ -e ${BAZEL} ] && [ -e ${S}/bazelrc ]; then
+ ${BAZEL} clean
+ fi
+ fi
+}
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 14/25] python3-google-auth: 1.6.3 -> 1.24.0
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
` (12 preceding siblings ...)
2020-12-16 13:08 ` [meta-tensorflow][PATCH 13/25] classes/bazel.bbclass: clean up bazel files before do_clean hongxu
@ 2020-12-16 13:08 ` hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 15/25] python3-google-auth-oauthlib: add version 0.4.2 hongxu
` (10 subsequent siblings)
24 siblings, 0 replies; 33+ messages in thread
From: hongxu @ 2020-12-16 13:08 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
Move it from meta-demo to meta-tensorflow which is required by
tensorboard
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
.../python/python-google-auth.inc | 10 ++++++++--
.../python/python3-google-auth_1.24.0.bb | 0
2 files changed, 8 insertions(+), 2 deletions(-)
rename {meta-demo/recipes-devtools => recipes-devtools}/python/python-google-auth.inc (63%)
rename meta-demo/recipes-devtools/python/python3-google-auth_1.6.3.bb => recipes-devtools/python/python3-google-auth_1.24.0.bb (100%)
diff --git a/meta-demo/recipes-devtools/python/python-google-auth.inc b/recipes-devtools/python/python-google-auth.inc
similarity index 63%
rename from meta-demo/recipes-devtools/python/python-google-auth.inc
rename to recipes-devtools/python/python-google-auth.inc
index 61e37c0..bfee039 100644
--- a/meta-demo/recipes-devtools/python/python-google-auth.inc
+++ b/recipes-devtools/python/python-google-auth.inc
@@ -9,7 +9,13 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
inherit pypi
-SRC_URI[md5sum] = "0440718247cc4531422e2a8f4f012e8b"
-SRC_URI[sha256sum] = "0f7c6a64927d34c1a474da92cfc59e552a5d3b940d3266606c6a28b72888b9e4"
+SRC_URI[md5sum] = "d1f8a9284283b8db69e84c41b36db501"
+SRC_URI[sha256sum] = "0b0e026b412a0ad096e753907559e4bdb180d9ba9f68dd9036164db4fdc4ad2e"
+
+RDEPENDS_${PN} += " \
+ python3-cachetools \
+ python3-rsa \
+ python3-pyasn1-modules \
+"
BBCLASSEXTEND = "native"
diff --git a/meta-demo/recipes-devtools/python/python3-google-auth_1.6.3.bb b/recipes-devtools/python/python3-google-auth_1.24.0.bb
similarity index 100%
rename from meta-demo/recipes-devtools/python/python3-google-auth_1.6.3.bb
rename to recipes-devtools/python/python3-google-auth_1.24.0.bb
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 15/25] python3-google-auth-oauthlib: add version 0.4.2
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
` (13 preceding siblings ...)
2020-12-16 13:08 ` [meta-tensorflow][PATCH 14/25] python3-google-auth: 1.6.3 -> 1.24.0 hongxu
@ 2020-12-16 13:08 ` hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 16/25] python3-pyasn1: add 0.4.8 hongxu
` (9 subsequent siblings)
24 siblings, 0 replies; 33+ messages in thread
From: hongxu @ 2020-12-16 13:08 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
It is required by tensorboard
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
.../python3-google-auth-oauthlib_0.4.2.bb | 20 +++++++++++++++++++
1 file changed, 20 insertions(+)
create mode 100644 recipes-devtools/python/python3-google-auth-oauthlib_0.4.2.bb
diff --git a/recipes-devtools/python/python3-google-auth-oauthlib_0.4.2.bb b/recipes-devtools/python/python3-google-auth-oauthlib_0.4.2.bb
new file mode 100644
index 0000000..09e3900
--- /dev/null
+++ b/recipes-devtools/python/python3-google-auth-oauthlib_0.4.2.bb
@@ -0,0 +1,20 @@
+SUMMARY = "The oauthlib integration for Google Auth"
+HOMEPAGE = "https://github.com/googleapis/google-auth-library-python-oauthlib"
+DESCRIPTION = "This library provides oauthlib integration with google-auth."
+SECTION = "devel/python"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=7b7e367c7e1664e6565ee7d16cccc58a"
+
+inherit pypi
+
+SRC_URI[md5sum] = "5d3cb6250dd05fff0b7bc0912a3e8f0a"
+SRC_URI[sha256sum] = "65b65bc39ad8cab15039b35e5898455d3d66296d0584d96fe0e79d67d04c51d9"
+
+BBCLASSEXTEND = "native"
+
+RDEPENDS_${PN} += " \
+ python3-requests-oauthlib \
+ python3-oauthlib \
+"
+inherit setuptools3
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 16/25] python3-pyasn1: add 0.4.8
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
` (14 preceding siblings ...)
2020-12-16 13:08 ` [meta-tensorflow][PATCH 15/25] python3-google-auth-oauthlib: add version 0.4.2 hongxu
@ 2020-12-16 13:08 ` hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 17/25] python3-pyasn1-modules: add version 0.2.8 hongxu
` (8 subsequent siblings)
24 siblings, 0 replies; 33+ messages in thread
From: hongxu @ 2020-12-16 13:08 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
It is required by tensorboard
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
recipes-devtools/python/python3-pyasn1_0.4.8.bb | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100644 recipes-devtools/python/python3-pyasn1_0.4.8.bb
diff --git a/recipes-devtools/python/python3-pyasn1_0.4.8.bb b/recipes-devtools/python/python3-pyasn1_0.4.8.bb
new file mode 100644
index 0000000..7f8b718
--- /dev/null
+++ b/recipes-devtools/python/python3-pyasn1_0.4.8.bb
@@ -0,0 +1,17 @@
+SUMMARY = "ASN.1 library for Python"
+HOMEPAGE = "https://github.com/etingof/pyasn1"
+DESCRIPTION = "This is a free and open source implementation of ASN.1 types \
+and codecs as a Python package"
+SECTION = "devel/python"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE.rst;md5=a14482d15c2249de3b6f0e8a47e021fd"
+
+inherit pypi
+
+SRC_URI[md5sum] = "dffae4ff9f997a83324b3f33fe62be54"
+SRC_URI[sha256sum] = "aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba"
+
+BBCLASSEXTEND = "native"
+
+inherit setuptools3
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 17/25] python3-pyasn1-modules: add version 0.2.8
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
` (15 preceding siblings ...)
2020-12-16 13:08 ` [meta-tensorflow][PATCH 16/25] python3-pyasn1: add 0.4.8 hongxu
@ 2020-12-16 13:08 ` hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 18/25] tensorboard: 1.12.2 -> 2.4 hongxu
` (7 subsequent siblings)
24 siblings, 0 replies; 33+ messages in thread
From: hongxu @ 2020-12-16 13:08 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
It is required by tensorboard
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
.../python/python3-pyasn1-modules_0.2.8.bb | 22 +++++++++++++++++++
1 file changed, 22 insertions(+)
create mode 100644 recipes-devtools/python/python3-pyasn1-modules_0.2.8.bb
diff --git a/recipes-devtools/python/python3-pyasn1-modules_0.2.8.bb b/recipes-devtools/python/python3-pyasn1-modules_0.2.8.bb
new file mode 100644
index 0000000..fb11941
--- /dev/null
+++ b/recipes-devtools/python/python3-pyasn1-modules_0.2.8.bb
@@ -0,0 +1,22 @@
+SUMMARY = "ASN.1 modules for Python"
+HOMEPAGE = "https://github.com/etingof/pyasn1-modules"
+DESCRIPTION = "The pyasn1-modules package contains a collection of \
+ASN.1 data structures expressed as Python classes based on \
+pyasn1 data model."
+SECTION = "devel/python"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=a14482d15c2249de3b6f0e8a47e021fd"
+
+inherit pypi
+
+SRC_URI[md5sum] = ""
+SRC_URI[sha256sum] = ""
+
+RDEPENDS_${PN} += " \
+ python3-pyasn1 \
+"
+
+BBCLASSEXTEND = "native"
+
+inherit setuptools3
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 18/25] tensorboard: 1.12.2 -> 2.4
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
` (16 preceding siblings ...)
2020-12-16 13:08 ` [meta-tensorflow][PATCH 17/25] python3-pyasn1-modules: add version 0.2.8 hongxu
@ 2020-12-16 13:08 ` hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 19/25] tensorflow: clean up CROSSTOOL.tpl hongxu
` (6 subsequent siblings)
24 siblings, 0 replies; 33+ messages in thread
From: hongxu @ 2020-12-16 13:08 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
Rebase patch to 2.4
- 0001-customize-for-Yocto.patch
Fix projector cannot find module 'd3'
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
.../0001-customize-for-Yocto.patch | 199 +++++++++++-------
...-projector-fix-cannot-find-module-d3.patch | 34 +++
...nsorboard_1.12.2.bb => tensorboard_2.4.bb} | 53 ++++-
3 files changed, 195 insertions(+), 91 deletions(-)
create mode 100644 recipes-framework/tensorflow/tensorboard/0001-projector-fix-cannot-find-module-d3.patch
rename recipes-framework/tensorflow/{tensorboard_1.12.2.bb => tensorboard_2.4.bb} (47%)
diff --git a/recipes-framework/tensorflow/tensorboard/0001-customize-for-Yocto.patch b/recipes-framework/tensorflow/tensorboard/0001-customize-for-Yocto.patch
index 07d8257..4055e0b 100644
--- a/recipes-framework/tensorflow/tensorboard/0001-customize-for-Yocto.patch
+++ b/recipes-framework/tensorflow/tensorboard/0001-customize-for-Yocto.patch
@@ -1,6 +1,6 @@
-From 03b1ddf5058485ce1c94e6a8dc0762ad3430b6a2 Mon Sep 17 00:00:00 2001
+From 30c3d17327b7b66e082dbb443c9e528bf7aa6ac4 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Thu, 25 Apr 2019 21:13:32 +0800
+Date: Mon, 14 Dec 2020 15:14:25 +0800
Subject: [PATCH] customize for Yocto
- Remove virtualenv/pip/bdist_wheel calling which Yocto does not support
@@ -11,13 +11,13 @@ Upstream-Status: Inappropriate [oe specific]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
- WORKSPACE | 6 ++++++
- tensorboard/pip_package/build_pip_package.sh | 31 +++-------------------------
- third_party/workspace.bzl | 8 +++++++
- 3 files changed, 17 insertions(+), 28 deletions(-)
+ WORKSPACE | 6 +++
+ tensorboard/pip_package/build_pip_package.sh | 57 ++------------------
+ third_party/workspace.bzl | 8 +++
+ 3 files changed, 17 insertions(+), 54 deletions(-)
diff --git a/WORKSPACE b/WORKSPACE
-index 8ab70cc..0c18f6f 100644
+index 86f5feaa..8056cfff 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -1,5 +1,11 @@
@@ -31,102 +31,139 @@ index 8ab70cc..0c18f6f 100644
+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
- # Needed as a transitive dependency of rules_webtesting below.
+ http_archive(
diff --git a/tensorboard/pip_package/build_pip_package.sh b/tensorboard/pip_package/build_pip_package.sh
-index 754fa83..969709d 100755
+index ef8df010..085ea608 100755
--- a/tensorboard/pip_package/build_pip_package.sh
+++ b/tensorboard/pip_package/build_pip_package.sh
-@@ -23,7 +23,7 @@ else
- sedi="sed -i"
- fi
-
--run_smoke_test=1
-+run_smoke_test=0
- while [ "$#" -gt 0 ]; do
- case "$1" in
- "--no-smoke")
-@@ -71,31 +71,20 @@ from tensorboard.plugins.beholder import Beholder, BeholderHook
+@@ -12,7 +12,7 @@
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+-
++set -x
+ usage() {
+ cat <<EOF
+ usage: build_pip_package OUTPUT_DIR
+@@ -28,12 +28,6 @@ EOF
}
- set -x
--command -v curl >/dev/null
--command -v perl >/dev/null
--command -v python2 >/dev/null
--command -v python3 >/dev/null
--command -v virtualenv >/dev/null
- [ -d "${RUNFILES}" ]
+ main() {
+- if [ $# -ne 1 ]; then
+- usage 2>&1
+- return 1
+- fi
+- output="$1"
+-
+ if [ -z "${RUNFILES+set}" ]; then
+ RUNFILES="$(CDPATH="" cd -- "$0.runfiles" && pwd)"
+ fi
+@@ -41,16 +35,12 @@ main() {
+ if [ "$(uname)" = "Darwin" ]; then
+ workdir="$(mktemp -d -t tensorboard-pip)"
+ else
+- workdir="$(mktemp -d -p /tmp -t tensorboard-pip.XXXXXXXXXX)"
++ workdir="${DESTDIR}"
++ rm -rf ${workdir} && mkdir -p ${workdir}
+ fi
+ original_wd="${PWD}"
+ cd "${workdir}" || return 2
--dest=/tmp/tensorboard
-+dest=${DESTDIR}
- if [ ! -e $dest ]; then
-- mkdir $dest
-+ mkdir -p $dest
- else
- dest="$(mktemp -d -p /tmp -t tensorboard-pip.XXXXXXXXXX)"
- fi
- cd "${dest}"
+- cleanup() {
+- rm -r "${workdir}"
+- }
+- trap cleanup EXIT
+-
+ log_file="${workdir}/log"
+ build >"${log_file}" 2>&1
+ exit_code=$?
+@@ -68,20 +58,12 @@ build() (
+ sedi="sed -i"
+ fi
- cp -LR "${RUNFILES}/org_tensorflow_tensorboard/tensorboard" .
--mv -f "tensorboard/pip_package/LICENSE" .
--mv -f "tensorboard/pip_package/MANIFEST.in" .
--mv -f "tensorboard/pip_package/README.rst" .
--mv -f "tensorboard/pip_package/setup.cfg" .
--mv -f "tensorboard/pip_package/setup.py" .
- rm -rf tensorboard/pip_package
+- command -v virtualenv >/dev/null
+ [ -d "${RUNFILES}" ]
- rm -f tensorboard/tensorboard # bazel py_binary sh wrapper
--chmod -x LICENSE # bazel symlinks confuse cp
- find . -name __init__.py | xargs chmod -x # which goes for all genfiles
+ cp -LR "${RUNFILES}/org_tensorflow_tensorboard/tensorboard" .
+- mv -f "tensorboard/pip_package/LICENSE" .
+- mv -f "tensorboard/pip_package/MANIFEST.in" .
+- mv -f "tensorboard/pip_package/README.rst" .
+- mv -f "tensorboard/pip_package/requirements.txt" .
+- mv -f "tensorboard/pip_package/setup.cfg" .
+- mv -f "tensorboard/pip_package/setup.py" .
+ rm -rf "tensorboard/pip_package"
- mkdir -p tensorboard/_vendor
-@@ -117,21 +106,7 @@ find tensorboard -name \*.py |
- s/from tensorflow_serving/from tensorboard._vendor.tensorflow_serving/
- '
+ rm -f tensorboard/tensorboard # bazel py_binary sh wrapper
+- chmod -x LICENSE # bazel symlinks confuse cp
+ find . -name __init__.py -exec chmod -x {} + # which goes for all genfiles
--virtualenv venv
--export VIRTUAL_ENV=venv
--export PATH="$PWD/venv/bin:${PATH}"
--unset PYTHON_HOME
+ mkdir -p tensorboard/_vendor
+@@ -100,39 +82,6 @@ build() (
+ s/^import webencodings$/from tensorboard._vendor import webencodings/
+ s/^from webencodings/from tensorboard._vendor.webencodings/
+ ' {} +
-
--# Require wheel for bdist_wheel command, and setuptools 36.2.0+ so that
--# env markers are handled (https://github.com/pypa/setuptools/pull/1081)
--pip install -qU wheel 'setuptools>=36.2.0'
+- virtualenv -q -p python3 venv
+- export VIRTUAL_ENV=venv
+- export PATH="${PWD}/venv/bin:${PATH}"
+- unset PYTHON_HOME
-
--python setup.py bdist_wheel --python-tag py2 >/dev/null
--python setup.py bdist_wheel --python-tag py3 >/dev/null
+- # Require wheel for bdist_wheel command, and setuptools 36.2.0+ so that
+- # env markers are handled (https://github.com/pypa/setuptools/pull/1081)
+- export PYTHONWARNINGS=ignore:DEPRECATION # suppress Python 2.7 deprecation spam
+- pip install -qU wheel 'setuptools>=36.2.0'
-
- if [ "$run_smoke_test" = 1 ]; then
- smoke 2
- smoke 3
- fi
+- # Overrides file timestamps in the zip archive to make the build
+- # reproducible. (Date is mostly arbitrary, but must be past 1980 to be
+- # representable in a zip archive.)
+- export SOURCE_DATE_EPOCH=1577836800 # 2020-01-01T00:00:00Z
-
--ls -hal "$PWD/dist"
+- python setup.py bdist_wheel --python-tag py3 >/dev/null
+-
+- cd "${original_wd}" # Bazel gives "${output}" as a relative path >_>
+- case "${output}" in
+- *.tar.gz)
+- mkdir -p "$(dirname "${output}")"
+- "${RUNFILES}/org_tensorflow_tensorboard/tensorboard/pip_package/deterministic_tar_gz" \
+- "${output}" "${workdir}"/dist/*.whl
+- ;;
+- *)
+- if ! [ -d "${output}" ]; then
+- printf >&2 'fatal: no such output directory: %s\n' "${output}"
+- return 1
+- fi
+- mv "${workdir}"/dist/*.whl "${output}"
+- ;;
+- esac
+ )
+
+ main "$@"
diff --git a/third_party/workspace.bzl b/third_party/workspace.bzl
-index 083c441..24786f8 100644
+index e6a5183f..9260a8ab 100644
--- a/third_party/workspace.bzl
+++ b/third_party/workspace.bzl
-@@ -24,6 +24,7 @@ load("//third_party:polymer.bzl", "tensorboard_polymer_workspace")
- load("//third_party:python.bzl", "tensorboard_python_workspace")
+@@ -25,6 +25,7 @@ load("//third_party:python.bzl", "tensorboard_python_workspace")
load("//third_party:js.bzl", "tensorboard_js_workspace")
+ load("//third_party:rust.bzl", "tensorboard_rust_workspace")
load("//third_party:typings.bzl", "tensorboard_typings_workspace")
+load("//third_party/toolchains/yocto:yocto_compiler_configure.bzl", "yocto_compiler_configure")
- def tensorboard_workspace():
- tensorboard_fonts_workspace()
-@@ -32,6 +33,13 @@ def tensorboard_workspace():
- tensorboard_typings_workspace()
- tensorboard_js_workspace()
+ def tensorboard_workspace(name = ""):
+ """Add repositories needed to build TensorBoard.
+@@ -39,6 +40,13 @@ def tensorboard_workspace(name = ""):
+ tensorboard_js_workspace()
+ tensorboard_rust_workspace()
-+ # Point //external/local_config_yocto_compiler to //external/yocto_compiler
-+ yocto_compiler_configure(
-+ name = "local_config_yocto_compiler",
-+ build_file = str(Label("//third_party/toolchains/yocto:BUILD")),
-+ remote_config_repo = "../yocto_compiler",
-+ )
++ # Point //external/local_config_yocto_compiler to //external/yocto_compiler
++ yocto_compiler_configure(
++ name = "local_config_yocto_compiler",
++ build_file = str(Label("//third_party/toolchains/yocto:BUILD")),
++ remote_config_repo = "../yocto_compiler",
++ )
+
- http_archive(
- name = "com_google_protobuf_js",
- strip_prefix = "protobuf-3.6.0/js",
+ # Set up TypeScript toolchain.
+ ts_setup_workspace()
+
--
-2.7.4
+2.18.2
diff --git a/recipes-framework/tensorflow/tensorboard/0001-projector-fix-cannot-find-module-d3.patch b/recipes-framework/tensorflow/tensorboard/0001-projector-fix-cannot-find-module-d3.patch
new file mode 100644
index 0000000..1cab5dd
--- /dev/null
+++ b/recipes-framework/tensorflow/tensorboard/0001-projector-fix-cannot-find-module-d3.patch
@@ -0,0 +1,34 @@
+From 60f90ec3cc3e417c4b8fe2ea25ddf6e5ff99bde0 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Mon, 14 Dec 2020 14:51:36 +0800
+Subject: [PATCH] projector: fix cannot find module 'd3'
+
+[snip]
+$ bazel run tensorboard/plugins/projector/vz_projector:standalone
+tensorboard/plugins/projector/vz_projector/projectorScatterPlotAdapter.ts:16:21 - error TS2307: Cannot find module 'd3'.
+
+16 import * as d3 from 'd3';
+[snip]
+
+Upstream-Status: Submitted [https://github.com/tensorflow/tensorboard/pull/4465]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ tensorboard/plugins/projector/vz_projector/BUILD | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tensorboard/plugins/projector/vz_projector/BUILD b/tensorboard/plugins/projector/vz_projector/BUILD
+index f173cd78..1529440d 100644
+--- a/tensorboard/plugins/projector/vz_projector/BUILD
++++ b/tensorboard/plugins/projector/vz_projector/BUILD
+@@ -63,6 +63,7 @@ tf_ts_library(
+ "//tensorboard/webapp/third_party:tfjs",
+ "@npm//@polymer/decorators",
+ "@npm//@polymer/polymer",
++ "@npm//@types/d3",
+ "@npm//d3",
+ "@npm//numeric",
+ "@npm//three",
+--
+2.18.2
+
diff --git a/recipes-framework/tensorflow/tensorboard_1.12.2.bb b/recipes-framework/tensorflow/tensorboard_2.4.bb
similarity index 47%
rename from recipes-framework/tensorflow/tensorboard_1.12.2.bb
rename to recipes-framework/tensorflow/tensorboard_2.4.bb
index a27bdea..aa97890 100644
--- a/recipes-framework/tensorflow/tensorboard_1.12.2.bb
+++ b/recipes-framework/tensorflow/tensorboard_2.4.bb
@@ -3,17 +3,22 @@ your TensorFlow runs and graphs."
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=e74df23890b9521cc481e3348863e45d"
-SRC_URI = "git://github.com/tensorflow/tensorboard.git; \
+SRC_URI = "git://github.com/tensorflow/tensorboard.git;branch=2.4; \
file://0001-customize-for-Yocto.patch \
- file://BUILD \
+ file://0001-projector-fix-cannot-find-module-d3.patch \
+ file://BUILD.in \
file://BUILD.yocto_compiler \
- file://CROSSTOOL.tpl \
+ file://cc_config.bzl.tpl \
file://yocto_compiler_configure.bzl \
"
-SRCREV = "7194c7486a0c4d107322ffad102c1ca0fcc0fc24"
+SRCREV = "4e2a918a0559514a633c3a29ac6238fed4b72ed5"
S = "${WORKDIR}/git"
-DEPENDS = "util-linux-native"
+DEPENDS = " \
+ util-linux-native \
+ python3-numpy-native \
+ python3-absl-native \
+"
RDEPENDS_${PN} += "python3 \
python3-core \
@@ -23,13 +28,40 @@ RDEPENDS_${PN} += "python3 \
python3-werkzeug \
python3-six \
python3-markdown \
+ python3-absl \
+ python3-google-auth \
+ python3-google-auth-oauthlib \
+ python3-requests \
"
inherit python3native bazel
+export PYTHON_BIN_PATH="${PYTHON}"
+export PYTHON_LIB_PATH="${STAGING_LIBDIR_NATIVE}/${PYTHON_DIR}/site-packages"
+export CROSSTOOL_PYTHON_INCLUDE_PATH="${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}"
+
do_configure_append () {
+ if [ ! -e ${CROSSTOOL_PYTHON_INCLUDE_PATH}/pyconfig-target.h ];then
+ mv ${CROSSTOOL_PYTHON_INCLUDE_PATH}/pyconfig.h ${CROSSTOOL_PYTHON_INCLUDE_PATH}/pyconfig-target.h
+ fi
+
+ install -m 644 ${STAGING_INCDIR_NATIVE}/python${PYTHON_BASEVERSION}${PYTHON_ABI}/pyconfig.h \
+ ${CROSSTOOL_PYTHON_INCLUDE_PATH}/pyconfig-native.h
+
+ cat > ${CROSSTOOL_PYTHON_INCLUDE_PATH}/pyconfig.h <<ENDOF
+#if defined (_PYTHON_INCLUDE_TARGET)
+#include "pyconfig-target.h"
+#elif defined (_PYTHON_INCLUDE_NATIVE)
+#include "pyconfig-native.h"
+#else
+#error "_PYTHON_INCLUDE_TARGET or _PYTHON_INCLUDE_NATIVE is not defined"
+#endif // End of #if defined (_PYTHON_INCLUDE_TARGET)
+
+ENDOF
+
mkdir -p ${S}/third_party/toolchains/yocto/
- install -m 644 ${WORKDIR}/BUILD ${S}/third_party/toolchains/yocto/
- install -m 644 ${WORKDIR}/CROSSTOOL.tpl ${S}/third_party/toolchains/yocto/
+ sed "s#%%CPU%%#${BAZEL_TARGET_CPU}#g" ${WORKDIR}/BUILD.in > ${S}/third_party/toolchains/yocto/BUILD
+ chmod 644 ${S}/third_party/toolchains/yocto/BUILD
+ install -m 644 ${WORKDIR}/cc_config.bzl.tpl ${S}/third_party/toolchains/yocto/
install -m 644 ${WORKDIR}/yocto_compiler_configure.bzl ${S}/third_party/toolchains/yocto/
install -m 644 ${WORKDIR}/BUILD.yocto_compiler ${S}
@@ -39,25 +71,26 @@ do_configure_append () {
SED_COMMAND="${SED_COMMAND}; s#%%YOCTO_COMPILER_PATH%%#${BAZEL_OUTPUTBASE_DIR}/external/yocto_compiler#g"
sed -i "${SED_COMMAND}" ${S}/BUILD.yocto_compiler \
- ${S}/third_party/toolchains/yocto/CROSSTOOL.tpl \
${S}/WORKSPACE
}
do_compile () {
unset CC
+ export CT_NAME=$(echo ${HOST_PREFIX} | rev | cut -c 2- | rev)
DESTDIR=${WORKDIR}/python-tensorboard \
${BAZEL} run \
- --cpu=armeabi \
+ --cpu=${BAZEL_TARGET_CPU} \
--subcommands --explain=${T}/explain.log \
--verbose_explanations --verbose_failures \
--crosstool_top=@local_config_yocto_compiler//:toolchain \
+ --host_crosstool_top=@bazel_tools//tools/cpp:toolchain \
--verbose_failures \
//tensorboard/pip_package:build_pip_package
}
do_install () {
install -d ${D}${PYTHON_SITEPACKAGES_DIR}
- cp -rf ${WORKDIR}/python-tensorboard/* ${D}${PYTHON_SITEPACKAGES_DIR}
+ cp -rf ${WORKDIR}/python-tensorboard/tensorboard ${D}${PYTHON_SITEPACKAGES_DIR}
}
FILES_${PN} += "${libdir}/*"
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 19/25] tensorflow: clean up CROSSTOOL.tpl
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
` (17 preceding siblings ...)
2020-12-16 13:08 ` [meta-tensorflow][PATCH 18/25] tensorboard: 1.12.2 -> 2.4 hongxu
@ 2020-12-16 13:08 ` hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 20/25] bazel-native: 3.1.0 -> 3.7.1 hongxu
` (5 subsequent siblings)
24 siblings, 0 replies; 33+ messages in thread
From: hongxu @ 2020-12-16 13:08 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
CROSSTOOL files are no longer supported after Bazel v0.26+
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
.../tensorflow/files/CROSSTOOL.tpl | 230 ------------------
.../tensorflow/tensorflow_2.4.0.bb | 3 -
2 files changed, 233 deletions(-)
delete mode 100644 recipes-framework/tensorflow/files/CROSSTOOL.tpl
diff --git a/recipes-framework/tensorflow/files/CROSSTOOL.tpl b/recipes-framework/tensorflow/files/CROSSTOOL.tpl
deleted file mode 100644
index 753898a..0000000
--- a/recipes-framework/tensorflow/files/CROSSTOOL.tpl
+++ /dev/null
@@ -1,230 +0,0 @@
-major_version: "local"
-minor_version: ""
-default_target_cpu: "same_as_host"
-
-toolchain {
- abi_version: "armeabi"
- abi_libc_version: "armeabi"
- builtin_sysroot: ""
- compiler: "compiler"
- host_system_name: "armeabi"
- needsPic: true
- supports_gold_linker: false
- supports_incremental_linker: false
- supports_fission: false
- supports_interface_shared_objects: false
- supports_normalizing_ar: false
- supports_start_end_lib: false
- target_libc: "armeabi"
- target_cpu: "armeabi"
- target_system_name: "armeabi"
- toolchain_identifier: "yocto-linux-gnueabihf"
-
- tool_path { name: "ar" path: "%%YOCTO_COMPILER_PATH%%/recipe-sysroot-native/usr/bin/%%CT_NAME%%/%%CT_NAME%%-ar" }
- tool_path { name: "compat-ld" path: "/bin/false" }
- tool_path { name: "cpp" path: "%%YOCTO_COMPILER_PATH%%/recipe-sysroot-native/usr/bin/%%CT_NAME%%/%%CT_NAME%%-cpp" }
- tool_path { name: "dwp" path: "%%YOCTO_COMPILER_PATH%%/recipe-sysroot-native/usr/bin/%%CT_NAME%%/%%CT_NAME%%-dwp" }
- tool_path { name: "gcc" path: "%%YOCTO_COMPILER_PATH%%/recipe-sysroot-native/usr/bin/%%CT_NAME%%/%%CT_NAME%%-gcc" }
- tool_path { name: "gcov" path: "%%YOCTO_COMPILER_PATH%%/recipe-sysroot-native/usr/bin/%%CT_NAME%%/%%CT_NAME%%-gcov" }
- tool_path { name: "ld" path: "%%YOCTO_COMPILER_PATH%%/recipe-sysroot-native/usr/bin/%%CT_NAME%%/%%CT_NAME%%-ld" }
-
- tool_path { name: "nm" path: "%%YOCTO_COMPILER_PATH%%/recipe-sysroot-native/usr/bin/%%CT_NAME%%/%%CT_NAME%%-nm" }
- tool_path { name: "objcopy" path: "%%YOCTO_COMPILER_PATH%%/recipe-sysroot-native/usr/bin/%%CT_NAME%%/%%CT_NAME%%-objcopy" }
- tool_path { name: "objdump" path: "%%YOCTO_COMPILER_PATH%%/recipe-sysroot-native/usr/bin/%%CT_NAME%%/%%CT_NAME%%-objdump" }
- tool_path { name: "strip" path: "%%YOCTO_COMPILER_PATH%%/recipe-sysroot-native/usr/bin/%%CT_NAME%%/%%CT_NAME%%-strip" }
-
-
- cxx_builtin_include_directory: "%%YOCTO_COMPILER_PATH%%"
-
- compiler_flag: "--sysroot=%%YOCTO_COMPILER_PATH%%/recipe-sysroot"
-
- # The path below must match the one used in
- # tensorflow/tools/ci_build/pi/build_raspberry_pi.sh.
- cxx_builtin_include_directory: "/tmp/openblas_install/include/"
- cxx_flag: "-std=c++11"
- # The cxx_builtin_include_directory directives don't seem to be adding these, so
- # explicitly set them as flags. There's a query to the Bazel team outstanding about
- # why this is necessary.
- linker_flag: "-lstdc++"
-
- unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
- unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
- unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
- unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
-
- unfiltered_cxx_flag: "-no-canonical-prefixes"
- unfiltered_cxx_flag: "-fno-canonical-system-headers"
-
- # Include target pyconfig.h
- compiler_flag: "-D_PYTHON_INCLUDE_TARGET"
-
- compiler_flag: "-U_FORTIFY_SOURCE"
- compiler_flag: "-D_FORTIFY_SOURCE=1"
- compiler_flag: "-fstack-protector"
- compiler_flag: "-DRASPBERRY_PI" # To differentiate from mobile builds.
- linker_flag: "-Wl,-z,relro,-z,now"
-
- linker_flag: "-no-canonical-prefixes"
- linker_flag: "-pass-exit-codes"
-
- linker_flag: "-Wl,--build-id=md5"
-
- compilation_mode_flags {
- mode: DBG
- # Enable debug symbols.
- compiler_flag: "-g"
- }
- compilation_mode_flags {
- mode: OPT
-
- # No debug symbols.
- # Maybe we should enable https://gcc.gnu.org/wiki/DebugFission for opt or
- # even generally? However, that can't happen here, as it requires special
- # handling in Bazel.
- compiler_flag: "-g0"
-
- # Conservative choice for -O
- # -O3 can increase binary size and even slow down the resulting binaries.
- # Profile first and / or use FDO if you need better performance than this.
- compiler_flag: "-O2"
-
- # Disable assertions
- compiler_flag: "-DNDEBUG"
-
- # Removal of unused code and data at link time (can this increase binary size in some cases?).
- compiler_flag: "-ffunction-sections"
- compiler_flag: "-fdata-sections"
- linker_flag: "-Wl,--gc-sections"
- }
- linking_mode_flags { mode: DYNAMIC }
-
-}
-
-toolchain {
- abi_version: "local"
- abi_libc_version: "local"
- builtin_sysroot: ""
- compiler: "compiler"
- host_system_name: "local"
- needsPic: true
- supports_gold_linker: false
- supports_incremental_linker: false
- supports_fission: false
- supports_interface_shared_objects: false
- supports_normalizing_ar: false
- supports_start_end_lib: false
- target_libc: "local"
- target_cpu: "local"
- target_system_name: "local"
- toolchain_identifier: "local_linux"
-
- tool_path { name: "ar" path: "/usr/bin/ar" }
- tool_path { name: "compat-ld" path: "/usr/bin/ld" }
- tool_path { name: "cpp" path: "/usr/bin/cpp" }
- tool_path { name: "dwp" path: "/usr/bin/dwp" }
- tool_path { name: "gcc" path: "/usr/bin/gcc" }
- cxx_flag: "-std=c++0x"
- linker_flag: "-lstdc++"
- linker_flag: "-B/usr/bin/"
-
- # TODO(bazel-team): In theory, the path here ought to exactly match the path
- # used by gcc. That works because bazel currently doesn't track files at
- # absolute locations and has no remote execution, yet. However, this will need
- # to be fixed, maybe with auto-detection?
- cxx_builtin_include_directory: "/usr/lib/gcc/"
- cxx_builtin_include_directory: "/usr/lib64/gcc/"
- cxx_builtin_include_directory: "/usr/local/include"
- cxx_builtin_include_directory: "/usr/include"
- cxx_builtin_include_directory: "%%YOCTO_COMPILER_PATH%%/recipe-sysroot-native/usr/include"
-
- tool_path { name: "gcov" path: "/usr/bin/gcov" }
-
- # C(++) compiles invoke the compiler (as that is the one knowing where
- # to find libraries), but we provide LD so other rules can invoke the linker.
- tool_path { name: "ld" path: "/usr/bin/ld" }
-
- tool_path { name: "nm" path: "/usr/bin/nm" }
- tool_path { name: "objcopy" path: "/usr/bin/objcopy" }
- objcopy_embed_flag: "-I"
- objcopy_embed_flag: "binary"
- tool_path { name: "objdump" path: "/usr/bin/objdump" }
- tool_path { name: "strip" path: "/usr/bin/strip" }
-
- # Anticipated future default.
- unfiltered_cxx_flag: "-no-canonical-prefixes"
- unfiltered_cxx_flag: "-fno-canonical-system-headers"
-
- # Make C++ compilation deterministic. Use linkstamping instead of these
- # compiler symbols.
- unfiltered_cxx_flag: "-Wno-builtin-macro-redefined"
- unfiltered_cxx_flag: "-D__DATE__=\"redacted\""
- unfiltered_cxx_flag: "-D__TIMESTAMP__=\"redacted\""
- unfiltered_cxx_flag: "-D__TIME__=\"redacted\""
-
- # Security hardening on by default.
- # Conservative choice; -D_FORTIFY_SOURCE=2 may be unsafe in some cases.
- # We need to undef it before redefining it as some distributions now have
- # it enabled by default.
- compiler_flag: "-U_FORTIFY_SOURCE"
- compiler_flag: "-D_FORTIFY_SOURCE=1"
- compiler_flag: "-fstack-protector"
- linker_flag: "-Wl,-z,relro,-z,now"
-
- # Include native pyconfig.h
- compiler_flag: "-D_PYTHON_INCLUDE_NATIVE"
-
- # Enable coloring even if there's no attached terminal. Bazel removes the
- # escape sequences if --nocolor is specified. This isn't supported by gcc
- # on Ubuntu 14.04.
- # compiler_flag: "-fcolor-diagnostics"
-
- # All warnings are enabled. Maybe enable -Werror as well?
- compiler_flag: "-Wall"
- # Enable a few more warnings that aren't part of -Wall.
- compiler_flag: "-Wunused-but-set-parameter"
- # But disable some that are problematic.
- compiler_flag: "-Wno-free-nonheap-object" # has false positives
-
- # Keep stack frames for debugging, even in opt mode.
- compiler_flag: "-fno-omit-frame-pointer"
-
- # Anticipated future default.
- linker_flag: "-no-canonical-prefixes"
- # Have gcc return the exit code from ld.
- linker_flag: "-pass-exit-codes"
- # Stamp the binary with a unique identifier.
- linker_flag: "-Wl,--build-id=md5"
- linker_flag: "-Wl,--hash-style=gnu"
- # Gold linker only? Can we enable this by default?
- # linker_flag: "-Wl,--warn-execstack"
- # linker_flag: "-Wl,--detect-odr-violations"
-
- compilation_mode_flags {
- mode: DBG
- # Enable debug symbols.
- compiler_flag: "-g"
- }
- compilation_mode_flags {
- mode: OPT
-
- # No debug symbols.
- # Maybe we should enable https://gcc.gnu.org/wiki/DebugFission for opt or
- # even generally? However, that can't happen here, as it requires special
- # handling in Bazel.
- compiler_flag: "-g0"
-
- # Conservative choice for -O
- # -O3 can increase binary size and even slow down the resulting binaries.
- # Profile first and / or use FDO if you need better performance than this.
- compiler_flag: "-O2"
-
- # Disable assertions
- compiler_flag: "-DNDEBUG"
-
- # Removal of unused code and data at link time (can this increase binary size in some cases?).
- compiler_flag: "-ffunction-sections"
- compiler_flag: "-fdata-sections"
- linker_flag: "-Wl,--gc-sections"
- }
- linking_mode_flags { mode: DYNAMIC }
-}
diff --git a/recipes-framework/tensorflow/tensorflow_2.4.0.bb b/recipes-framework/tensorflow/tensorflow_2.4.0.bb
index af66397..49c868e 100644
--- a/recipes-framework/tensorflow/tensorflow_2.4.0.bb
+++ b/recipes-framework/tensorflow/tensorflow_2.4.0.bb
@@ -9,7 +9,6 @@ SRC_URI += " \
file://0001-support-32-bit-x64-and-arm-for-yocto.patch \
file://BUILD.in \
file://BUILD.yocto_compiler \
- file://CROSSTOOL.tpl \
file://cc_config.bzl.tpl \
file://yocto_compiler_configure.bzl \
"
@@ -71,7 +70,6 @@ ENDOF
mkdir -p ${S}/third_party/toolchains/yocto/
sed "s#%%CPU%%#${BAZEL_TARGET_CPU}#g" ${WORKDIR}/BUILD.in > ${S}/third_party/toolchains/yocto/BUILD
chmod 644 ${S}/third_party/toolchains/yocto/BUILD
- install -m 644 ${WORKDIR}/CROSSTOOL.tpl ${S}/third_party/toolchains/yocto/
install -m 644 ${WORKDIR}/cc_config.bzl.tpl ${S}/third_party/toolchains/yocto/
install -m 644 ${WORKDIR}/yocto_compiler_configure.bzl ${S}/third_party/toolchains/yocto/
install -m 644 ${WORKDIR}/BUILD.yocto_compiler ${S}
@@ -82,7 +80,6 @@ ENDOF
SED_COMMAND="${SED_COMMAND}; s#%%YOCTO_COMPILER_PATH%%#${BAZEL_OUTPUTBASE_DIR}/external/yocto_compiler#g"
sed -i "${SED_COMMAND}" ${S}/BUILD.yocto_compiler \
- ${S}/third_party/toolchains/yocto/CROSSTOOL.tpl \
${S}/WORKSPACE
${TF_CONFIG} \
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 20/25] bazel-native: 3.1.0 -> 3.7.1
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
` (18 preceding siblings ...)
2020-12-16 13:08 ` [meta-tensorflow][PATCH 19/25] tensorflow: clean up CROSSTOOL.tpl hongxu
@ 2020-12-16 13:08 ` hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 21/25] add classes/bazel-base.bbclass and imporve classes/bazel-base.bbclass hongxu
` (4 subsequent siblings)
24 siblings, 0 replies; 33+ messages in thread
From: hongxu @ 2020-12-16 13:08 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
...l-native_3.1.0.bb => bazel-native_3.7.1.bb} | 4 ++--
...e-sysroot-dir-to-the-default-Bazel-to.patch | 12 ++++++------
.../bazel/files/0001-python3.patch | 18 +++++++++---------
3 files changed, 17 insertions(+), 17 deletions(-)
rename recipes-devtools/bazel/{bazel-native_3.1.0.bb => bazel-native_3.7.1.bb} (90%)
diff --git a/recipes-devtools/bazel/bazel-native_3.1.0.bb b/recipes-devtools/bazel/bazel-native_3.7.1.bb
similarity index 90%
rename from recipes-devtools/bazel/bazel-native_3.1.0.bb
rename to recipes-devtools/bazel/bazel-native_3.7.1.bb
index 1336da8..a1575d6 100644
--- a/recipes-devtools/bazel/bazel-native_3.1.0.bb
+++ b/recipes-devtools/bazel/bazel-native_3.7.1.bb
@@ -2,8 +2,8 @@ DESCRIPTION = "Bazel build and test tool"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
-SRC_URI[md5sum] = "381ca27503c566ce5e489d1ba07d1d25"
-SRC_URI[sha256sum] = "d7f40d0cac95a06cea6cb5b7f7769085257caebc3ee84269dd9298da760d5615"
+SRC_URI[md5sum] = "cc255121586e849c4de2483a8a5814b6"
+SRC_URI[sha256sum] = "c9244e5905df6b0190113e26082c72d58b56b1b0dec66d076f083ce4089b0307"
SRC_URI = "https://github.com/bazelbuild/bazel/releases/download/${PV}/bazel-${PV}-dist.zip \
file://0001-HttpDownloader-save-download-tarball-to-distdir.patch \
diff --git a/recipes-devtools/bazel/files/0001-add-Yocto-native-sysroot-dir-to-the-default-Bazel-to.patch b/recipes-devtools/bazel/files/0001-add-Yocto-native-sysroot-dir-to-the-default-Bazel-to.patch
index b08c65a..7d73eb7 100644
--- a/recipes-devtools/bazel/files/0001-add-Yocto-native-sysroot-dir-to-the-default-Bazel-to.patch
+++ b/recipes-devtools/bazel/files/0001-add-Yocto-native-sysroot-dir-to-the-default-Bazel-to.patch
@@ -1,6 +1,6 @@
-From 707ba08068432262b3d02b29804c00afe7133ff6 Mon Sep 17 00:00:00 2001
+From 34c4dc1a10140addf75d3503d4b9f427303fe212 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Thu, 10 Dec 2020 16:12:51 +0800
+Date: Mon, 14 Dec 2020 16:45:31 +0800
Subject: [PATCH] add Yocto native sysroot dir to the default Bazel toolchain
While using the default Bazel C++ toolchain to build Yocto native tools
@@ -21,12 +21,12 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
1 file changed, 3 insertions(+)
diff --git a/tools/cpp/unix_cc_configure.bzl b/tools/cpp/unix_cc_configure.bzl
-index 84f5479..e17aa9d 100755
+index d48485b..0d297bf 100755
--- a/tools/cpp/unix_cc_configure.bzl
+++ b/tools/cpp/unix_cc_configure.bzl
-@@ -424,6 +424,9 @@ def configure_unix_toolchain(repository_ctx, cpu_value, overriden_tools):
- ),
- )
+@@ -443,6 +443,9 @@ def configure_unix_toolchain(repository_ctx, cpu_value, overriden_tools):
+ paths["@bazel_tools//tools/cpp:generate_system_module_map.sh"],
+ ))
+ # Customize for Yocto
+ builtin_include_directories.append(get_env_var(repository_ctx,"YOCTO_NATIVE_SYSROOT", "NOT_SET_YOCTO_NATIVE_SYSROOT"))
diff --git a/recipes-devtools/bazel/files/0001-python3.patch b/recipes-devtools/bazel/files/0001-python3.patch
index 93eee2d..c14dec7 100644
--- a/recipes-devtools/bazel/files/0001-python3.patch
+++ b/recipes-devtools/bazel/files/0001-python3.patch
@@ -1,6 +1,6 @@
-From e43263d6163f7ba1622b268e93635bf42493f758 Mon Sep 17 00:00:00 2001
+From aa31b751f9b2e5263e4510c8719f29050b8ce0de Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
-Date: Tue, 8 Dec 2020 11:09:44 +0800
+Date: Mon, 14 Dec 2020 16:43:45 +0800
Subject: [PATCH] set python3 interpreter
Since many distrobution choose python3, and drop python2,
@@ -20,28 +20,28 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
-index 2c0ae4d..ae39cc9 100755
+index 9be9ef3..dec19e5 100755
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
-@@ -237,7 +237,7 @@ public class BazelPythonSemantics implements PythonSemantics {
+@@ -247,7 +247,7 @@ public class BazelPythonSemantics implements PythonSemantics {
PathFragment shExecutable = ShToolchain.getPathOrError(ruleContext);
// TODO(#8685): Remove this special-case handling as part of making the proper shebang a
// property of the Python toolchain configuration.
- String pythonExecutableName = OS.getCurrent() == OS.OPENBSD ? "python3" : "python";
+ String pythonExecutableName = OS.getCurrent() == OS.OPENBSD ? "python3" : "python3";
+ // NOTE: keep the following line intact to support nix builds
+ String pythonShebang = "#!/usr/bin/env " + pythonExecutableName;
ruleContext.registerAction(
- new SpawnAction.Builder()
- .addInput(zipFile)
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt
-index 59c00e8..31d29a4 100755
+index 29f043f..c83891a 100755
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
- from __future__ import absolute_import
- from __future__ import division
+ # This script must retain compatibility with a wide variety of Python versions
+ # since it is run for every py_binary target. Currently we guarantee support
--
2.18.2
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 21/25] add classes/bazel-base.bbclass and imporve classes/bazel-base.bbclass
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
` (19 preceding siblings ...)
2020-12-16 13:08 ` [meta-tensorflow][PATCH 20/25] bazel-native: 3.1.0 -> 3.7.1 hongxu
@ 2020-12-16 13:08 ` hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 22/25] bazel-native/bazel.bbclass: support bazel build without limitation hongxu
` (3 subsequent siblings)
24 siblings, 0 replies; 33+ messages in thread
From: hongxu @ 2020-12-16 13:08 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
- Move common config settings to bazel-base.bbclass
- Improve bazel_get_flags to make each flag per line with comments
- Use BAZEL_MEM rather than hardcoded for option --local_ram_resources
- Explicitly remove dir ${BAZEL_DIR} before do_clean
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
classes/bazel-base.bbclass | 11 +++++
classes/bazel.bbclass | 47 ++++++++++++--------
recipes-devtools/bazel/bazel-native_3.7.1.bb | 6 +--
3 files changed, 41 insertions(+), 23 deletions(-)
create mode 100644 classes/bazel-base.bbclass
diff --git a/classes/bazel-base.bbclass b/classes/bazel-base.bbclass
new file mode 100644
index 0000000..a067733
--- /dev/null
+++ b/classes/bazel-base.bbclass
@@ -0,0 +1,11 @@
+export JAVA_HOME="${STAGING_LIBDIR_NATIVE}/jvm/openjdk-8-native"
+
+BAZEL_JOBS ??= "4"
+
+# Memory 4GB
+BAZEL_MEM ??= "4096"
+
+TS_DL_DIR ??= "${DL_DIR}"
+
+CCACHE_DISABLE = "1"
+
diff --git a/classes/bazel.bbclass b/classes/bazel.bbclass
index 3ace2ba..8a3dadf 100644
--- a/classes/bazel.bbclass
+++ b/classes/bazel.bbclass
@@ -3,6 +3,8 @@ DEPENDS += "bazel-native \
"
DEPENDS_append_class-target = " python3"
+inherit bazel-base
+
BAZEL_DIR ?= "${WORKDIR}/bazel"
BAZEL_OUTPUTBASE_DIR ?= "${BAZEL_DIR}/output_base"
export BAZEL_ARGS="--output_user_root=${BAZEL_DIR}/user_root \
@@ -11,8 +13,6 @@ export BAZEL_ARGS="--output_user_root=${BAZEL_DIR}/user_root \
--batch \
"
-export JAVA_HOME="${STAGING_LIBDIR_NATIVE}/jvm/openjdk-8-native"
-
BAZEL ?= "${BAZEL_DIR}/bazel"
do_prepare_recipe_sysroot[postfuncs] += "do_install_bazel"
@@ -26,56 +26,64 @@ do_install_bazel() {
def bazel_get_flags(d):
flags = ""
for i in d.getVar("CC").split()[1:]:
- flags += "--conlyopt=%s --cxxopt=%s --linkopt=%s " % (i, i, i)
+ flags += "# From CC\n"
+ flags += "build --conlyopt=%s --cxxopt=%s --linkopt=%s\n" % (i, i, i)
for i in d.getVar("CFLAGS").split():
if i == "-g":
continue
- flags += "--conlyopt=%s " % i
+ flags += "# From CFLAGS\n"
+ flags += "build --conlyopt=%s\n" % i
for i in d.getVar("BUILD_CFLAGS").split():
- flags += "--host_conlyopt=%s " % i
+ flags += "# From BUILD_CFLAGS\n"
+ flags += "build --host_conlyopt=%s\n" % i
for i in d.getVar("CXXFLAGS").split():
if i == "-g":
continue
- flags += "--cxxopt=%s " % i
+ flags += "# From CXXFLAGS\n"
+ flags += "build --cxxopt=%s\n" % i
for i in d.getVar("BUILD_CXXFLAGS").split():
- flags += "--host_cxxopt=%s " % i
+ flags += "# From BUILD_CXXFLAGS\n"
+ flags += "build --host_cxxopt=%s\n" % i
for i in d.getVar("CPPFLAGS").split():
if i == "-g":
continue
- flags += "--conlyopt=%s --cxxopt=%s " % (i, i)
+ flags += "# From CPPFLAGS\n"
+ flags += "build --conlyopt=%s --cxxopt=%s\n" % (i, i)
for i in d.getVar("BUILD_CPPFLAGS").split():
- flags += "--host_conlyopt=%s --host_cxxopt=%s " % (i, i)
+ flags += "# From BUILD_CPPFLAGS\n"
+ flags += "build --host_conlyopt=%s --host_cxxopt=%s\n" % (i, i)
for i in d.getVar("LDFLAGS").split():
if i == "-Wl,--as-needed":
continue
- flags += "--linkopt=%s " % i
+ flags += "# From LDFLAGS\n"
+ flags += "build --linkopt=%s\n" % i
for i in d.getVar("BUILD_LDFLAGS").split():
if i == "-Wl,--as-needed":
continue
- flags += "--host_linkopt=%s " % i
+ flags += "# From BUILD_LDFLAGS\n"
+ flags += "build --host_linkopt=%s\n" % i
for i in d.getVar("TOOLCHAIN_OPTIONS").split():
if i == "-Wl,--as-needed":
continue
- flags += "--linkopt=%s " % i
+ flags += "# From TOOLCHAIN_OPTIONS\n"
+ flags += "build --linkopt=%s\n" % i
return flags
-TS_DL_DIR ??= "${DL_DIR}"
-BAZEL_JOBS ??= "4"
bazel_do_configure () {
cat > "${S}/bazelrc" <<-EOF
build --verbose_failures
build --spawn_strategy=standalone --genrule_strategy=standalone
-#build --jobs=${BAZEL_JOBS} --local_ram_resources=4096 --local_cpu_resources=${BAZEL_JOBS}
+build --jobs=${BAZEL_JOBS} --local_ram_resources=${BAZEL_MEM} --local_cpu_resources=${BAZEL_JOBS}
test --verbose_failures --verbose_test_summary
test --spawn_strategy=standalone --genrule_strategy=standalone
@@ -98,8 +106,10 @@ EOF
bazel_do_configure_append_class-target () {
cat >> "${S}/bazelrc" <<-EOF
-# FLAGS
-build ${@bazel_get_flags(d)}
+# FLAGS begin
+${@bazel_get_flags(d)}
+# FLAGS end
+
build --linkopt=-Wl,-latomic
EOF
@@ -109,8 +119,6 @@ EOF
EXPORT_FUNCTIONS do_configure
-CCACHE_DISABLE = "1"
-
PSEUDO_IGNORE_PATHS .= ",${WORKDIR}/bazel"
inherit unsupportarch
@@ -125,4 +133,5 @@ clean_bazel() {
${BAZEL} clean
fi
fi
+ rm ${BAZEL_DIR} -rf
}
diff --git a/recipes-devtools/bazel/bazel-native_3.7.1.bb b/recipes-devtools/bazel/bazel-native_3.7.1.bb
index a1575d6..03cff37 100644
--- a/recipes-devtools/bazel/bazel-native_3.7.1.bb
+++ b/recipes-devtools/bazel/bazel-native_3.7.1.bb
@@ -25,19 +25,17 @@ DEPENDS = "coreutils-native \
S="${WORKDIR}"
-TS_DL_DIR ??= "${DL_DIR}"
+inherit bazel-base
-BAZEL_JOBS ??= "4"
EXTRA_BAZEL_ARGS = " \
--host_javabase=@local_jdk//:jdk \
--python_path=python3 \
--jobs=${BAZEL_JOBS} \
- --local_ram_resources=4096 \
+ --local_ram_resources=${BAZEL_MEM} \
--local_cpu_resources=${BAZEL_JOBS} \
"
do_compile () {
- export JAVA_HOME="${STAGING_LIBDIR_NATIVE}/jvm/openjdk-8-native"
TMPDIR="${TOPDIR}/bazel" \
VERBOSE=yes \
EXTRA_BAZEL_ARGS="${EXTRA_BAZEL_ARGS}" \
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 22/25] bazel-native/bazel.bbclass: support bazel build without limitation
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
` (20 preceding siblings ...)
2020-12-16 13:08 ` [meta-tensorflow][PATCH 21/25] add classes/bazel-base.bbclass and imporve classes/bazel-base.bbclass hongxu
@ 2020-12-16 13:08 ` hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 23/25] BUILD.md: update quick start for tensorflow 2 hongxu
` (2 subsequent siblings)
24 siblings, 0 replies; 33+ messages in thread
From: hongxu @ 2020-12-16 13:08 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
Set BAZEL_JOBS and BAZEL_MEM with empty string to make bazel build without
limitation
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
classes/bazel.bbclass | 9 ++++++++-
recipes-devtools/bazel/bazel-native_3.7.1.bb | 6 +++---
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/classes/bazel.bbclass b/classes/bazel.bbclass
index 8a3dadf..f5dc597 100644
--- a/classes/bazel.bbclass
+++ b/classes/bazel.bbclass
@@ -77,13 +77,20 @@ def bazel_get_flags(d):
flags += "# From TOOLCHAIN_OPTIONS\n"
flags += "build --linkopt=%s\n" % i
+ if d.getVar("BAZEL_JOBS"):
+ flags += "# From BAZEL_JOBS\n"
+ flags += "build --jobs=%s --local_cpu_resources=%s\n" % (d.getVar("BAZEL_JOBS"), d.getVar("BAZEL_JOBS"))
+
+ if d.getVar("BAZEL_MEM"):
+ flags += "# From BAZEL_MEM\n"
+ flags += "build --local_ram_resources=%s\n" % (d.getVar("BAZEL_MEM"))
+
return flags
bazel_do_configure () {
cat > "${S}/bazelrc" <<-EOF
build --verbose_failures
build --spawn_strategy=standalone --genrule_strategy=standalone
-build --jobs=${BAZEL_JOBS} --local_ram_resources=${BAZEL_MEM} --local_cpu_resources=${BAZEL_JOBS}
test --verbose_failures --verbose_test_summary
test --spawn_strategy=standalone --genrule_strategy=standalone
diff --git a/recipes-devtools/bazel/bazel-native_3.7.1.bb b/recipes-devtools/bazel/bazel-native_3.7.1.bb
index 03cff37..4f2e28b 100644
--- a/recipes-devtools/bazel/bazel-native_3.7.1.bb
+++ b/recipes-devtools/bazel/bazel-native_3.7.1.bb
@@ -30,9 +30,9 @@ inherit bazel-base
EXTRA_BAZEL_ARGS = " \
--host_javabase=@local_jdk//:jdk \
--python_path=python3 \
- --jobs=${BAZEL_JOBS} \
- --local_ram_resources=${BAZEL_MEM} \
- --local_cpu_resources=${BAZEL_JOBS} \
+ ${@oe.utils.conditional("BAZEL_JOBS", "", "", "--jobs=${BAZEL_JOBS}", d )} \
+ ${@oe.utils.conditional("BAZEL_JOBS", "", "", "--local_cpu_resources=${BAZEL_JOBS}", d )} \
+ ${@oe.utils.conditional("BAZEL_MEM", "", "", "--local_ram_resources=${BAZEL_MEM}", d )} \
"
do_compile () {
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 23/25] BUILD.md: update quick start for tensorflow 2
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
` (21 preceding siblings ...)
2020-12-16 13:08 ` [meta-tensorflow][PATCH 22/25] bazel-native/bazel.bbclass: support bazel build without limitation hongxu
@ 2020-12-16 13:08 ` hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 24/25] tensorflow: split sub packages hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 25/25] update LIMITATION.md hongxu
24 siblings, 0 replies; 33+ messages in thread
From: hongxu @ 2020-12-16 13:08 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
Refers begginers of upstream [1] [2]
[1] https://www.tensorflow.org/install/pip
[2] https://www.tensorflow.org/tutorials/quickstart/beginner
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
BUILD.md | 97 ++++++++++++++++++++++++++++++++------------------------
1 file changed, 55 insertions(+), 42 deletions(-)
diff --git a/BUILD.md b/BUILD.md
index da5a148..bd0f44a 100644
--- a/BUILD.md
+++ b/BUILD.md
@@ -41,75 +41,88 @@ $ runqemu qemux86-64 core-image-minimal slirp kvm qemuparams="-m 5120"
## 5. Verify the install
```
-root@qemux86-64:~# python3 -c "import tensorflow as tf; tf.enable_eager_execution(); print(tf.reduce_sum(tf.random_normal([1000, 1000])))"
-tf.Tensor(-604.65454, shape=(), dtype=float32)
+root@qemux86-64:~# python3 -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
+tf.Tensor(-3304.6208, shape=(), dtype=float32)
```
## 6. Run tutorial case
### Refer: https://www.tensorflow.org/tutorials
```
-root@qemux86-64:~# cat >code.py <<ENDOF
+root@qemux86-64:~# cat >code-v2.py <<ENDOF
import tensorflow as tf
mnist = tf.keras.datasets.mnist
-(x_train, y_train),(x_test, y_test) = mnist.load_data()
+(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0
model = tf.keras.models.Sequential([
tf.keras.layers.Flatten(input_shape=(28, 28)),
- tf.keras.layers.Dense(512, activation=tf.nn.relu),
+ tf.keras.layers.Dense(128, activation='relu'),
tf.keras.layers.Dropout(0.2),
- tf.keras.layers.Dense(10, activation=tf.nn.softmax)
+ tf.keras.layers.Dense(10)
])
+
+predictions = model(x_train[:1]).numpy()
+tf.nn.softmax(predictions).numpy()
+loss_fn = tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True)
+loss_fn(y_train[:1], predictions).numpy()
+
model.compile(optimizer='adam',
- loss='sparse_categorical_crossentropy',
+ loss=loss_fn,
metrics=['accuracy'])
-
model.fit(x_train, y_train, epochs=5)
-model.evaluate(x_test, y_test)
+model.evaluate(x_test, y_test, verbose=2)
+
+probability_model = tf.keras.Sequential([
+ model,
+ tf.keras.layers.Softmax()
+])
+probability_model(x_test[:5])
+
+
ENDOF
-root@qemux86-64:~# python3 ./code.py
-Downloading data from https://storage.googleapis.com/tensorflow/tf-keras-datasets/mnist.npz
-11493376/11490434 [==============================] - 7s 1us/step
-Instructions for updating:
-Colocations handled automatically by placer.
-Instructions for updating:
-Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.
+root@qemux86-64:~# python3 ./code-v2.py
+2020-12-15 08:16:44.171593: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:116] None of the MLIR optimization passes are enabled (registered 2)
+2020-12-15 08:16:44.184464: I tensorflow/core/platform/profile_utils/cpu_utils.cc:112] CPU Frequency: 3099995000 Hz
Epoch 1/5
-60000/60000 [==============================] - 27s 449us/sample - loss: 0.2211 - acc: 0.9346
+1875/1875 [==============================] - 14s 7ms/step - loss: 0.4833 - accuracy: 0.8595
Epoch 2/5
-60000/60000 [==============================] - 24s 408us/sample - loss: 0.0969 - acc: 0.9702
+1875/1875 [==============================] - 13s 7ms/step - loss: 0.1549 - accuracy: 0.9558
Epoch 3/5
-60000/60000 [==============================] - 26s 439us/sample - loss: 0.0694 - acc: 0.9780
+1875/1875 [==============================] - 13s 7ms/step - loss: 0.1135 - accuracy: 0.9651
Epoch 4/5
-60000/60000 [==============================] - 23s 390us/sample - loss: 0.0540 - acc: 0.9832
+1875/1875 [==============================] - 13s 7ms/step - loss: 0.0889 - accuracy: 0.9729
Epoch 5/5
-60000/60000 [==============================] - 24s 399us/sample - loss: 0.0447 - acc: 0.9851
-10000/10000 [==============================] - 1s 91us/sample - loss: 0.0700 - acc: 0.9782
+1875/1875 [==============================] - 13s 7ms/step - loss: 0.0741 - accuracy: 0.9777
+313/313 - 1s - loss: 0.0757 - accuracy: 0.9757
```
## 7. TensorFlow/TensorFlow Lite C++ Image Recognition Demo
```
root@qemux86-64:~# time label_image
-2019-03-06 06:08:51.076028: I tensorflow/examples/label_image/main.cc:251] military uniform (653): 0.834306
-2019-03-06 06:08:51.078221: I tensorflow/examples/label_image/main.cc:251] mortarboard (668): 0.0218695
-2019-03-06 06:08:51.080054: I tensorflow/examples/label_image/main.cc:251] academic gown (401): 0.010358
-2019-03-06 06:08:51.081943: I tensorflow/examples/label_image/main.cc:251] pickelhaube (716): 0.00800814
-2019-03-06 06:08:51.083830: I tensorflow/examples/label_image/main.cc:251] bulletproof vest (466): 0.00535084
-real 0m 10.50s
-user 0m 3.95s
-sys 0m 6.46s
+2020-12-15 08:18:34.853885: I tensorflow/core/platform/profile_utils/cpu_utils.cc:112] CPU Frequency: 3099995000 Hz
+2020-12-15 08:18:41.565167: I tensorflow/examples/label_image/main.cc:252] military uniform (653): 0.834306
+2020-12-15 08:18:41.567874: I tensorflow/examples/label_image/main.cc:252] mortarboard (668): 0.0218696
+2020-12-15 08:18:41.568936: I tensorflow/examples/label_image/main.cc:252] academic gown (401): 0.0103581
+2020-12-15 08:18:41.569985: I tensorflow/examples/label_image/main.cc:252] pickelhaube (716): 0.00800819
+2020-12-15 08:18:41.571025: I tensorflow/examples/label_image/main.cc:252] bulletproof vest (466): 0.00535086
+
+real 0m7.178s
+user 0m6.101s
+sys 0m0.893s
+
root@qemux86-64:~# time label_image.lite
-Loaded model /usr/share/label_image/mobilenet_v1_1.0_224_quant.tflite
-resolved reporter
-invoked
-average time: 1064.8 ms
-0.780392: 653 military uniform
-0.105882: 907 Windsor tie
-0.0156863: 458 bow tie
-0.0117647: 466 bulletproof vest
-0.00784314: 835 suit
-real 0m 1.10s
-user 0m 1.07s
-sys 0m 0.02s
+INFO: Loaded model /usr/share/label_image/mobilenet_v1_1.0_224_quant.tflite
+INFO: resolved reporter
+INFO: invoked
+INFO: average time: 213.584 ms
+INFO: 0.780392: 653 military uniform
+INFO: 0.105882: 907 Windsor tie
+INFO: 0.0156863: 458 bow tie
+INFO: 0.0117647: 466 bulletproof vest
+INFO: 0.00784314: 835 suit
+
+real 0m0.233s
+user 0m0.216s
+sys 0m0.012s
```
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 24/25] tensorflow: split sub packages
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
` (22 preceding siblings ...)
2020-12-16 13:08 ` [meta-tensorflow][PATCH 23/25] BUILD.md: update quick start for tensorflow 2 hongxu
@ 2020-12-16 13:08 ` hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 25/25] update LIMITATION.md hongxu
24 siblings, 0 replies; 33+ messages in thread
From: hongxu @ 2020-12-16 13:08 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
Split sub packages (libtensorflow-c libtensorflow-framework
label-image label-image-lite python3-tensorflow), then user
chould select the required one rather than install them
as a whole
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
recipes-framework/tensorflow/tensorflow_2.4.0.bb | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/recipes-framework/tensorflow/tensorflow_2.4.0.bb b/recipes-framework/tensorflow/tensorflow_2.4.0.bb
index 49c868e..6c4163e 100644
--- a/recipes-framework/tensorflow/tensorflow_2.4.0.bb
+++ b/recipes-framework/tensorflow/tensorflow_2.4.0.bb
@@ -168,7 +168,20 @@ FILES_${PN}-dev = ""
INSANE_SKIP_${PN} += "dev-so \
already-stripped \
"
-FILES_${PN} += "${libdir}/* ${datadir}/*"
+
+PACKAGE_BEFORE_PN += "libtensorflow-c libtensorflow-framework label-image label-image-lite python3-tensorflow"
+
+RDEPENDS_label-image += "libtensorflow-framework"
+RDEPENDS_python3-tensorflow += "libtensorflow-framework"
+RDEPENDS_${PN} += "libtensorflow-c libtensorflow-framework label-image label-image-lite python3-tensorflow"
+
+ALLOW_EMPTY_${PN} = "1"
+
+FILES_python3-tensorflow += "${libdir}/* ${datadir}/* ${sbindir}/*"
+FILES_libtensorflow-c = "${libdir}/libtensorflow.so ${libdir}/libtensorflow_cc.so"
+FILES_libtensorflow-framework = "${libdir}/libtensorflow.so ${libdir}/libtensorflow_framework.so*"
+FILES_label-image = "${sbindir}/label_image"
+FILES_label-image-lite = "${sbindir}/label_image.lite"
inherit siteinfo unsupportarch
python __anonymous() {
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* [meta-tensorflow][PATCH 25/25] update LIMITATION.md
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
` (23 preceding siblings ...)
2020-12-16 13:08 ` [meta-tensorflow][PATCH 24/25] tensorflow: split sub packages hongxu
@ 2020-12-16 13:08 ` hongxu
24 siblings, 0 replies; 33+ messages in thread
From: hongxu @ 2020-12-16 13:08 UTC (permalink / raw)
To: randy.macleod, philip, akuster808, marek.belisko, yocto
Target arch only supports 32 bit arm and 32 bit x86, 64 bit arm and
64 bit x86. BSP (MACHINE) incluced in above archs should be supported.
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
LIMITATION.md | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/LIMITATION.md b/LIMITATION.md
index deda0ad..3c69100 100644
--- a/LIMITATION.md
+++ b/LIMITATION.md
@@ -1,21 +1,19 @@
# Limitation
```
-* Bazel build takes lots of time, since it like bitbake which has own rules
- and builds everything from scratch. Currently bazel could not reuse Yocto
- DEPENDS/RDEPENDS.
+* Target arch only supports 32 bit arm and 32 bit x86, 64 bit arm and
+ 64 bit x86. BSP (MACHINE) incluced in above archs should be supported.
+
+* Bazel build takes lots of time, it has own rules and builds everything
+ from scratch. Currently bazel could not reuse Yocto DEPENDS/RDEPENDS.
* In order to run tensorflow cases in a reasonable time, although it builds
- successfully on qemuarm, qemuarm64, qemumips, qemumips64, qemux86 and
- qemux86-64, only qemux86-64 with kvm for runtime test.
+ successfully on qemuarm, qemuarm64, qemux86 and qemux86-64, only qemux86-64
+ with kvm for runtime test.
-* It failed to use pre-build model to do predict/inference on big-endian platform
- (such as qemumips), since upstream does not support big-endian very well
+* It failed to use pre-build model to do predict/inference on big-endian
+ platform, since upstream does not support big-endian very well
https://github.com/tensorflow/tensorflow/issues/16364
-* Do not support 32-bit powerpc (qemuppc) since BoringSSL does not support it.
- (BoringSSL is a fork of OpenSSL used to implement cryptography and TLS across
- most of Google's products)
-
* If host(build system) is not x86_64, please add meta-java to BBLAYERS in
conf/bblayers.conf (git://git.yoctoproject.org/meta-java)
```
--
2.21.0
^ permalink raw reply related [flat|nested] 33+ messages in thread
* Re: [yocto] [meta-tensorflow][PATCH 1/25] openjdk-8-native: 212b04 -> 275b01
2020-12-16 13:07 ` [meta-tensorflow][PATCH 1/25] openjdk-8-native: 212b04 -> 275b01 hongxu
@ 2020-12-16 16:49 ` Kent Dorfman
0 siblings, 0 replies; 33+ messages in thread
From: Kent Dorfman @ 2020-12-16 16:49 UTC (permalink / raw)
To: hongxu; +Cc: yocto
Is there a project policy reason that all these patches are posted in
the main list instead of a dev list? Isn't there a list specifically
for this kind of thing, to separate questions and info sharing from
the software maintenance aspect?
On 12/16/20, hongxu <hongxu.jia@windriver.com> wrote:
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
> ...njdk-8-native_212b04.bb => openjdk-8-native_275b01.bb} | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
> rename recipes-devtools/openjdk/{openjdk-8-native_212b04.bb =>
> openjdk-8-native_275b01.bb} (78%)
>
> diff --git a/recipes-devtools/openjdk/openjdk-8-native_212b04.bb
> b/recipes-devtools/openjdk/openjdk-8-native_275b01.bb
> similarity index 78%
> rename from recipes-devtools/openjdk/openjdk-8-native_212b04.bb
> rename to recipes-devtools/openjdk/openjdk-8-native_275b01.bb
> index 788612a..dcc1780 100644
> --- a/recipes-devtools/openjdk/openjdk-8-native_212b04.bb
> +++ b/recipes-devtools/openjdk/openjdk-8-native_275b01.bb
> @@ -3,13 +3,13 @@ builds using source code from OpenJDK project"
> LICENSE = "GPL-2.0-with-classpath-exception"
> LIC_FILES_CHKSUM = "file://LICENSE;md5=3e0b59f8fac05c3c03d4a26bbda13f8f"
>
> -SRC_URI[md5sum] = "8082ad8dafec378f2a4b24cbfdb4a9a4"
> -SRC_URI[sha256sum] =
> "ef6a3050a1c3477a6e13c24d10ab36decad548649a260559d466467401db15de"
> +SRC_URI[md5sum] = "52c1f769ab67b58b4300713fb5d46a47"
> +SRC_URI[sha256sum] =
> "fccaa6cc14571813dbb427ac08d5acd034782a2654e6090ad4d63e7200011ac4"
> SRC_URI = " \
> -
> https://github.com/ojdkbuild/contrib_jdk8u-ci/releases/download/jdk8u212-b04/jdk-8u212-ojdkbuild-linux-x64.zip
> \
> +
> https://github.com/ojdkbuild/contrib_jdk8u-ci/releases/download/jdk8u275-b01/jdk-8u275-ojdkbuild-linux-x64.zip
> \
> "
>
> -S = "${WORKDIR}/jdk-8u212-ojdkbuild-linux-x64"
> +S = "${WORKDIR}/jdk-8u275-ojdkbuild-linux-x64"
>
> do_patch[noexec] = "1"
> do_configure[noexec] = "1"
> --
> 2.21.0
>
>
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [meta-tensorflow][PATCH 8/25] tensorflow-estimator: 1.13 -> 2.4
2020-12-16 13:08 ` [meta-tensorflow][PATCH 8/25] tensorflow-estimator: 1.13 -> 2.4 hongxu
@ 2021-01-04 10:30 ` Marek Belisko
2021-01-07 17:51 ` [yocto] " Randy MacLeod
0 siblings, 1 reply; 33+ messages in thread
From: Marek Belisko @ 2021-01-04 10:30 UTC (permalink / raw)
To: Hongxu Jia; +Cc: Randy MacLeod, philip, akuster808, yocto
Hi Hongxu,
On Wed, Dec 16, 2020 at 2:09 PM Hongxu Jia <hongxu.jia@windriver.com> wrote:
>
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
> .../0001-customize-for-yocto.patch | 28 +++++++++++++++++++
> .../tensorflow/tensorflow-estimator_1.13.bb | 12 ++++++--
> 2 files changed, 37 insertions(+), 3 deletions(-)
> create mode 100644 recipes-framework/tensorflow/tensorflow-estimator/0001-customize-for-yocto.patch
>
> diff --git a/recipes-framework/tensorflow/tensorflow-estimator/0001-customize-for-yocto.patch b/recipes-framework/tensorflow/tensorflow-estimator/0001-customize-for-yocto.patch
> new file mode 100644
> index 0000000..e9b66d5
> --- /dev/null
> +++ b/recipes-framework/tensorflow/tensorflow-estimator/0001-customize-for-yocto.patch
> @@ -0,0 +1,28 @@
> +From a1bcf09a43fc44ad5e04c441ee45cc23d16cf7d2 Mon Sep 17 00:00:00 2001
> +From: Hongxu Jia <hongxu.jia@windriver.com>
> +Date: Wed, 9 Dec 2020 17:59:01 +0800
> +Subject: [PATCH] customize for yocto
> +
> +Upstream-Status: Inappropriate [oe specific]
> +
> +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> +---
> + tensorflow_estimator/tools/pip_package/build_pip_package.sh | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/tensorflow_estimator/tools/pip_package/build_pip_package.sh b/tensorflow_estimator/tools/pip_package/build_pip_package.sh
> +index d4953a6..e08cd8a 100755
> +--- a/tensorflow_estimator/tools/pip_package/build_pip_package.sh
> ++++ b/tensorflow_estimator/tools/pip_package/build_pip_package.sh
> +@@ -38,7 +38,7 @@ function prepare_src() {
> +
> + # Verifies all expected files are in pip.
> + # Creates init files in all directory in pip.
> +- python tensorflow_estimator/tools/pip_package/create_pip_helper.py --pip-root "${TMPDIR}/tensorflow_estimator/" --bazel-root "./tensorflow_estimator"
> ++ nativepython3 tensorflow_estimator/tools/pip_package/create_pip_helper.py --pip-root "${TMPDIR}/tensorflow_estimator/" --bazel-root "./tensorflow_estimator"
> + }
> +
> + function build_wheel() {
> +--
> +2.18.2
> +
> diff --git a/recipes-framework/tensorflow/tensorflow-estimator_1.13.bb b/recipes-framework/tensorflow/tensorflow-estimator_1.13.bb
> index f3a5098..5b2fe5d 100644
> --- a/recipes-framework/tensorflow/tensorflow-estimator_1.13.bb
> +++ b/recipes-framework/tensorflow/tensorflow-estimator_1.13.bb
> @@ -3,9 +3,10 @@ learning programming."
> LICENSE = "Apache-2.0"
> LIC_FILES_CHKSUM = "file://LICENSE;md5=01e86893010a1b87e69a213faa753ebd"
>
> -SRC_URI = "git://github.com/tensorflow/estimator.git;branch=r1.13 \
> +SRC_URI = "git://github.com/tensorflow/estimator.git;branch=r2.4 \
> + file://0001-customize-for-yocto.patch \
> "
> -SRCREV = "340703eed78ba4854862f749ed94f91598826e79"
> +SRCREV = "c3e7f2b5bbcc35185ef71797955a28cadce28f60"
> S = "${WORKDIR}/git"
>
> inherit python3native bazel
> @@ -19,12 +20,18 @@ DEPENDS += " \
> python3-astor-native \
> python3-gast-native \
> python3-termcolor-native \
> + python3-wrapt-native \
> + python3-opt-einsum-native \
> + python3-astunparse-native \
> + flatbuffers-native \
I'm getting issue when building tensorflow-estimator (I add small
changes to be able to build this patches on top of dunfell) and I'm
getting:
| /bin/bash -c 'source
external/bazel_tools/tools/genrule/genrule-setup.sh;
bazel-out/k8-opt-exec-2B5CBBC6/bin/tensorflow_estimator/python/estimator/api/create_tensorflow_estimator.python.estimator_api_1_estimator_python_api_gen_compat_v1
--apidir=bazel-out/k8-fastbuild/bin/tensorflow_estimator/python/estimator/api_v1/
--apiname=estimator --apiversion=1
--package=tensorflow_estimator.python.estimator
--output_package=tensorflow_estimator.python.estimator.api._v1
bazel-out/k8-fastbuild/bin/tensorflow_estimator/python/estimator/api/_v1/v1.py
bazel-out/k8-fastbuild/bin/tensorflow_estimator/python/estimator/api/_v1/estimator/__init__.py
bazel-out/k8-fastbuild/bin/tensorflow_estimator/python/estimator/api/_v1/estimator/experimental/__init__.py
bazel-out/k8-fastbuild/bin/tensorflow_estimator/python/estimator/api/_v1/estimator/export/__init__.py
bazel-out/k8-fastbuild/bin/tensorflow_estimator/python/estimator/api/_v1/estimator/inputs/__init__.py
bazel-out/k8-fastbuild/bin/tensorflow_estimator/python/estimator/api/_v1/estimator/tpu/__init__.py
bazel-out/k8-fastbuild/bin/tensorflow_estimator/python/estimator/api/_v1/estimator/tpu/experimental/__init__.py')
| Execution platform: @local_config_platform//:host
| /home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/h5py/__init__.py:72:
UserWarning: h5py is running against HDF5 1.8.21 when it was built
against 1.8.19, this may cause problems
| _warn(("h5py is running against HDF5 {0} when it was built against {1}, "
| Traceback (most recent call last):
| File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/bazel/output_base/execroot/org_tensorflow_estimator/bazel-out/k8-opt-exec-2B5CBBC6/bin/tensorflow_estimator/python/estimator/api/create_tensorflow_estimator.python.estimator_api_1_estimator_python_api_gen_compat_v1.runfiles/org_tensorflow_estimator/tensorflow_estimator/python/estimator/api/create_python_api_wrapper.py",
line 26, in <module>
| from tensorflow_estimator.python.estimator import estimator_lib
# pylint: disable=unused-import
| File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/bazel/output_base/execroot/org_tensorflow_estimator/bazel-out/k8-opt-exec-2B5CBBC6/bin/tensorflow_estimator/python/estimator/api/create_tensorflow_estimator.python.estimator_api_1_estimator_python_api_gen_compat_v1.runfiles/org_tensorflow_estimator/tensorflow_estimator/python/estimator/estimator_lib.py",
line 22, in <module>
| from tensorflow_estimator.python.estimator.canned.baseline
import BaselineClassifier
| File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/bazel/output_base/execroot/org_tensorflow_estimator/bazel-out/k8-opt-exec-2B5CBBC6/bin/tensorflow_estimator/python/estimator/api/create_tensorflow_estimator.python.estimator_api_1_estimator_python_api_gen_compat_v1.runfiles/org_tensorflow_estimator/tensorflow_estimator/python/estimator/canned/baseline.py",
line 53, in <module>
| import tensorflow as tf
| File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/__init__.py",
line 55, in <module>
| from ._api.v2 import compat
| File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/_api/v2/compat/__init__.py",
line 39, in <module>
| from . import v1
| File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/_api/v2/compat/v1/__init__.py",
line 34, in <module>
| from . import compat
| File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/_api/v2/compat/v1/compat/__init__.py",
line 39, in <module>
| from . import v1
| File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/_api/v2/compat/v1/compat/v1/__init__.py",
line 51, in <module>
| from tensorflow._api.v2.compat.v1 import lite
| File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/_api/v2/compat/v1/lite/__init__.py",
line 11, in <module>
| from . import experimental
| File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/_api/v2/compat/v1/lite/experimental/__init__.py",
line 10, in <module>
| from . import nn
| File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/_api/v2/compat/v1/lite/experimental/nn/__init__.py",
line 10, in <module>
| from tensorflow.lite.python.lite import TFLiteLSTMCell
| File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/lite/python/lite.py",
line 40, in <module>
| from tensorflow.lite.python.convert import
build_toco_convert_protos # pylint: disable=unused-import
| File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/lite/python/convert.py",
line 33, in <module>
| from tensorflow.lite.python import util
| File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/lite/python/util.py",
line 30, in <module>
| import flatbuffers
| ModuleNotFoundError: No module named 'flatbuffers'
FLatbuffers from openembedded are available version 1.12. Do you have
an idea what is can cause?
> tensorflow-native \
> "
>
> do_compile () {
> unset CC
> export TMPDIR="${WORKDIR}"
> + export PYTHON_BIN_PATH="${PYTHON}"
> +
> ${BAZEL} build \
> --subcommands --explain=${T}/explain.log \
> --verbose_explanations --verbose_failures \
> @@ -32,7 +39,6 @@ do_compile () {
> --python_path="${PYTHON}" \
> //tensorflow_estimator/tools/pip_package:build_pip_package
>
> - PYTHON_BIN_PATH="${PYTHON}" \
> ${S}/bazel-bin/tensorflow_estimator/tools/pip_package/build_pip_package \
> ${WORKDIR}/estimator_pip
> }
> --
> 2.21.0
>
Thanks and BR,
marek
--
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer
Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.com
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [yocto] [meta-tensorflow][PATCH 8/25] tensorflow-estimator: 1.13 -> 2.4
2021-01-04 10:30 ` Marek Belisko
@ 2021-01-07 17:51 ` Randy MacLeod
2021-01-07 18:47 ` Marek Belisko
0 siblings, 1 reply; 33+ messages in thread
From: Randy MacLeod @ 2021-01-07 17:51 UTC (permalink / raw)
To: Marek Belisko, Hongxu Jia; +Cc: philip, akuster808, yocto
On 2021-01-04 5:30 a.m., Marek Belisko wrote:
> Hi Hongxu,
>
> On Wed, Dec 16, 2020 at 2:09 PM Hongxu Jia <hongxu.jia@windriver.com> wrote:
>>
>> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
>> ---
>> .../0001-customize-for-yocto.patch | 28 +++++++++++++++++++
>> .../tensorflow/tensorflow-estimator_1.13.bb | 12 ++++++--
>> 2 files changed, 37 insertions(+), 3 deletions(-)
>> create mode 100644 recipes-framework/tensorflow/tensorflow-estimator/0001-customize-for-yocto.patch
>>
>> diff --git a/recipes-framework/tensorflow/tensorflow-estimator/0001-customize-for-yocto.patch b/recipes-framework/tensorflow/tensorflow-estimator/0001-customize-for-yocto.patch
>> new file mode 100644
>> index 0000000..e9b66d5
>> --- /dev/null
>> +++ b/recipes-framework/tensorflow/tensorflow-estimator/0001-customize-for-yocto.patch
>> @@ -0,0 +1,28 @@
>> +From a1bcf09a43fc44ad5e04c441ee45cc23d16cf7d2 Mon Sep 17 00:00:00 2001
>> +From: Hongxu Jia <hongxu.jia@windriver.com>
>> +Date: Wed, 9 Dec 2020 17:59:01 +0800
>> +Subject: [PATCH] customize for yocto
>> +
>> +Upstream-Status: Inappropriate [oe specific]
>> +
>> +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
>> +---
>> + tensorflow_estimator/tools/pip_package/build_pip_package.sh | 2 +-
>> + 1 file changed, 1 insertion(+), 1 deletion(-)
>> +
>> +diff --git a/tensorflow_estimator/tools/pip_package/build_pip_package.sh b/tensorflow_estimator/tools/pip_package/build_pip_package.sh
>> +index d4953a6..e08cd8a 100755
>> +--- a/tensorflow_estimator/tools/pip_package/build_pip_package.sh
>> ++++ b/tensorflow_estimator/tools/pip_package/build_pip_package.sh
>> +@@ -38,7 +38,7 @@ function prepare_src() {
>> +
>> + # Verifies all expected files are in pip.
>> + # Creates init files in all directory in pip.
>> +- python tensorflow_estimator/tools/pip_package/create_pip_helper.py --pip-root "${TMPDIR}/tensorflow_estimator/" --bazel-root "./tensorflow_estimator"
>> ++ nativepython3 tensorflow_estimator/tools/pip_package/create_pip_helper.py --pip-root "${TMPDIR}/tensorflow_estimator/" --bazel-root "./tensorflow_estimator"
>> + }
>> +
>> + function build_wheel() {
>> +--
>> +2.18.2
>> +
>> diff --git a/recipes-framework/tensorflow/tensorflow-estimator_1.13.bb b/recipes-framework/tensorflow/tensorflow-estimator_1.13.bb
>> index f3a5098..5b2fe5d 100644
>> --- a/recipes-framework/tensorflow/tensorflow-estimator_1.13.bb
>> +++ b/recipes-framework/tensorflow/tensorflow-estimator_1.13.bb
>> @@ -3,9 +3,10 @@ learning programming."
>> LICENSE = "Apache-2.0"
>> LIC_FILES_CHKSUM = "file://LICENSE;md5=01e86893010a1b87e69a213faa753ebd"
>>
>> -SRC_URI = "git://github.com/tensorflow/estimator.git;branch=r1.13 \
>> +SRC_URI = "git://github.com/tensorflow/estimator.git;branch=r2.4 \
>> + file://0001-customize-for-yocto.patch \
>> "
>> -SRCREV = "340703eed78ba4854862f749ed94f91598826e79"
>> +SRCREV = "c3e7f2b5bbcc35185ef71797955a28cadce28f60"
>> S = "${WORKDIR}/git"
>>
>> inherit python3native bazel
>> @@ -19,12 +20,18 @@ DEPENDS += " \
>> python3-astor-native \
>> python3-gast-native \
>> python3-termcolor-native \
>> + python3-wrapt-native \
>> + python3-opt-einsum-native \
>> + python3-astunparse-native \
>> + flatbuffers-native \
> I'm getting issue when building tensorflow-estimator (I add small
> changes to be able to build this patches on top of dunfell) and I'm
> getting:
> | /bin/bash -c 'source
> external/bazel_tools/tools/genrule/genrule-setup.sh;
> bazel-out/k8-opt-exec-2B5CBBC6/bin/tensorflow_estimator/python/estimator/api/create_tensorflow_estimator.python.estimator_api_1_estimator_python_api_gen_compat_v1
> --apidir=bazel-out/k8-fastbuild/bin/tensorflow_estimator/python/estimator/api_v1/
> --apiname=estimator --apiversion=1
> --package=tensorflow_estimator.python.estimator
> --output_package=tensorflow_estimator.python.estimator.api._v1
> bazel-out/k8-fastbuild/bin/tensorflow_estimator/python/estimator/api/_v1/v1.py
> bazel-out/k8-fastbuild/bin/tensorflow_estimator/python/estimator/api/_v1/estimator/__init__.py
> bazel-out/k8-fastbuild/bin/tensorflow_estimator/python/estimator/api/_v1/estimator/experimental/__init__.py
> bazel-out/k8-fastbuild/bin/tensorflow_estimator/python/estimator/api/_v1/estimator/export/__init__.py
> bazel-out/k8-fastbuild/bin/tensorflow_estimator/python/estimator/api/_v1/estimator/inputs/__init__.py
> bazel-out/k8-fastbuild/bin/tensorflow_estimator/python/estimator/api/_v1/estimator/tpu/__init__.py
> bazel-out/k8-fastbuild/bin/tensorflow_estimator/python/estimator/api/_v1/estimator/tpu/experimental/__init__.py')
> | Execution platform: @local_config_platform//:host
> | /home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/h5py/__init__.py:72:
> UserWarning: h5py is running against HDF5 1.8.21 when it was built
> against 1.8.19, this may cause problems
> | _warn(("h5py is running against HDF5 {0} when it was built against {1}, "
> | Traceback (most recent call last):
> | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/bazel/output_base/execroot/org_tensorflow_estimator/bazel-out/k8-opt-exec-2B5CBBC6/bin/tensorflow_estimator/python/estimator/api/create_tensorflow_estimator.python.estimator_api_1_estimator_python_api_gen_compat_v1.runfiles/org_tensorflow_estimator/tensorflow_estimator/python/estimator/api/create_python_api_wrapper.py",
> line 26, in <module>
> | from tensorflow_estimator.python.estimator import estimator_lib
> # pylint: disable=unused-import
> | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/bazel/output_base/execroot/org_tensorflow_estimator/bazel-out/k8-opt-exec-2B5CBBC6/bin/tensorflow_estimator/python/estimator/api/create_tensorflow_estimator.python.estimator_api_1_estimator_python_api_gen_compat_v1.runfiles/org_tensorflow_estimator/tensorflow_estimator/python/estimator/estimator_lib.py",
> line 22, in <module>
> | from tensorflow_estimator.python.estimator.canned.baseline
> import BaselineClassifier
> | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/bazel/output_base/execroot/org_tensorflow_estimator/bazel-out/k8-opt-exec-2B5CBBC6/bin/tensorflow_estimator/python/estimator/api/create_tensorflow_estimator.python.estimator_api_1_estimator_python_api_gen_compat_v1.runfiles/org_tensorflow_estimator/tensorflow_estimator/python/estimator/canned/baseline.py",
> line 53, in <module>
> | import tensorflow as tf
> | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/__init__.py",
> line 55, in <module>
> | from ._api.v2 import compat
> | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/_api/v2/compat/__init__.py",
> line 39, in <module>
> | from . import v1
> | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/_api/v2/compat/v1/__init__.py",
> line 34, in <module>
> | from . import compat
> | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/_api/v2/compat/v1/compat/__init__.py",
> line 39, in <module>
> | from . import v1
> | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/_api/v2/compat/v1/compat/v1/__init__.py",
> line 51, in <module>
> | from tensorflow._api.v2.compat.v1 import lite
> | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/_api/v2/compat/v1/lite/__init__.py",
> line 11, in <module>
> | from . import experimental
> | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/_api/v2/compat/v1/lite/experimental/__init__.py",
> line 10, in <module>
> | from . import nn
> | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/_api/v2/compat/v1/lite/experimental/nn/__init__.py",
> line 10, in <module>
> | from tensorflow.lite.python.lite import TFLiteLSTMCell
> | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/lite/python/lite.py",
> line 40, in <module>
> | from tensorflow.lite.python.convert import
> build_toco_convert_protos # pylint: disable=unused-import
> | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/lite/python/convert.py",
> line 33, in <module>
> | from tensorflow.lite.python import util
> | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/lite/python/util.py",
> line 30, in <module>
> | import flatbuffers
> | ModuleNotFoundError: No module named 'flatbuffers'
>
> FLatbuffers from openembedded are available version 1.12. Do you have
> an idea what is can cause?
>> tensorflow-native \
>> "
>>
>> do_compile () {
>> unset CC
>> export TMPDIR="${WORKDIR}"
>> + export PYTHON_BIN_PATH="${PYTHON}"
>> +
>> ${BAZEL} build \
>> --subcommands --explain=${T}/explain.log \
>> --verbose_explanations --verbose_failures \
>> @@ -32,7 +39,6 @@ do_compile () {
>> --python_path="${PYTHON}" \
>> //tensorflow_estimator/tools/pip_package:build_pip_package
>>
>> - PYTHON_BIN_PATH="${PYTHON}" \
>> ${S}/bazel-bin/tensorflow_estimator/tools/pip_package/build_pip_package \
>> ${WORKDIR}/estimator_pip
>> }
>> --
>> 2.21.0
>>
>
> Thanks and BR,
>
> marek
Marek,
Does this happen if you use the master branch?
Hongxu, Any tips for Marek?
../Randy
>
>
>
>
>
--
# Randy MacLeod
# Wind River Linux
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [yocto] [meta-tensorflow][PATCH 8/25] tensorflow-estimator: 1.13 -> 2.4
2021-01-07 17:51 ` [yocto] " Randy MacLeod
@ 2021-01-07 18:47 ` Marek Belisko
2021-01-07 20:47 ` Randy MacLeod
0 siblings, 1 reply; 33+ messages in thread
From: Marek Belisko @ 2021-01-07 18:47 UTC (permalink / raw)
To: Randy MacLeod; +Cc: Hongxu Jia, philip, akuster808, yocto
HI Randy,
On Thu, Jan 7, 2021 at 6:51 PM Randy MacLeod
<randy.macleod@windriver.com> wrote:
>
> On 2021-01-04 5:30 a.m., Marek Belisko wrote:
> > Hi Hongxu,
> >
> > On Wed, Dec 16, 2020 at 2:09 PM Hongxu Jia <hongxu.jia@windriver.com> wrote:
> >>
> >> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> >> ---
> >> .../0001-customize-for-yocto.patch | 28 +++++++++++++++++++
> >> .../tensorflow/tensorflow-estimator_1.13.bb | 12 ++++++--
> >> 2 files changed, 37 insertions(+), 3 deletions(-)
> >> create mode 100644 recipes-framework/tensorflow/tensorflow-estimator/0001-customize-for-yocto.patch
> >>
> >> diff --git a/recipes-framework/tensorflow/tensorflow-estimator/0001-customize-for-yocto.patch b/recipes-framework/tensorflow/tensorflow-estimator/0001-customize-for-yocto.patch
> >> new file mode 100644
> >> index 0000000..e9b66d5
> >> --- /dev/null
> >> +++ b/recipes-framework/tensorflow/tensorflow-estimator/0001-customize-for-yocto.patch
> >> @@ -0,0 +1,28 @@
> >> +From a1bcf09a43fc44ad5e04c441ee45cc23d16cf7d2 Mon Sep 17 00:00:00 2001
> >> +From: Hongxu Jia <hongxu.jia@windriver.com>
> >> +Date: Wed, 9 Dec 2020 17:59:01 +0800
> >> +Subject: [PATCH] customize for yocto
> >> +
> >> +Upstream-Status: Inappropriate [oe specific]
> >> +
> >> +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> >> +---
> >> + tensorflow_estimator/tools/pip_package/build_pip_package.sh | 2 +-
> >> + 1 file changed, 1 insertion(+), 1 deletion(-)
> >> +
> >> +diff --git a/tensorflow_estimator/tools/pip_package/build_pip_package.sh b/tensorflow_estimator/tools/pip_package/build_pip_package.sh
> >> +index d4953a6..e08cd8a 100755
> >> +--- a/tensorflow_estimator/tools/pip_package/build_pip_package.sh
> >> ++++ b/tensorflow_estimator/tools/pip_package/build_pip_package.sh
> >> +@@ -38,7 +38,7 @@ function prepare_src() {
> >> +
> >> + # Verifies all expected files are in pip.
> >> + # Creates init files in all directory in pip.
> >> +- python tensorflow_estimator/tools/pip_package/create_pip_helper.py --pip-root "${TMPDIR}/tensorflow_estimator/" --bazel-root "./tensorflow_estimator"
> >> ++ nativepython3 tensorflow_estimator/tools/pip_package/create_pip_helper.py --pip-root "${TMPDIR}/tensorflow_estimator/" --bazel-root "./tensorflow_estimator"
> >> + }
> >> +
> >> + function build_wheel() {
> >> +--
> >> +2.18.2
> >> +
> >> diff --git a/recipes-framework/tensorflow/tensorflow-estimator_1.13.bb b/recipes-framework/tensorflow/tensorflow-estimator_1.13.bb
> >> index f3a5098..5b2fe5d 100644
> >> --- a/recipes-framework/tensorflow/tensorflow-estimator_1.13.bb
> >> +++ b/recipes-framework/tensorflow/tensorflow-estimator_1.13.bb
> >> @@ -3,9 +3,10 @@ learning programming."
> >> LICENSE = "Apache-2.0"
> >> LIC_FILES_CHKSUM = "file://LICENSE;md5=01e86893010a1b87e69a213faa753ebd"
> >>
> >> -SRC_URI = "git://github.com/tensorflow/estimator.git;branch=r1.13 \
> >> +SRC_URI = "git://github.com/tensorflow/estimator.git;branch=r2.4 \
> >> + file://0001-customize-for-yocto.patch \
> >> "
> >> -SRCREV = "340703eed78ba4854862f749ed94f91598826e79"
> >> +SRCREV = "c3e7f2b5bbcc35185ef71797955a28cadce28f60"
> >> S = "${WORKDIR}/git"
> >>
> >> inherit python3native bazel
> >> @@ -19,12 +20,18 @@ DEPENDS += " \
> >> python3-astor-native \
> >> python3-gast-native \
> >> python3-termcolor-native \
> >> + python3-wrapt-native \
> >> + python3-opt-einsum-native \
> >> + python3-astunparse-native \
> >> + flatbuffers-native \
> > I'm getting issue when building tensorflow-estimator (I add small
> > changes to be able to build this patches on top of dunfell) and I'm
> > getting:
> > | /bin/bash -c 'source
> > external/bazel_tools/tools/genrule/genrule-setup.sh;
> > bazel-out/k8-opt-exec-2B5CBBC6/bin/tensorflow_estimator/python/estimator/api/create_tensorflow_estimator.python.estimator_api_1_estimator_python_api_gen_compat_v1
> > --apidir=bazel-out/k8-fastbuild/bin/tensorflow_estimator/python/estimator/api_v1/
> > --apiname=estimator --apiversion=1
> > --package=tensorflow_estimator.python.estimator
> > --output_package=tensorflow_estimator.python.estimator.api._v1
> > bazel-out/k8-fastbuild/bin/tensorflow_estimator/python/estimator/api/_v1/v1.py
> > bazel-out/k8-fastbuild/bin/tensorflow_estimator/python/estimator/api/_v1/estimator/__init__.py
> > bazel-out/k8-fastbuild/bin/tensorflow_estimator/python/estimator/api/_v1/estimator/experimental/__init__.py
> > bazel-out/k8-fastbuild/bin/tensorflow_estimator/python/estimator/api/_v1/estimator/export/__init__.py
> > bazel-out/k8-fastbuild/bin/tensorflow_estimator/python/estimator/api/_v1/estimator/inputs/__init__.py
> > bazel-out/k8-fastbuild/bin/tensorflow_estimator/python/estimator/api/_v1/estimator/tpu/__init__.py
> > bazel-out/k8-fastbuild/bin/tensorflow_estimator/python/estimator/api/_v1/estimator/tpu/experimental/__init__.py')
> > | Execution platform: @local_config_platform//:host
> > | /home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/h5py/__init__.py:72:
> > UserWarning: h5py is running against HDF5 1.8.21 when it was built
> > against 1.8.19, this may cause problems
> > | _warn(("h5py is running against HDF5 {0} when it was built against {1}, "
> > | Traceback (most recent call last):
> > | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/bazel/output_base/execroot/org_tensorflow_estimator/bazel-out/k8-opt-exec-2B5CBBC6/bin/tensorflow_estimator/python/estimator/api/create_tensorflow_estimator.python.estimator_api_1_estimator_python_api_gen_compat_v1.runfiles/org_tensorflow_estimator/tensorflow_estimator/python/estimator/api/create_python_api_wrapper.py",
> > line 26, in <module>
> > | from tensorflow_estimator.python.estimator import estimator_lib
> > # pylint: disable=unused-import
> > | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/bazel/output_base/execroot/org_tensorflow_estimator/bazel-out/k8-opt-exec-2B5CBBC6/bin/tensorflow_estimator/python/estimator/api/create_tensorflow_estimator.python.estimator_api_1_estimator_python_api_gen_compat_v1.runfiles/org_tensorflow_estimator/tensorflow_estimator/python/estimator/estimator_lib.py",
> > line 22, in <module>
> > | from tensorflow_estimator.python.estimator.canned.baseline
> > import BaselineClassifier
> > | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/bazel/output_base/execroot/org_tensorflow_estimator/bazel-out/k8-opt-exec-2B5CBBC6/bin/tensorflow_estimator/python/estimator/api/create_tensorflow_estimator.python.estimator_api_1_estimator_python_api_gen_compat_v1.runfiles/org_tensorflow_estimator/tensorflow_estimator/python/estimator/canned/baseline.py",
> > line 53, in <module>
> > | import tensorflow as tf
> > | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/__init__.py",
> > line 55, in <module>
> > | from ._api.v2 import compat
> > | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/_api/v2/compat/__init__.py",
> > line 39, in <module>
> > | from . import v1
> > | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/_api/v2/compat/v1/__init__.py",
> > line 34, in <module>
> > | from . import compat
> > | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/_api/v2/compat/v1/compat/__init__.py",
> > line 39, in <module>
> > | from . import v1
> > | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/_api/v2/compat/v1/compat/v1/__init__.py",
> > line 51, in <module>
> > | from tensorflow._api.v2.compat.v1 import lite
> > | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/_api/v2/compat/v1/lite/__init__.py",
> > line 11, in <module>
> > | from . import experimental
> > | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/_api/v2/compat/v1/lite/experimental/__init__.py",
> > line 10, in <module>
> > | from . import nn
> > | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/_api/v2/compat/v1/lite/experimental/nn/__init__.py",
> > line 10, in <module>
> > | from tensorflow.lite.python.lite import TFLiteLSTMCell
> > | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/lite/python/lite.py",
> > line 40, in <module>
> > | from tensorflow.lite.python.convert import
> > build_toco_convert_protos # pylint: disable=unused-import
> > | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/lite/python/convert.py",
> > line 33, in <module>
> > | from tensorflow.lite.python import util
> > | File "/home/ubuntu/projects/test/build/tmp/work/aarch64-poky-linux/tensorflow-estimator/2.4-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/tensorflow/lite/python/util.py",
> > line 30, in <module>
> > | import flatbuffers
> > | ModuleNotFoundError: No module named 'flatbuffers'
> >
> > FLatbuffers from openembedded are available version 1.12. Do you have
> > an idea what is can cause?
> >> tensorflow-native \
> >> "
> >>
> >> do_compile () {
> >> unset CC
> >> export TMPDIR="${WORKDIR}"
> >> + export PYTHON_BIN_PATH="${PYTHON}"
> >> +
> >> ${BAZEL} build \
> >> --subcommands --explain=${T}/explain.log \
> >> --verbose_explanations --verbose_failures \
> >> @@ -32,7 +39,6 @@ do_compile () {
> >> --python_path="${PYTHON}" \
> >> //tensorflow_estimator/tools/pip_package:build_pip_package
> >>
> >> - PYTHON_BIN_PATH="${PYTHON}" \
> >> ${S}/bazel-bin/tensorflow_estimator/tools/pip_package/build_pip_package \
> >> ${WORKDIR}/estimator_pip
> >> }
> >> --
> >> 2.21.0
> >>
> >
> > Thanks and BR,
> >
> > marek
>
> Marek,
> Does this happen if you use the master branch?
Yes this comes from master branch.
>
> Hongxu, Any tips for Marek?
>
> ../Randy
BR,
marek
>
> >
> >
> >
> >
> >
>
>
> --
> # Randy MacLeod
> # Wind River Linux
--
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer
Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.com
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [yocto] [meta-tensorflow][PATCH 8/25] tensorflow-estimator: 1.13 -> 2.4
2021-01-07 18:47 ` Marek Belisko
@ 2021-01-07 20:47 ` Randy MacLeod
2021-01-25 18:57 ` Marek Belisko
0 siblings, 1 reply; 33+ messages in thread
From: Randy MacLeod @ 2021-01-07 20:47 UTC (permalink / raw)
To: Belisko Marek; +Cc: Hongxu Jia, philip, akuster808, yocto
On 2021-01-07 1:47 p.m., Belisko Marek wrote:
>> Marek,
>> Does this happen if you use the master branch?
> Yes this comes from master branch.
Hi Marek,
Is it:
A) Comes from master and is a problem on dunfell or
B) it is reproducible on the master branch?
Given that you said:
> I'm getting issue when building tensorflow-estimator (I add small
> changes to be able to build this patches on top of dunfell) ...
I suspect it's A only. Right?
What are your small changes.
Hongxu may take a quick look but we generally can't afford to
investigate all combinations of recipe/branchs as I'm sure you
can appreciate.
If you can reproduce the error on master without or even with your
changes then that's a different story.
Good luck and Happy New Year!
--
# Randy MacLeod
# Wind River Linux
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [yocto] [meta-tensorflow][PATCH 8/25] tensorflow-estimator: 1.13 -> 2.4
2021-01-07 20:47 ` Randy MacLeod
@ 2021-01-25 18:57 ` Marek Belisko
2021-01-25 20:46 ` Randy MacLeod
0 siblings, 1 reply; 33+ messages in thread
From: Marek Belisko @ 2021-01-25 18:57 UTC (permalink / raw)
To: Randy MacLeod; +Cc: Hongxu Jia, philip, akuster808, yocto
Hi Randy,
On Thu, Jan 7, 2021 at 9:47 PM Randy MacLeod
<randy.macleod@windriver.com> wrote:
>
> On 2021-01-07 1:47 p.m., Belisko Marek wrote:
> >> Marek,
> >> Does this happen if you use the master branch?
> > Yes this comes from master branch.
>
> Hi Marek,
>
> Is it:
> A) Comes from master and is a problem on dunfell or
> B) it is reproducible on the master branch?
>
> Given that you said:
> > I'm getting issue when building tensorflow-estimator (I add small
> > changes to be able to build this patches on top of dunfell) ...
>
> I suspect it's A only. Right?
>
> What are your small changes.
>
> Hongxu may take a quick look but we generally can't afford to
> investigate all combinations of recipe/branchs as I'm sure you
> can appreciate.
I have done some small changes and now have tensorflow from master
working on top of dunfell. Would you be interested in sharing changes
back and integrate to repo?
>
> If you can reproduce the error on master without or even with your
> changes then that's a different story.
>
> Good luck and Happy New Year!
>
> --
> # Randy MacLeod
> # Wind River Linux
Thanks and BR,
marek
^ permalink raw reply [flat|nested] 33+ messages in thread
* Re: [yocto] [meta-tensorflow][PATCH 8/25] tensorflow-estimator: 1.13 -> 2.4
2021-01-25 18:57 ` Marek Belisko
@ 2021-01-25 20:46 ` Randy MacLeod
0 siblings, 0 replies; 33+ messages in thread
From: Randy MacLeod @ 2021-01-25 20:46 UTC (permalink / raw)
To: Belisko Marek; +Cc: Hongxu Jia, philip, akuster808, yocto
On 2021-01-25 1:57 p.m., Belisko Marek wrote:
> Hi Randy,
>
> On Thu, Jan 7, 2021 at 9:47 PM Randy MacLeod
> <randy.macleod@windriver.com> wrote:
>>
>> On 2021-01-07 1:47 p.m., Belisko Marek wrote:
>>>> Marek,
>>>> Does this happen if you use the master branch?
>>> Yes this comes from master branch.
>>
>> Hi Marek,
>>
>> Is it:
>> A) Comes from master and is a problem on dunfell or
>> B) it is reproducible on the master branch?
>>
>> Given that you said:
>> > I'm getting issue when building tensorflow-estimator (I add small
>> > changes to be able to build this patches on top of dunfell) ...
>>
>> I suspect it's A only. Right?
>>
>> What are your small changes.
>>
>> Hongxu may take a quick look but we generally can't afford to
>> investigate all combinations of recipe/branchs as I'm sure you
>> can appreciate.
> I have done some small changes and now have tensorflow from master
> working on top of dunfell.
Hi Marek,
That's good to hear!
> Would you be interested in sharing changes
> back and integrate to repo?
I suspect it's not much work to merge the fixes
and maintain the branch, but I'll leave it up to Hongxu.
../Randy
>>
>> If you can reproduce the error on master without or even with your
>> changes then that's a different story.
>>
>> Good luck and Happy New Year!
>>
>> --
>> # Randy MacLeod
>> # Wind River Linux
>
> Thanks and BR,
>
> marek
>
--
# Randy MacLeod
# Wind River Linux
^ permalink raw reply [flat|nested] 33+ messages in thread
end of thread, other threads:[~2021-01-25 20:46 UTC | newest]
Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16 13:07 Review request 0/25:[meta-tensorflow] upgrade tensorflow 1.13.1 -> 2.4.0.rc4 hongxu
2020-12-16 13:07 ` [meta-tensorflow][PATCH 1/25] openjdk-8-native: 212b04 -> 275b01 hongxu
2020-12-16 16:49 ` [yocto] " Kent Dorfman
2020-12-16 13:07 ` [meta-tensorflow][PATCH 2/25] bazel-native: 0.21.0 -> 3.1.0 hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 3/25] tensorflow: 1.13.0 -> 2.4.0 hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 4/25] add python3-gast 0.3.3 hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 5/25] python3-opt-einsum: add 3.3.0 hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 6/25] python3-google-pasta: add 0.2.0 hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 7/25] python3-astunparse: add 1.6.3 hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 8/25] tensorflow-estimator: 1.13 -> 2.4 hongxu
2021-01-04 10:30 ` Marek Belisko
2021-01-07 17:51 ` [yocto] " Randy MacLeod
2021-01-07 18:47 ` Marek Belisko
2021-01-07 20:47 ` Randy MacLeod
2021-01-25 18:57 ` Marek Belisko
2021-01-25 20:46 ` Randy MacLeod
2020-12-16 13:08 ` [meta-tensorflow][PATCH 9/25] bazel-native/bazel.bbclass: use default Bazel toolchain to build Yocto native tools hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 10/25] bazel-native/bazel.bbclass: replace deprecated --local_resources hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 11/25] tensorflow: update cross compile support hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 12/25] tensorflow: fix Multiple shlib providers for libtensorflow_framework.so hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 13/25] classes/bazel.bbclass: clean up bazel files before do_clean hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 14/25] python3-google-auth: 1.6.3 -> 1.24.0 hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 15/25] python3-google-auth-oauthlib: add version 0.4.2 hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 16/25] python3-pyasn1: add 0.4.8 hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 17/25] python3-pyasn1-modules: add version 0.2.8 hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 18/25] tensorboard: 1.12.2 -> 2.4 hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 19/25] tensorflow: clean up CROSSTOOL.tpl hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 20/25] bazel-native: 3.1.0 -> 3.7.1 hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 21/25] add classes/bazel-base.bbclass and imporve classes/bazel-base.bbclass hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 22/25] bazel-native/bazel.bbclass: support bazel build without limitation hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 23/25] BUILD.md: update quick start for tensorflow 2 hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 24/25] tensorflow: split sub packages hongxu
2020-12-16 13:08 ` [meta-tensorflow][PATCH 25/25] update LIMITATION.md hongxu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.