[go: nahoru, domu]

Skip to content

Commit

Permalink
Move ABSL, farmhash, and gemmlowp repository macros to their own files.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 359128955
Change-Id: Id3491fe77d17334b051737571e013d0f1747e632
  • Loading branch information
chsigg authored and tensorflower-gardener committed Feb 23, 2021
1 parent f2bcdf5 commit 61d5053
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 40 deletions.
18 changes: 12 additions & 6 deletions tensorflow/lite/tools/make/download_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,23 @@ fi

EIGEN_URL="$(grep -o 'https.*gitlab.com/libeigen/eigen/-/archive/.*tar\.gz' "${BZL_FILE_PATH}" | grep -v mirror.tensorflow | head -n1)"
EIGEN_SHA="$(eval echo $(grep '# SHARED_EIGEN_SHA' "${BZL_FILE_PATH}" | grep -o '\".*\"'))"
GEMMLOWP_URL="$(grep -o 'https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/gemmlowp/.*zip' "${BZL_FILE_PATH}" | head -n1)"
GEMMLOWP_SHA="$(eval echo $(grep '# SHARED_GEMMLOWP_SHA' "${BZL_FILE_PATH}" | grep -o '\".*\"'))"
GEMMLOWP_WORKSPACE_BZL_PATH="third_party/gemmlowp/workspace.bzl"
GEMMLOWP_COMMIT="$(grep -oP 'GEMMLOWP_COMMIT = "\K[0-9a-f]{40}' "${GEMMLOWP_WORKSPACE_BZL_PATH}")"
GEMMLOWP_URL="https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/gemmlowp/archive/"${GEMMLOWP_COMMIT}".zip"
GEMMLOWP_SHA="$(grep -oP 'GEMMLOWP_SHA256 = "\K[0-9a-f]{64}' "${GEMMLOWP_WORKSPACE_BZL_PATH}")"
RUY_URL="https://github.com/google/ruy/archive/4790797d11a81f96baf24f3731fd3ca44c2c5f8b.zip"
RUY_SHA="28331222625e677be004e96da5e9a1cc9d65187d04d70d1ab2ca58445461ecbc"
GOOGLETEST_URL="https://github.com/google/googletest/archive/release-1.8.0.tar.gz"
GOOGLETEST_SHA="58a6f4277ca2bc8565222b3bbd58a177609e9c488e8a72649359ba51450db7d8"
ABSL_URL="$(grep -o 'https://github.com/abseil/abseil-cpp/.*tar.gz' "${BZL_FILE_PATH}" | head -n1)"
ABSL_SHA="$(eval echo $(grep '# SHARED_ABSL_SHA' "${BZL_FILE_PATH}" | grep -o '\".*\"'))"
ABSL_WORKSPACE_BZL_PATH="third_party/absl/workspace.bzl"
ABSL_COMMIT="$(grep -oP 'ABSL_COMMIT = "\K[0-9a-f]{40}' "${ABSL_WORKSPACE_BZL_PATH}")"
ABSL_URL="https://storage.googleapis.com/mirror.tensorflow.org/github.com/abseil/abseil-cpp/archive/"${ABSL_COMMIT}".tar.gz"
ABSL_SHA="$(grep -oP 'ABSL_SHA256 = "\K[0-9a-f]{64}' "${ABSL_WORKSPACE_BZL_PATH}")"
NEON_2_SSE_URL="https://github.com/intel/ARM_NEON_2_x86_SSE/archive/master.zip"
FARMHASH_URL="https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/farmhash/archive/816a4ae622e964763ca0862d9dbd19324a1eaf45.tar.gz"
FARMHASH_SHA="$(eval echo $(grep '# SHARED_FARMHASH_SHA' "${BZL_FILE_PATH}" | grep -o '\".*\"'))"
FARMHASH_WORKSPACE_BZL_PATH="third_party/farmhash/workspace.bzl"
FARMHASH_COMMIT="$(grep -oP 'FARMHASH_COMMIT = "\K[0-9a-f]{40}' "${FARMHASH_WORKSPACE_BZL_PATH}")"
FARMHASH_URL="https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/farmhash/archive/"${FARMHASH_COMMIT}".tar.gz"
FARMHASH_SHA="$(grep -oP 'FARMHASH_SHA256 = "\K[0-9a-f]{64}' "${FARMHASH_WORKSPACE_BZL_PATH}")"
FLATBUFFERS_URL="https://github.com/google/flatbuffers/archive/v1.12.0.tar.gz"
FLATBUFFERS_SHA="62f2223fb9181d1d6338451375628975775f7522185266cd5296571ac152bc45"
FFT2D_URL="https://storage.googleapis.com/mirror.tensorflow.org/www.kurims.kyoto-u.ac.jp/~ooura/fft2d.tgz"
Expand Down
3 changes: 1 addition & 2 deletions tensorflow/opensource_only.files
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ tensorflow/security/fuzzing/tf_fuzzing.bzl
tensorflow/stream_executor/build_defs.bzl
tensorflow/third_party/BUILD
tensorflow/third_party/__init__.py
tensorflow/third_party/absl/com_google_absl.BUILD
tensorflow/third_party/android/BUILD
tensorflow/third_party/android/android.bzl.tpl
tensorflow/third_party/android/android_configure.BUILD.tpl
Expand All @@ -53,7 +54,6 @@ tensorflow/third_party/clang_toolchain/BUILD
tensorflow/third_party/clang_toolchain/cc_configure_clang.bzl
tensorflow/third_party/clang_toolchain/download_clang.bzl
tensorflow/third_party/codegen.BUILD
tensorflow/third_party/com_google_absl.BUILD
tensorflow/third_party/common.bzl
tensorflow/third_party/coremltools.BUILD
tensorflow/third_party/cub.BUILD
Expand Down Expand Up @@ -89,7 +89,6 @@ tensorflow/third_party/eigen3/unsupported/Eigen/CXX11/src/FixedPoint/TypeCasting
tensorflow/third_party/eigen3/unsupported/Eigen/MatrixFunctions
tensorflow/third_party/eigen3/unsupported/Eigen/SpecialFunctions
tensorflow/third_party/enum34.BUILD
tensorflow/third_party/farmhash.BUILD
tensorflow/third_party/fft2d/BUILD
tensorflow/third_party/fft2d/LICENSE
tensorflow/third_party/fft2d/fft.h
Expand Down
38 changes: 6 additions & 32 deletions tensorflow/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ load(
"def_file_filter_configure",
)
load("//third_party/FP16:workspace.bzl", FP16 = "repo")
load("//third_party/absl:workspace.bzl", absl = "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")
load("//third_party/dlpack:workspace.bzl", dlpack = "repo")
load("//third_party/farmhash:workspace.bzl", farmhash = "repo")
load("//third_party/flatbuffers:workspace.bzl", flatbuffers = "repo")
load("//third_party/gemmlowp:workspace.bzl", gemmlowp = "repo")
load("//third_party/hexagon:workspace.bzl", hexagon_nn = "repo")
load("//third_party/highwayhash:workspace.bzl", highwayhash = "repo")
load("//third_party/hwloc:workspace.bzl", hwloc = "repo")
Expand Down Expand Up @@ -185,19 +188,7 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):
],
)

