1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
From 87e7f67bc9a0fb3a9d227c5f676ec28ebdcaa010 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Thu, 22 Aug 2024 01:56:07 -0700
Subject: [PATCH] support 32 bit x64 and arm for yocto
Upstream-Status: Inappropriate [oe specific]
Rebase to 2.17.0
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
tensorflow/BUILD | 3 --
tensorflow/workspace2.bzl | 2 ++
.../0001-XNNPACK-support-32-bit-x86.patch | 29 +++++++++++++++++++
.../0001-cpuinfo-support-32-bit-x86.patch | 28 ++++++++++++++++++
4 files changed, 59 insertions(+), 3 deletions(-)
create mode 100644 third_party/0001-XNNPACK-support-32-bit-x86.patch
create mode 100644 third_party/0001-cpuinfo-support-32-bit-x86.patch
diff --git a/tensorflow/BUILD b/tensorflow/BUILD
index 21ccd9dead0..e888cbb709a 100644
--- a/tensorflow/BUILD
+++ b/tensorflow/BUILD
@@ -276,9 +276,6 @@ config_setting(
[],
),
values = dict(
- if_oss(
- {"crosstool_top": "//external:android/crosstool"},
- ),
cpu = "x86",
),
visibility = ["//visibility:public"],
diff --git a/tensorflow/workspace2.bzl b/tensorflow/workspace2.bzl
index d52d1f00f8c..5892b7ad446 100644
--- a/tensorflow/workspace2.bzl
+++ b/tensorflow/workspace2.bzl
@@ -160,6 +160,7 @@ def _tf_repositories():
name = "XNNPACK",
sha256 = "9e1efd0e43bff4a3b089faff6b0ee466291848fd855609a99e412befdec15bb0",
strip_prefix = "XNNPACK-bfea23551ac47c9d71b82120b299ff6173fc9097",
+ patch_file = ["//third_party:0001-XNNPACK-support-32-bit-x86.patch"],
urls = tf_mirror_urls("https://github.com/google/XNNPACK/archive/bfea23551ac47c9d71b82120b299ff6173fc9097.zip"),
)
# LINT.ThenChange(//tensorflow/lite/tools/cmake/modules/xnnpack.cmake)
@@ -182,6 +183,7 @@ def _tf_repositories():
name = "cpuinfo",
strip_prefix = "cpuinfo-ef634603954d88d2643d5809011288b890ac126e",
sha256 = "e07512a11e1c71687359a133f49d60583d7465b737fe5dbe11f461c9aaa72a2b",
+ patch_file = ["//third_party:0001-cpuinfo-support-32-bit-x86.patch"],
urls = tf_mirror_urls("https://github.com/pytorch/cpuinfo/archive/ef634603954d88d2643d5809011288b890ac126e.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..9d7e91ff9fe
--- /dev/null
+++ b/third_party/0001-XNNPACK-support-32-bit-x86.patch
@@ -0,0 +1,29 @@
+From 13f013db421c5aefa021f3b75d9d8554ad4fde52 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@eng.windriver.com>
+Date: Fri, 1 Mar 2024 00:35:18 -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@eng.windriver.com>
+---
+ build_config/BUILD.bazel | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/build_config/BUILD.bazel b/build_config/BUILD.bazel
+index d0b8902..75dfb79 100644
+--- a/build_config/BUILD.bazel
++++ b/build_config/BUILD.bazel
+@@ -73,7 +73,6 @@ config_setting(
+ config_setting(
+ name = "android_x86",
+ values = {
+- "crosstool_top": "//external:android/crosstool",
+ "cpu": "x86",
+ },
+ )
+--
+2.42.0
+
diff --git a/third_party/0001-cpuinfo-support-32-bit-x86.patch b/third_party/0001-cpuinfo-support-32-bit-x86.patch
new file mode 100644
index 00000000000..0c83cf01675
--- /dev/null
+++ b/third_party/0001-cpuinfo-support-32-bit-x86.patch
@@ -0,0 +1,28 @@
+From f5e52b2db5516954dab9026e4f386982c4c3c3a4 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Mon, 19 Sep 2022 00:10:18 -0700
+Subject: [PATCH] cpuinfo: 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 7c002fe..68fd5b5 100644
+--- a/BUILD.bazel
++++ b/BUILD.bazel
+@@ -274,7 +274,6 @@ config_setting(
+ config_setting(
+ name = "android_x86",
+ values = {
+- "crosstool_top": "//external:android/crosstool",
+ "cpu": "x86",
+ },
+ visibility = ["//visibility:public"],
+--
+2.37.1
+
--
2.25.1
|