Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,20 @@ build:linux --copt=-w
build:macos --copt=-w

# By default, build TF in C++ 17 mode.
build:linux --cxxopt=-std=c++17
build --cxxopt=-std=c++17
build --host_cxxopt=-std=c++17
build:linux --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=1
build:linux --host_cxxopt=-std=c++17
build:macos --cxxopt=-std=c++17
build:macos --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=1
build:macos --host_cxxopt=-std=c++17

# Disable sframe in assembler to avoid linker errors with gcc 15 (removed for PR compatibility)





# Suppress all warning messages.
build:short_logs --output_filter=DONT_MATCH_ANYTHING

build:macos --macos_minimum_os=10.12

common --noenable_bzlmod
2 changes: 2 additions & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
7.7.0

140 changes: 125 additions & 15 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,58 @@

workspace(name = "struct2tensor")

local_repository(
name = "python_version_repo",
path = "third_party/python_version_repo",
)

local_repository(
name = "python_3_11_host",
path = "third_party/python_3_11_host",
)

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

local_repository(
name = "rules_java",
path = "third_party/rules_java",
)

local_repository(
name = "local_config_cuda",
path = "third_party/local_config_cuda",
)

local_repository(
name = "local_config_tensorrt",
path = "third_party/local_config_tensorrt",
)

local_repository(
name = "local_config_rocm",
path = "third_party/local_config_rocm",
)

local_repository(
name = "local_config_sycl",
path = "third_party/local_config_sycl",
)

local_repository(
name = "tf_wheel_version_suffix",
path = "third_party/tf_wheel_version_suffix",
)

maybe(
http_archive,
name = "platforms",
urls = [
"https://github.com/bazelbuild/platforms/releases/download/0.0.11/platforms-0.0.11.tar.gz",
],
sha256 = "29742e87275809b5e598dc2f04d86960cc7a55b3067d97221c9abbc9926bff0f",
)

load("//tf:tf_configure.bzl", "tf_configure")

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
Expand All @@ -26,23 +78,49 @@ tf_configure(name = "local_config_tf")

#####################################################################################



# ===== Abseil dependency =====
http_archive(
name = "zlib",
build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
sha256 = "17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c",
strip_prefix = "zlib-1.3.1",
urls = ["https://github.com/madler/zlib/archive/v1.3.1.tar.gz"],
name = "com_google_absl",
sha256 = "d1abe9da2003e6cbbd7619b0ced3e52047422f4f4ac6c66a9bef5d2e99fea837",
strip_prefix = "abseil-cpp-d38452e1ee03523a208362186fd42248ff2609f6",
urls = [
"https://github.com/abseil/abseil-cpp/archive/d38452e1ee03523a208362186fd42248ff2609f6.tar.gz",
],
patches = [
"//third_party:abseil_visibility.patch",
],
patch_args = ["-p0"],
)

http_archive(
name = "abseil-cpp",
sha256 = "d1abe9da2003e6cbbd7619b0ced3e52047422f4f4ac6c66a9bef5d2e99fea837",
strip_prefix = "abseil-cpp-d38452e1ee03523a208362186fd42248ff2609f6",
urls = [
"https://github.com/abseil/abseil-cpp/archive/d38452e1ee03523a208362186fd42248ff2609f6.tar.gz",
],
patches = [
"//third_party:abseil_visibility.patch",
],
patch_args = ["-p0"],
)

# ===== Protobuf 4.25.6 dependency =====



# ===== Protobuf 6.31.1 dependency =====
# Must be declared BEFORE TensorFlow's workspaces to override the version they pull
http_archive(
name = "com_google_protobuf",
sha256 = "4e6727bc5d23177edefa3ad86fd2f5a92cd324151636212fd1f7f13aef3fd2b7",
strip_prefix = "protobuf-4.25.6",
sha256 = "6e09bbc950ba60c3a7b30280210cd285af8d7d8ed5e0a6ed101c72aff22e8d88",
strip_prefix = "protobuf-6.31.1",
urls = [
"https://github.com/protocolbuffers/protobuf/archive/v4.25.6.tar.gz",
"https://github.com/protocolbuffers/protobuf/archive/refs/tags/v6.31.1.zip",
],
patches = ["//third_party:protobuf_retain_options.patch"],
patch_args = ["-p1"],
)