tf_http_archive(
name = "com_google_absl",
build_file = "//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 = "//third_party:com_google_absl_fix_mac_and_nvcc_build.patch",
sha256 = "f368a8476f4e2e0eccf8a7318b98dafbe30b2600f4e3cf52636e5eb145aba06a", # SHARED_ABSL_SHA
strip_prefix = "abseil-cpp-df3ea785d8c30a9503321a3d35ee7d35808f190d",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/abseil/abseil-cpp/archive/df3ea785d8c30a9503321a3d35ee7d35808f190d.tar.gz",
"https://github.com/abseil/abseil-cpp/archive/df3ea785d8c30a9503321a3d35ee7d35808f190d.tar.gz",
],
)
absl("com_google_absl")

tf_http_archive(
name = "eigen_archive",
Expand Down Expand Up @@ -329,26 +320,9 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):
],
)

tf_http_archive(
name = "gemmlowp",
sha256 = "43146e6f56cb5218a8caaab6b5d1601a083f1f31c06ff474a4378a7d35be9cfb", # SHARED_GEMMLOWP_SHA
strip_prefix = "gemmlowp-fda83bdc38b118cc6b56753bd540caa49e570745",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/gemmlowp/archive/fda83bdc38b118cc6b56753bd540caa49e570745.zip",
"https://github.com/google/gemmlowp/archive/fda83bdc38b118cc6b56753bd540caa49e570745.zip",
],
)
gemmlowp("gemmlowp")

