Skip to content

Commit c9a8196

Browse files
authored
Update tensorflow+deps to remove -pthread from wasm
1 parent 24e8957 commit c9a8196

12 files changed

+1221
-821
lines changed

tensorflow/tensorflow.bzl

+1
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ def tf_copts(
324324
}) +
325325
select({
326326
clean_dep("//tensorflow:android"): android_copts,
327+
clean_dep("//tensorflow:emscripten"): [],
327328
clean_dep("//tensorflow:macos"): [],
328329
clean_dep("//tensorflow:windows"): get_win_copts(is_external),
329330
clean_dep("//tensorflow:ios"): [],

tensorflow/workspace.bzl

+31-13
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ load(
2222
"def_file_filter_configure",
2323
)
2424
load("//third_party/FP16:workspace.bzl", FP16 = "repo")
25-
load("//third_party/FXdiv:workspace.bzl", FXdiv = "repo")
2625
load("//third_party/aws:workspace.bzl", aws = "repo")
2726
load("//third_party/clog:workspace.bzl", clog = "repo")
2827
load("//third_party/cpuinfo:workspace.bzl", cpuinfo = "repo")
@@ -38,14 +37,12 @@ load("//third_party/opencl_headers:workspace.bzl", opencl_headers = "repo")
3837
load("//third_party/kissfft:workspace.bzl", kissfft = "repo")
3938
load("//third_party/pasta:workspace.bzl", pasta = "repo")
4039
load("//third_party/psimd:workspace.bzl", psimd = "repo")
41-
load("//third_party/pthreadpool:workspace.bzl", pthreadpool = "repo")
4240
load("//third_party/sobol_data:workspace.bzl", sobol_data = "repo")
4341
load("//third_party/vulkan_headers:workspace.bzl", vulkan_headers = "repo")
4442

4543
def initialize_third_party():
4644
""" Load third party repositories. See above load() statements. """
4745
FP16()
48-
FXdiv()
4946
aws()
5047
clog()
5148
cpuinfo()
@@ -61,7 +58,6 @@ def initialize_third_party():
6158
opencl_headers()
6259
pasta()
6360
psimd()
64-
pthreadpool()
6561
sobol_data()
6662
vulkan_headers()
6763

@@ -145,11 +141,32 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):
145141
tf_http_archive(
146142
name = "XNNPACK",
147143
build_file = clean_dep("//third_party:xnnpack.BUILD"),
148-
sha256 = "190e61e50af3497bb46b8d936bd2d2d551a9aeedb02ff66388918408a54e216a",
149-
strip_prefix = "XNNPACK-b18783570f0643560be641b193367d3906955141",
144+
sha256 = "246aa56afc5263f1d41fc4a3437ecd51b56f78e16421818961cf79e39431c1df",
145+
strip_prefix = "XNNPACK-b9d07cfa38af15c2abf564c980e00c965857ba21",
150146
urls = [
151-
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/XNNPACK/archive/b18783570f0643560be641b193367d3906955141.zip",
152-
"https://github.com/google/XNNPACK/archive/b18783570f0643560be641b193367d3906955141.zip",
147+
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/XNNPACK/archive/b9d07cfa38af15c2abf564c980e00c965857ba21.zip",
148+
"https://github.com/google/XNNPACK/archive/b9d07cfa38af15c2abf564c980e00c965857ba21.zip",
149+
],
150+
)
151+
152+
tf_http_archive(
153+
name = "FXdiv",
154+
sha256 = "8224ff187cdfa178b8c54d36eea70520391781eda16d13a418ab5ae53289e1ab",
155+
strip_prefix = "FXdiv-561254d968e5679460e6a0a743206410284d9f46",
156+
urls = [
157+
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/Maratyszcza/FXdiv/archive/561254d968e5679460e6a0a743206410284d9f46.zip",
158+
"https://github.com/Maratyszcza/FXdiv/archive/561254d968e5679460e6a0a743206410284d9f46.zip",
159+
],
160+
)
161+
162+
tf_http_archive(
163+
name = "pthreadpool",
164+
build_file = clean_dep("//third_party:pthreadpool.BUILD"),
165+
sha256 = "f894d845cefc091291329712deec85ce7020546f6eaff200b690ae04b6094535",
166+
strip_prefix = "pthreadpool-bfa3b9ce6cb71dc8b792e39d24717320a4f92572",
167+
urls = [
168+
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/Maratyszcza/pthreadpool/archive/bfa3b9ce6cb71dc8b792e39d24717320a4f92572.zip",
169+
"https://github.com/Maratyszcza/pthreadpool/archive/bfa3b9ce6cb71dc8b792e39d24717320a4f92572.zip",
153170
],
154171
)
155172

@@ -185,12 +202,13 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):
185202
build_file = clean_dep("//third_party:com_google_absl.BUILD"),
186203
# TODO: Remove the patch when https://github.com/abseil/abseil-cpp/issues/326 is resolved
187204
# and when TensorFlow is build against CUDA 10.2
188-
patch_file = clean_dep("//third_party:com_google_absl_fix_mac_and_nvcc_build.patch"),
189-
sha256 = "acd93f6baaedc4414ebd08b33bebca7c7a46888916101d8c0b8083573526d070", # SHARED_ABSL_SHA
190-
strip_prefix = "abseil-cpp-43ef2148c0936ebf7cb4be6b19927a9d9d145b8f",
205+
# Added wasm config patch for code8
206+
patch_file = clean_dep("//third_party:com_google_absl_fix_wasm_config_setting.patch"),
207+
sha256 = "ec8ef47335310cc3382bdc0d0cc1097a001e67dc83fcba807845aa5696e7e1e4", # SHARED_ABSL_SHA
208+
strip_prefix = "abseil-cpp-302b250e1d917ede77b5ff00a6fd9f28430f1563",
191209
urls = [
192-
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/abseil/abseil-cpp/archive/43ef2148c0936ebf7cb4be6b19927a9d9d145b8f.tar.gz",
193-
"https://github.com/abseil/abseil-cpp/archive/43ef2148c0936ebf7cb4be6b19927a9d9d145b8f.tar.gz",
210+
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/abseil/abseil-cpp/archive/302b250e1d917ede77b5ff00a6fd9f28430f1563.tar.gz",
211+
"https://github.com/abseil/abseil-cpp/archive/302b250e1d917ede77b5ff00a6fd9f28430f1563.tar.gz",
194212
],
195213
)
196214

