Skip to content

Commit

Permalink
Update tensorflow+deps to remove -pthread from wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
erikmchut authored Oct 20, 2020
1 parent 24e8957 commit c9a8196
Show file tree
Hide file tree
Showing 12 changed files with 1,221 additions and 821 deletions.
1 change: 1 addition & 0 deletions tensorflow/tensorflow.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ def tf_copts(
}) +
select({
clean_dep("//tensorflow:android"): android_copts,
clean_dep("//tensorflow:emscripten"): [],
clean_dep("//tensorflow:macos"): [],
clean_dep("//tensorflow:windows"): get_win_copts(is_external),
clean_dep("//tensorflow:ios"): [],
Expand Down
44 changes: 31 additions & 13 deletions tensorflow/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ load(
"def_file_filter_configure",
)
load("//third_party/FP16:workspace.bzl", FP16 = "repo")
load("//third_party/FXdiv:workspace.bzl", FXdiv = "repo")
load("//third_party/aws:workspace.bzl", aws = "repo")
load("//third_party/clog:workspace.bzl", clog = "repo")
load("//third_party/cpuinfo:workspace.bzl", cpuinfo = "repo")
Expand All @@ -38,14 +37,12 @@ load("//third_party/opencl_headers:workspace.bzl", opencl_headers = "repo")
load("//third_party/kissfft:workspace.bzl", kissfft = "repo")
load("//third_party/pasta:workspace.bzl", pasta = "repo")
load("//third_party/psimd:workspace.bzl", psimd = "repo")
load("//third_party/pthreadpool:workspace.bzl", pthreadpool = "repo")
load("//third_party/sobol_data:workspace.bzl", sobol_data = "repo")
load("//third_party/vulkan_headers:workspace.bzl", vulkan_headers = "repo")

def initialize_third_party():
""" Load third party repositories. See above load() statements. """
FP16()
FXdiv()
aws()
clog()
cpuinfo()
Expand All @@ -61,7 +58,6 @@ def initialize_third_party():
opencl_headers()
pasta()
psimd()
pthreadpool()
sobol_data()
vulkan_headers()

Expand Down Expand Up @@ -145,11 +141,32 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):
tf_http_archive(
name = "XNNPACK",
build_file = clean_dep("//third_party:xnnpack.BUILD"),
sha256 = "190e61e50af3497bb46b8d936bd2d2d551a9aeedb02ff66388918408a54e216a",
strip_prefix = "XNNPACK-b18783570f0643560be641b193367d3906955141",
sha256 = "246aa56afc5263f1d41fc4a3437ecd51b56f78e16421818961cf79e39431c1df",
strip_prefix = "XNNPACK-b9d07cfa38af15c2abf564c980e00c965857ba21",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/XNNPACK/archive/b18783570f0643560be641b193367d3906955141.zip",
"https://github.com/google/XNNPACK/archive/b18783570f0643560be641b193367d3906955141.zip",
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/XNNPACK/archive/b9d07cfa38af15c2abf564c980e00c965857ba21.zip",
"https://github.com/google/XNNPACK/archive/b9d07cfa38af15c2abf564c980e00c965857ba21.zip",
],
)

tf_http_archive(
name = "FXdiv",
sha256 = "8224ff187cdfa178b8c54d36eea70520391781eda16d13a418ab5ae53289e1ab",
strip_prefix = "FXdiv-561254d968e5679460e6a0a743206410284d9f46",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/Maratyszcza/FXdiv/archive/561254d968e5679460e6a0a743206410284d9f46.zip",
"https://github.com/Maratyszcza/FXdiv/archive/561254d968e5679460e6a0a743206410284d9f46.zip",
],
)

tf_http_archive(
name = "pthreadpool",
build_file = clean_dep("//third_party:pthreadpool.BUILD"),
sha256 = "f894d845cefc091291329712deec85ce7020546f6eaff200b690ae04b6094535",
strip_prefix = "pthreadpool-bfa3b9ce6cb71dc8b792e39d24717320a4f92572",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/Maratyszcza/pthreadpool/archive/bfa3b9ce6cb71dc8b792e39d24717320a4f92572.zip",
"https://github.com/Maratyszcza/pthreadpool/archive/bfa3b9ce6cb71dc8b792e39d24717320a4f92572.zip",
],
)