# ===== TensorFlow dependency =====
Expand All @@ -60,23 +138,55 @@ http_archive(
# 3. Request the new archive to be mirrored on mirror.bazel.build for more
# reliable downloads.

_TENSORFLOW_GIT_COMMIT = "3c92ac03cab816044f7b18a86eb86aa01a294d95" # tf 2.17.1
_TENSORFLOW_ARCHIVE_SHA256 = "317dd95c4830a408b14f3e802698eb68d70d81c7c7cfcd3d28b0ba023fe84a68"
_TENSORFLOW_GIT_COMMIT = "2.21.0" # tf 2.21.0
_TENSORFLOW_ARCHIVE_SHA256 = "ef3568bb4865d6c1b2564fb5689c19b6b9a5311572cd1f2ff9198636a8520921"

http_archive(
name = "org_tensorflow",
sha256 = _TENSORFLOW_ARCHIVE_SHA256,
urls = [
"https://github.com/tensorflow/tensorflow/archive/%s.tar.gz" % _TENSORFLOW_GIT_COMMIT,
"https://github.com/tensorflow/tensorflow/archive/v%s.tar.gz" % _TENSORFLOW_GIT_COMMIT,
],
strip_prefix = "tensorflow-%s" % _TENSORFLOW_GIT_COMMIT,
patches = ["//third_party:tensorflow.patch"],
patch_args = ["-p1"],
repo_mapping = {
"@abseil-cpp": "@com_google_absl",
},
)

http_archive(
name = "llvm-raw",
sha256 = "3f986184ee126677dbd77edb16d6b82c057ec869fefd7a9871979941e52e837a",
strip_prefix = "llvm-project-909041e4802c4b9a2223ca04099f35bf1dbbd460",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/909041e4802c4b9a2223ca04099f35bf1dbbd460.tar.gz",
"https://github.com/llvm/llvm-project/archive/909041e4802c4b9a2223ca04099f35bf1dbbd460.tar.gz",
],
build_file = "@xla//third_party/llvm:llvm.BUILD",
patches = [
"@xla//third_party/llvm:generated.patch",
"@xla//third_party/llvm:build.patch",
"@xla//third_party/llvm:mathextras.patch",
"@xla//third_party/llvm:toolchains.patch",
"@xla//third_party/llvm:zstd.patch",
"@xla//third_party/llvm:lit_test.patch",
"//third_party:llvm_configure.patch",
],
patch_args = ["-p1"],
)

http_archive(
name = "zlib",
build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
sha256 = "17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c",
strip_prefix = "zlib-1.3.1",
urls = ["https://github.com/madler/zlib/archive/v1.3.1.tar.gz"],
)

load("//third_party:python_configure.bzl", "local_python_configure")
local_python_configure(name = "local_config_python")
local_python_configure(name = "local_execution_config_python")
# load("//third_party:python_configure.bzl", "local_python_configure")
# local_python_configure(name = "local_config_python")
# local_python_configure(name = "local_execution_config_python")


# Please add all new struct2tensor dependencies in workspace.bzl.
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@ def select_constraint(default, nightly=None, git_master=None):
# TODO(b/263060885): Remove the explicit numpy dependency once TF works
# with numpy>=1.24.
'numpy>=1.22',
'protobuf>=4.25.2,<6.0.0;python_version>="3.11"',
'protobuf>=4.21.6,<6.0.0;python_version<"3.11"',
'tensorflow>=2.17,<2.18',
'protobuf>=4.25.2,<7.0.0;python_version>="3.11"',
'protobuf>=4.21.6,<7.0.0;python_version<"3.11"',
'tensorflow>=2.21,<2.22',
'tensorflow-metadata'
+ select_constraint(
default='>=1.17.0,<1.18.0',
nightly='>=1.18.0.dev',
git_master='@git+https://github.com/tensorflow/metadata@master',
),
'pyarrow>=10,<11',
'pyarrow>=14',
],
# Add in any packaged data.
include_package_data=True,
Expand Down
1 change: 1 addition & 0 deletions struct2tensor/kernels/equi_join_any_indices_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ limitations under the License.
// This differs from equi_join_indices in that vectors a,b do not need to be
// monotonically increasing.