third_party/FP16/workspace.bzl

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ load("//third_party:repo.bzl", "third_party_http_archive")
55
def repo():
66
third_party_http_archive(
77
name = "FP16",
8-
strip_prefix = "FP16-febbb1c163726b5db24bed55cc9dc42529068997",
9-
sha256 = "3e71681e0a67cd28552aa0bbb78ec6a6bd238216df15336dc1326280f7958de2",
8+
strip_prefix = "FP16-3c54eacb74f6f5e39077300c5564156c424d77ba",
9+
sha256 = "0d56bb92f649ec294dbccb13e04865e3c82933b6f6735d1d7145de45da700156",
1010
urls = [
11-
"https://mirror.bazel.build/github.com/Maratyszcza/FP16/archive/febbb1c163726b5db24bed55cc9dc42529068997.tar.gz",
12-
"https://github.com/Maratyszcza/FP16/archive/febbb1c163726b5db24bed55cc9dc42529068997.tar.gz",
11+
"https://mirror.bazel.build/github.com/Maratyszcza/FP16/archive/3c54eacb74f6f5e39077300c5564156c424d77ba.zip",
12+
"https://github.com/Maratyszcza/FP16/archive/3c54eacb74f6f5e39077300c5564156c424d77ba.zip",
1313
],
1414
build_file = "//third_party/FP16:BUILD.bazel",
1515
)

third_party/FXdiv/BUILD

-1
This file was deleted.

third_party/FXdiv/BUILD.bazel

-15
This file was deleted.

third_party/FXdiv/workspace.bzl

-15
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
--- ./absl/BUILD.bazel 2020-07-12 14:21:35.000000000 -0700
2+
+++ ./absl/BUILD.bazel 2020-10-20 12:17:37.000000000 -0700
3+
@@ -61,5 +61,5 @@
4+
5+
config_setting(
6+
name = "wasm",
7+
- values = {"cpu": "wasm32"},
8+
+ values = {"cpu": "js"},
9+
)
10+
--- ./absl/time/internal/cctz/BUILD.bazel 2019-09-23 13:20:52.000000000 -0700
11+
+++ ./absl/time/internal/cctz/BUILD.bazel.fixed 2019-09-23 13:20:48.000000000 -0700
12+
@@ -76,15 +76,6 @@
13+
"include/cctz/time_zone.h",
14+
"include/cctz/zone_info_source.h",
15+
],
16+
- linkopts = select({
17+
- ":osx": [
18+
- "-framework Foundation",
19+
- ],
20+
- ":ios": [
21+
- "-framework Foundation",
22+
- ],
23+
- "//conditions:default": [],
24+
- }),
25+
visibility = ["//visibility:public"],
26+
deps = [":civil_time"],
27+
)
28+
--- ./absl/strings/string_view.h 2019-09-23 13:20:52.000000000 -0700
29+
+++ ./absl/strings/string_view.h.fixed 2019-09-23 13:20:48.000000000 -0700
30+
@@ -520,7 +520,14 @@
31+
(std::numeric_limits<difference_type>::max)();
32+
33+
static constexpr size_type CheckLengthInternal(size_type len) {
34+
+#if defined(__NVCC__) && (__CUDACC_VER_MAJOR__<10 || (__CUDACC_VER_MAJOR__==10 && __CUDACC_VER_MINOR__<2)) && !defined(NDEBUG)
35+
+ // An nvcc bug treats the original return expression as a non-constant,
36+
+ // which is not allowed in a constexpr function. This only happens when
37+
+ // NDEBUG is not defined. This will be fixed in the CUDA 10.2 release.
38+
+ return len;
39+
+#else
40+
return ABSL_HARDENING_ASSERT(len <= kMaxSize), len;
41+
+#endif
42+
}
43+
44+
const char* ptr_;

0 commit comments

Comments
 (0)