Expand Down Expand Up @@ -185,12 +202,13 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):
build_file = clean_dep("//third_party:com_google_absl.BUILD"),
# TODO: Remove the patch when https://github.com/abseil/abseil-cpp/issues/326 is resolved
# and when TensorFlow is build against CUDA 10.2
patch_file = clean_dep("//third_party:com_google_absl_fix_mac_and_nvcc_build.patch"),
sha256 = "acd93f6baaedc4414ebd08b33bebca7c7a46888916101d8c0b8083573526d070", # SHARED_ABSL_SHA
strip_prefix = "abseil-cpp-43ef2148c0936ebf7cb4be6b19927a9d9d145b8f",
# Added wasm config patch for code8
patch_file = clean_dep("//third_party:com_google_absl_fix_wasm_config_setting.patch"),
sha256 = "ec8ef47335310cc3382bdc0d0cc1097a001e67dc83fcba807845aa5696e7e1e4", # SHARED_ABSL_SHA
strip_prefix = "abseil-cpp-302b250e1d917ede77b5ff00a6fd9f28430f1563",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/abseil/abseil-cpp/archive/43ef2148c0936ebf7cb4be6b19927a9d9d145b8f.tar.gz",
"https://github.com/abseil/abseil-cpp/archive/43ef2148c0936ebf7cb4be6b19927a9d9d145b8f.tar.gz",
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/abseil/abseil-cpp/archive/302b250e1d917ede77b5ff00a6fd9f28430f1563.tar.gz",
"https://github.com/abseil/abseil-cpp/archive/302b250e1d917ede77b5ff00a6fd9f28430f1563.tar.gz",
],
)

Expand Down
8 changes: 4 additions & 4 deletions third_party/FP16/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ load("//third_party:repo.bzl", "third_party_http_archive")
def repo():
third_party_http_archive(
name = "FP16",
strip_prefix = "FP16-febbb1c163726b5db24bed55cc9dc42529068997",
sha256 = "3e71681e0a67cd28552aa0bbb78ec6a6bd238216df15336dc1326280f7958de2",
strip_prefix = "FP16-3c54eacb74f6f5e39077300c5564156c424d77ba",
sha256 = "0d56bb92f649ec294dbccb13e04865e3c82933b6f6735d1d7145de45da700156",
urls = [
"https://mirror.bazel.build/github.com/Maratyszcza/FP16/archive/febbb1c163726b5db24bed55cc9dc42529068997.tar.gz",
"https://github.com/Maratyszcza/FP16/archive/febbb1c163726b5db24bed55cc9dc42529068997.tar.gz",
"https://mirror.bazel.build/github.com/Maratyszcza/FP16/archive/3c54eacb74f6f5e39077300c5564156c424d77ba.zip",
"https://github.com/Maratyszcza/FP16/archive/3c54eacb74f6f5e39077300c5564156c424d77ba.zip",
],
build_file = "//third_party/FP16:BUILD.bazel",
)
1 change: 0 additions & 1 deletion third_party/FXdiv/BUILD

This file was deleted.

15 changes: 0 additions & 15 deletions third_party/FXdiv/BUILD.bazel

This file was deleted.

15 changes: 0 additions & 15 deletions third_party/FXdiv/workspace.bzl

This file was deleted.

44 changes: 44 additions & 0 deletions third_party/com_google_absl_fix_wasm_config_setting.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
--- ./absl/BUILD.bazel 2020-07-12 14:21:35.000000000 -0700
+++ ./absl/BUILD.bazel 2020-10-20 12:17:37.000000000 -0700
@@ -61,5 +61,5 @@

config_setting(
name = "wasm",
- values = {"cpu": "wasm32"},
+ values = {"cpu": "js"},
)
--- ./absl/time/internal/cctz/BUILD.bazel 2019-09-23 13:20:52.000000000 -0700
+++ ./absl/time/internal/cctz/BUILD.bazel.fixed 2019-09-23 13:20:48.000000000 -0700
@@ -76,15 +76,6 @@
"include/cctz/time_zone.h",
"include/cctz/zone_info_source.h",
],
- linkopts = select({
- ":osx": [
- "-framework Foundation",
- ],
- ":ios": [
- "-framework Foundation",
- ],
- "//conditions:default": [],
- }),
visibility = ["//visibility:public"],
deps = [":civil_time"],
)
--- ./absl/strings/string_view.h 2019-09-23 13:20:52.000000000 -0700
+++ ./absl/strings/string_view.h.fixed 2019-09-23 13:20:48.000000000 -0700
@@ -520,7 +520,14 @@
(std::numeric_limits<difference_type>::max)();

static constexpr size_type CheckLengthInternal(size_type len) {
+#if defined(__NVCC__) && (__CUDACC_VER_MAJOR__<10 || (__CUDACC_VER_MAJOR__==10 && __CUDACC_VER_MINOR__<2)) && !defined(NDEBUG)
+ // An nvcc bug treats the original return expression as a non-constant,
+ // which is not allowed in a constexpr function. This only happens when
+ // NDEBUG is not defined. This will be fixed in the CUDA 10.2 release.
+ return len;
+#else
return ABSL_HARDENING_ASSERT(len <= kMaxSize), len;
+#endif
}

const char* ptr_;
Loading

0 comments on commit c9a8196

Please sign in to comment.