tf_http_archive(
name = "farmhash_archive",
build_file = "//third_party:farmhash.BUILD",
sha256 = "6560547c63e4af82b0f202cb710ceabb3f21347a4b996db565a411da5b17aba0", # SHARED_FARMHASH_SHA
strip_prefix = "farmhash-816a4ae622e964763ca0862d9dbd19324a1eaf45",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/farmhash/archive/816a4ae622e964763ca0862d9dbd19324a1eaf45.tar.gz",
"https://github.com/google/farmhash/archive/816a4ae622e964763ca0862d9dbd19324a1eaf45.tar.gz",
],
)
farmhash("farmhash_archive")

tf_http_archive(
name = "png",
Expand Down
Empty file added third_party/absl/BUILD
Empty file.
File renamed without changes.
24 changes: 24 additions & 0 deletions third_party/absl/workspace.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""Provides the repository macro to import absl."""

load("//third_party:repo.bzl", "third_party_http_archive")

def repo(name):
"""Imports absl."""

# Attention: tools parse and update these lines.
ABSL_COMMIT = "df3ea785d8c30a9503321a3d35ee7d35808f190d"
ABSL_SHA256 = "f368a8476f4e2e0eccf8a7318b98dafbe30b2600f4e3cf52636e5eb145aba06a"

third_party_http_archive(
name = name,
sha256 = ABSL_SHA256,
build_file = "//third_party/absl: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 = "//third_party/absl:com_google_absl_fix_mac_and_nvcc_build.patch",
strip_prefix = "abseil-cpp-{commit}".format(commit = ABSL_COMMIT),
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/abseil/abseil-cpp/archive/{commit}.tar.gz".format(commit = ABSL_COMMIT),
"https://github.com/abseil/abseil-cpp/archive/{commit}.tar.gz".format(commit = ABSL_COMMIT),
],
)
Empty file added third_party/farmhash/BUILD
Empty file.
File renamed without changes.
21 changes: 21 additions & 0 deletions third_party/farmhash/workspace.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""Provides the repository macro to import farmhash."""

load("//third_party:repo.bzl", "third_party_http_archive")

def repo(name):
"""Imports farmhash."""

# Attention: tools parse and update these lines.
FARMHASH_COMMIT = "816a4ae622e964763ca0862d9dbd19324a1eaf45"
FARMHASH_SHA256 = "6560547c63e4af82b0f202cb710ceabb3f21347a4b996db565a411da5b17aba0"

third_party_http_archive(
name = name,
build_file = "//third_party/farmhash:farmhash.BUILD",
sha256 = FARMHASH_SHA256,
strip_prefix = "farmhash-{commit}".format(commit = FARMHASH_COMMIT),
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/farmhash/archive/{commit}.tar.gz".format(commit = FARMHASH_COMMIT),
"https://github.com/google/farmhash/archive/{commit}.tar.gz".format(commit = FARMHASH_COMMIT),
],
)
Empty file added third_party/gemmlowp/BUILD
Empty file.
20 changes: 20 additions & 0 deletions third_party/gemmlowp/workspace.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""Provides the repository macro to import gemmlowp."""

load("//third_party:repo.bzl", "tf_http_archive")

def repo(name):
"""Imports gemmlowp."""

# Attention: tools parse and update these lines.
GEMMLOWP_COMMIT = "fda83bdc38b118cc6b56753bd540caa49e570745"
GEMMLOWP_SHA256 = "43146e6f56cb5218a8caaab6b5d1601a083f1f31c06ff474a4378a7d35be9cfb"

tf_http_archive(
name = name,
sha256 = GEMMLOWP_SHA256,
strip_prefix = "gemmlowp-{commit}".format(commit = GEMMLOWP_COMMIT),
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/gemmlowp/archive/{commit}.zip".format(commit = GEMMLOWP_COMMIT),
"https://github.com/google/gemmlowp/archive/{commit}.zip".format(commit = GEMMLOWP_COMMIT),
],
)

0 comments on commit 61d5053

Please sign in to comment.