#include <cstdint>
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/shape_inference.h"
Expand Down
1 change: 1 addition & 0 deletions struct2tensor/kernels/equi_join_indices_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ limitations under the License.
// Notice that when combined with tf.gather(...), this can be used to do "some"
// sparse_gather operations.

#include <cstdint>
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/shape_inference.h"
Expand Down
1 change: 1 addition & 0 deletions struct2tensor/kernels/parquet/parquet_dataset_kernel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +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.
==============================================================================*/
#include <cstdint>
#include "absl/container/flat_hash_map.h"
#include "struct2tensor/kernels/parquet/parquet_reader.h"
#include "struct2tensor/kernels/parquet/parquet_reader_util.h"
Expand Down
1 change: 1 addition & 0 deletions struct2tensor/kernels/run_length_before_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ limitations under the License.
// b_n := \sum_{i=0}^{n-1} I(a_i=a_n)
// This assumes that for all a_i, a_j, if i <= j, then a_i <= a_j.

#include <cstdint>
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/shape_inference.h"
Expand Down
1 change: 1 addition & 0 deletions struct2tensor/ops/decode_proto_map_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

#include <cstdint>
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/shape_inference.h"

Expand Down
1 change: 1 addition & 0 deletions struct2tensor/ops/decode_proto_sparse_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

#include <cstdint>
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/shape_inference.h"

Expand Down
1 change: 1 addition & 0 deletions struct2tensor/ops/equi_join_any_indices_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

#include <cstdint>
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/shape_inference.h"
Expand Down
1 change: 1 addition & 0 deletions struct2tensor/ops/equi_join_indices_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

#include <cstdint>
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/shape_inference.h"
Expand Down
1 change: 1 addition & 0 deletions struct2tensor/ops/op_kernel_registration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +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.
==============================================================================*/
#include <cstdint>
#include <string>

#include <gtest/gtest.h>
Expand Down
1 change: 1 addition & 0 deletions struct2tensor/ops/parquet_dataset_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +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.
==============================================================================*/
#include <cstdint>
#include "tensorflow/core/framework/common_shape_fns.h"
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/op_def_builder.h"
Expand Down
1 change: 1 addition & 0 deletions struct2tensor/ops/run_length_before_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

#include <cstdint>
#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/shape_inference.h"

Expand Down
7 changes: 7 additions & 0 deletions third_party/abseil_visibility.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
--- absl/base/BUILD.bazel
+++ absl/base/BUILD.bazel
@@ -546,3 +546,3 @@
visibility = [
- "//absl:__subpackages__",
+ "//visibility:public",
],
11 changes: 11 additions & 0 deletions third_party/llvm_configure.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/utils/bazel/configure.bzl
+++ b/utils/bazel/configure.bzl
@@ -53,7 +53,7 @@
name = entry.basename
full_rel_path = rel_dir + "/" + name

- if entry.is_dir:
+ if repository_ctx.execute(["test", "-d", str(entry)]).return_code == 0:
stack.append(full_rel_path)
overlay_dirs[name] = None
else:
5 changes: 5 additions & 0 deletions third_party/local_config_cuda/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
config_setting(
name = "is_cuda_enabled",
values = {"define": "never_match=true"},
visibility = ["//visibility:public"],
)
Empty file.
Empty file.
20 changes: 20 additions & 0 deletions third_party/local_config_cuda/cuda/build_defs.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
def if_cuda_is_configured(x, no_cuda = []):
return no_cuda

def is_cuda_configured():
return False

def if_cuda_newer_than(wanted_ver, if_true, if_false = []):
return if_false

def if_cuda(if_true, if_false = []):
return if_false

def cuda_library(**kwargs):
native.cc_library(**kwargs)

def if_cuda_exec(if_true, if_false = []):
return if_false

def cuda_gpu_architectures():
return []
Empty file.
Empty file.
9 changes: 9 additions & 0 deletions third_party/local_config_rocm/rocm/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cc_library(
name = "hip",
visibility = ["//visibility:public"],
)

cc_library(
name = "rocm_headers",
visibility = ["//visibility:public"],
)
Loading
Loading