Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
zoranjovanovic-ns committed May 3, 2024
2 parents 291a0ab + 1f31a95 commit 17d2f6e
Show file tree
Hide file tree
Showing 2,247 changed files with 64,441 additions and 37,414 deletions.
29 changes: 17 additions & 12 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ build:cuda_clang_official --action_env=CUDA_TOOLKIT_PATH="/usr/local/cuda-12.3"
build:cuda_clang_official --action_env=GCC_HOST_COMPILER_PATH="/dt9/usr/bin/gcc"
build:cuda_clang_official --action_env=CLANG_CUDA_COMPILER_PATH="/usr/lib/llvm-17/bin/clang"
build:cuda_clang_official --action_env=LD_LIBRARY_PATH="/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"
build:cuda_clang_official --crosstool_top="@sigbuild-r2.16-clang_config_cuda//crosstool:toolchain"
build:cuda_clang_official --crosstool_top="@sigbuild-r2.17-clang_config_cuda//crosstool:toolchain"

# Build with nvcc for CUDA and clang for host
build:nvcc_clang --config=cuda
Expand Down Expand Up @@ -293,6 +293,11 @@ build:rocm --define=using_rocm_hipcc=true
build:rocm --define=tensorflow_mkldnn_contraction_kernel=0
build:rocm --repo_env TF_NEED_ROCM=1

build:sycl --crosstool_top=@local_config_sycl//crosstool:toolchain
build:sycl --define=using_sycl=true
build:sycl --define=tensorflow_mkldnn_contraction_kernel=0
build:sycl --repo_env TF_NEED_SYCL=1

# Options to disable default on features
build:noaws --define=no_aws_support=true
build:nogcp --define=no_gcp_support=true
Expand Down Expand Up @@ -497,12 +502,12 @@ build:rbe_linux --host_linkopt=-lm

build:rbe_linux_cpu --config=rbe_linux
# Linux cpu and cuda builds share the same toolchain now.
build:rbe_linux_cpu --host_crosstool_top="@sigbuild-r2.16-clang_config_cuda//crosstool:toolchain"
build:rbe_linux_cpu --crosstool_top="@sigbuild-r2.16-clang_config_cuda//crosstool:toolchain"
build:rbe_linux_cpu --extra_toolchains="@sigbuild-r2.16-clang_config_cuda//crosstool:toolchain-linux-x86_64"
build:rbe_linux_cpu --extra_execution_platforms="@sigbuild-r2.16-clang_config_platform//:platform"
build:rbe_linux_cpu --host_platform="@sigbuild-r2.16-clang_config_platform//:platform"
build:rbe_linux_cpu --platforms="@sigbuild-r2.16-clang_config_platform//:platform"
build:rbe_linux_cpu --host_crosstool_top="@sigbuild-r2.17-clang_config_cuda//crosstool:toolchain"
build:rbe_linux_cpu --crosstool_top="@sigbuild-r2.17-clang_config_cuda//crosstool:toolchain"
build:rbe_linux_cpu --extra_toolchains="@sigbuild-r2.17-clang_config_cuda//crosstool:toolchain-linux-x86_64"
build:rbe_linux_cpu --extra_execution_platforms="@sigbuild-r2.17-clang_config_platform//:platform"
build:rbe_linux_cpu --host_platform="@sigbuild-r2.17-clang_config_platform//:platform"
build:rbe_linux_cpu --platforms="@sigbuild-r2.17-clang_config_platform//:platform"
# This is needed for all Clang17 builds but must not be present in GCC builds.
build:rbe_linux_cpu --copt=-Wno-error=unused-command-line-argument
# This was added in clang-16 by https://reviews.llvm.org/D133574.
Expand All @@ -511,7 +516,7 @@ build:rbe_linux_cpu --copt=-Wno-error=unused-command-line-argument
# See https://github.com/protocolbuffers/upb/blob/9effcbcb27f0a665f9f345030188c0b291e32482/upb/upb.c#L183.
build:rbe_linux_cpu --copt=-Wno-gnu-offsetof-extensions
# Python config is the same across all containers because the binary is the same
build:rbe_linux_cpu --repo_env=TF_PYTHON_CONFIG_REPO="@sigbuild-r2.16-clang_config_python"
build:rbe_linux_cpu --repo_env=TF_PYTHON_CONFIG_REPO="@sigbuild-r2.17-clang_config_python"
build:rbe_linux_cpu --python_path="/usr/bin/python3"
# These you may need to change for your own GCP project.
common:rbe_linux_cpu --remote_instance_name=projects/tensorflow-testing/instances/default_instance
Expand All @@ -532,9 +537,9 @@ build:rbe_linux_cuda --config=cuda_clang_official
build:rbe_linux_cuda --config=rbe_linux_cpu
# For Remote build execution -- GPU configuration
build:rbe_linux_cuda --repo_env=REMOTE_GPU_TESTING=1
build:rbe_linux_cuda --repo_env=TF_CUDA_CONFIG_REPO="@sigbuild-r2.16-clang_config_cuda"
build:rbe_linux_cuda --repo_env=TF_TENSORRT_CONFIG_REPO="@sigbuild-r2.16-clang_config_tensorrt"
build:rbe_linux_cuda --repo_env=TF_NCCL_CONFIG_REPO="@sigbuild-r2.16-clang_config_nccl"
build:rbe_linux_cuda --repo_env=TF_CUDA_CONFIG_REPO="@sigbuild-r2.17-clang_config_cuda"
build:rbe_linux_cuda --repo_env=TF_TENSORRT_CONFIG_REPO="@sigbuild-r2.17-clang_config_tensorrt"
build:rbe_linux_cuda --repo_env=TF_NCCL_CONFIG_REPO="@sigbuild-r2.17-clang_config_nccl"
test:rbe_linux_cuda --test_env=LD_LIBRARY_PATH="/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"

build:rbe_linux_cuda_nvcc --config=rbe_linux_cuda
Expand Down Expand Up @@ -639,7 +644,7 @@ test:release_linux_base --test_summary=short

# Use the Clang toolchain to compile
build:release_cpu_linux --config=release_linux_base
build:release_cpu_linux --crosstool_top="@sigbuild-r2.16-clang_config_cuda//crosstool:toolchain"
build:release_cpu_linux --crosstool_top="@sigbuild-r2.17-clang_config_cuda//crosstool:toolchain"

build:release_gpu_linux --config=release_cpu_linux
# Set up compilation CUDA version and paths and use the CUDA Clang toolchain.
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/update-rbe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,18 @@ jobs:
map sigbuild-r2.16-clang-python3.10 2.16-python3.10
map sigbuild-r2.16-clang-python3.11 2.16-python3.11
map sigbuild-r2.16-clang-python3.12 2.16-python3.12
# TF 2.17
map sigbuild-r2.17 2.17-python3.11
map sigbuild-r2.17-python3.9 2.17-python3.9
map sigbuild-r2.17-python3.10 2.17-python3.10
map sigbuild-r2.17-python3.11 2.17-python3.11
map sigbuild-r2.17-python3.12 2.17-python3.12
# TF 2.17 + Clang (containers are the same, but env vars in configs.bzl are different)
map sigbuild-r2.17-clang 2.17-python3.11
map sigbuild-r2.17-clang-python3.9 2.17-python3.9
map sigbuild-r2.17-clang-python3.10 2.17-python3.10
map sigbuild-r2.17-clang-python3.11 2.17-python3.11
map sigbuild-r2.17-clang-python3.12 2.17-python3.12
- name: Create Pull Request with changes
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 # v4.2.3
with:
Expand Down
16 changes: 16 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@
built with support for a given CPU target. This can be useful for skipping
target-specific tests if a target is not supported.

* `tf.data`
* Support `data.experimental.distribued_save`. `distribued_save` uses
tf.data service
(https://www.tensorflow.org/api_docs/python/tf/data/experimental/service)
to write distributed dataset snapshots. The call is non-blocking and
returns without waiting for the snapshot to finish. Setting `wait=True` to
`tf.data.Dataset.load` allows the snapshots to be read while they are
being written.

### Bug Fixes and Other Changes

* <SIMILAR TO ABOVE SECTION, BUT FOR OTHER IMPORTANT CHANGES / BUG FIXES>
Expand All @@ -79,6 +88,13 @@
`experimental_default_delegate_latest_features` to enable all default
delegate features.

* `tf.data`
* Add `wait` to `tf.data.Dataset.load`. If `True`, for snapshots written
with `distributed_save`, it reads the snapshot while it is being written.
For snapshots written with regular `save`, it waits for the snapshot until
it's finished. The default is `False` for backward compatibility. Users of
`distributed_save` are recommended to set it to `True`.

## Thanks to our Contributors

This release contains contributions from many people at Google, as well as:
Expand Down
9 changes: 9 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

workspace(name = "org_tensorflow")

# buildifier: disable=load-on-top

# We must initialize hermetic python first.
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

Expand All @@ -14,13 +16,20 @@ http_archive(
],
)

http_archive(
name = "rules_java",
sha256 = "c73336802d0b4882e40770666ad055212df4ea62cfa6edf9cb0f9d29828a0934",
url = "https://github.com/bazelbuild/rules_java/releases/download/5.3.5/rules_java-5.3.5.tar.gz",
)

http_archive(
name = "rules_python",
sha256 = "9d04041ac92a0985e344235f5d946f71ac543f1b1565f2cdbc9a2aaee8adf55b",
strip_prefix = "rules_python-0.26.0",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.26.0/rules_python-0.26.0.tar.gz",
)

# buildifier: disable=same-origin-load
load("@rules_python//python:repositories.bzl", "py_repositories")

py_repositories()
Expand Down
3 changes: 3 additions & 0 deletions ci/official/requirements_updater/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

workspace(name = "requirements_updater")

# buildifier: disable=load-on-top

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

http_archive(
Expand All @@ -20,6 +22,7 @@ http_archive(
url = "https://github.com/bazelbuild/rules_python/releases/download/0.26.0/rules_python-0.26.0.tar.gz",
)

# buildifier: disable=same-origin-load
load("@rules_python//python:repositories.bzl", "py_repositories")

py_repositories()
Expand Down
3 changes: 3 additions & 0 deletions ci/official/wheel_test/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

workspace(name = "wheel_test")

# buildifier: disable=load-on-top

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

http_archive(
Expand All @@ -20,6 +22,7 @@ http_archive(
url = "https://github.com/bazelbuild/rules_python/releases/download/0.26.0/rules_python-0.26.0.tar.gz",
)

# buildifier: disable=same-origin-load
load("@rules_python//python:repositories.bzl", "py_repositories")

py_repositories()
Expand Down
4 changes: 2 additions & 2 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -892,8 +892,8 @@ def set_clang_compiler_path_win(environ_cp):
)

write_action_env_to_bazelrc('CLANG_COMPILER_PATH', clang_compiler_path)
write_to_bazelrc('build --repo_env=CC=%s' % clang_compiler_path)
write_to_bazelrc('build --repo_env=BAZEL_COMPILER=%s' % clang_compiler_path)
write_to_bazelrc(f'build --repo_env=CC="{clang_compiler_path}"')
write_to_bazelrc(f'build --repo_env=BAZEL_COMPILER="{clang_compiler_path}"')

return clang_compiler_path

Expand Down
6 changes: 3 additions & 3 deletions requirements_lock_3_10.txt
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ h5py==3.10.0 \
# via
# -r requirements.in
# keras-nightly
idna==3.6 \
--hash=sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca \
--hash=sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f
idna==3.7 \
--hash=sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc \
--hash=sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0
# via requests
jax==0.4.7 \
--hash=sha256:5e7002d74db25f97c99b979d4ba1233b1ef26e1597e5fc468ad11d1c8a9dc4f8
Expand Down
6 changes: 3 additions & 3 deletions requirements_lock_3_11.txt
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ h5py==3.10.0 \
# via
# -r requirements.in
# keras-nightly
idna==3.6 \
--hash=sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca \
--hash=sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f
idna==3.7 \
--hash=sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc \
--hash=sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0
# via requests
jax==0.4.7 \
--hash=sha256:5e7002d74db25f97c99b979d4ba1233b1ef26e1597e5fc468ad11d1c8a9dc4f8
Expand Down
6 changes: 3 additions & 3 deletions requirements_lock_3_12.txt
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ h5py==3.10.0 \
# via
# -r requirements.in
# keras-nightly
idna==3.6 \
--hash=sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca \
--hash=sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f
idna==3.7 \
--hash=sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc \
--hash=sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0
# via requests
jax==0.4.7 \
--hash=sha256:5e7002d74db25f97c99b979d4ba1233b1ef26e1597e5fc468ad11d1c8a9dc4f8
Expand Down
6 changes: 3 additions & 3 deletions requirements_lock_3_9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ h5py==3.10.0 \
# via
# -r requirements.in
# keras-nightly
idna==3.6 \
--hash=sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca \
--hash=sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f
idna==3.7 \
--hash=sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc \
--hash=sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0
# via requests
importlib-metadata==7.0.1 \
--hash=sha256:4805911c3a4ec7c3966410053e9ec6a1fecd629117df5adee56dfc9432a1081e \
Expand Down
4 changes: 3 additions & 1 deletion tensorflow/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,7 @@ package_group(
"//third_party/py/keras/...",
"//third_party/py/tf_keras/...",
"//third_party/yggdrasil_decision_forests/...",
"//waymo/accelerator/...",
"//waymo/ml/cn/...",
"//waymo/ml/models/...",
],
Expand Down Expand Up @@ -1116,9 +1117,10 @@ bzl_library(
"@local_config_cuda//cuda:build_defs_bzl",
"@local_config_rocm//rocm:build_defs_bzl",
"@local_config_tensorrt//:build_defs_bzl",
"@local_tsl//tsl:tsl_bzl",
"@local_tsl//tsl/platform/default:cuda_build_defs_bzl",
"@local_xla//xla/tsl:tsl_bzl",
"@local_xla//xla/tsl/mkl:build_defs_bzl",
"@rules_java//java:rules",
],
)

Expand Down
28 changes: 14 additions & 14 deletions tensorflow/c/c_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void TF_CloseDeprecatedSession(TF_DeprecatedSession* s, TF_Status* status) {
}

void TF_DeleteDeprecatedSession(TF_DeprecatedSession* s, TF_Status* status) {
status->status = ::tensorflow::OkStatus();
status->status = absl::OkStatus();
if (s == nullptr) return;
delete s->session;
delete s;
Expand Down Expand Up @@ -352,7 +352,7 @@ bool ExtendSessionGraphHelper(TF_Session* session, TF_Status* status) {

static void TF_Run_Setup(int noutputs, TF_Tensor** c_outputs,
TF_Status* status) {
status->status = ::tensorflow::OkStatus();
status->status = absl::OkStatus();
for (int i = 0; i < noutputs; ++i) {
c_outputs[i] = nullptr;
}
Expand Down Expand Up @@ -388,9 +388,9 @@ static Status TF_TensorToTensorV1(const TF_Tensor* src, Tensor* dst) {
return InvalidArgument(
"Malformed TF_RESOURCE tensor: unable to parse resource handle");
}
return ::tensorflow::OkStatus();
return absl::OkStatus();
}
return ::tensorflow::OkStatus();
return absl::OkStatus();
}

static bool TF_Run_Inputs(TF_Tensor* const* c_inputs,
Expand Down Expand Up @@ -959,7 +959,7 @@ void TF_SetAttrTensorShapeProto(TF_OperationDescription* desc,
TensorShapeProto shape;
if (shape.ParseFromArray(proto, static_cast<int>(proto_len))) {
desc->node_builder.Attr(attr_name, shape);
status->status = ::tensorflow::OkStatus();
status->status = absl::OkStatus();
} else {
status->status = InvalidArgument("Unparseable TensorShapeProto");
}
Expand All @@ -986,7 +986,7 @@ void TF_SetAttrTensorShapeProtoList(TF_OperationDescription* desc,
}
}
desc->node_builder.Attr(attr_name, shapes);
status->status = ::tensorflow::OkStatus();
status->status = absl::OkStatus();
}

void TF_SetAttrTensor(TF_OperationDescription* desc, const char* attr_name,
Expand All @@ -999,7 +999,7 @@ void TF_SetAttrTensor(TF_OperationDescription* desc, const char* attr_name,
void TF_SetAttrTensorList(TF_OperationDescription* desc, const char* attr_name,
TF_Tensor* const* values, int num_values,
TF_Status* status) {
status->status = ::tensorflow::OkStatus();
status->status = absl::OkStatus();
std::vector<Tensor> t;
t.reserve(num_values);

Expand Down Expand Up @@ -1037,7 +1037,7 @@ void TF_SetAttrValueProto(TF_OperationDescription* desc, const char* attr_name,
desc->node_builder.Attr(attr_name, std::move(attr_value));
}

status->status = ::tensorflow::OkStatus();
status->status = absl::OkStatus();
}

TF_Operation* TF_FinishOperationLocked(TF_OperationDescription* desc,
Expand Down Expand Up @@ -1552,7 +1552,7 @@ void TF_OperationGetAttrName(TF_Operation* oper, int i, char* output,
for (it = attrs.begin(); it != attrs.end(); it++) {
if (count == i) {
strncpy(output, it->first.c_str(), it->first.length());
status->status = ::tensorflow::OkStatus();
status->status = absl::OkStatus();
return;
}
count++;
Expand Down Expand Up @@ -1931,7 +1931,7 @@ Status CopyGraph(Graph* src_graph, Graph* dst_graph,
for (const auto& pair : results.return_tensors) {
return_nodes->emplace_back(pair.first, pair.second);
}
return ::tensorflow::OkStatus();
return absl::OkStatus();
}

bool ValidateConstWhileParams(const TF_WhileParams& params, TF_Status* s) {
Expand Down Expand Up @@ -2063,7 +2063,7 @@ void TF_FinishWhileHelper(const TF_WhileParams* params, TF_Status* status,
scope.impl()->control_deps(), &params->cond_output,
/* nreturn_nodes */ 1, &cond_output));
*output = cond_output[0];
return ::tensorflow::OkStatus();
return absl::OkStatus();
};

// 'body_fn' copies the body graph into the parent graph.
Expand All @@ -2078,7 +2078,7 @@ void TF_FinishWhileHelper(const TF_WhileParams* params, TF_Status* status,
&parent->refiner, params->body_inputs, inputs,
scope.impl()->name(), scope.impl()->control_deps(),
params->body_outputs, num_loop_vars, outputs));
return ::tensorflow::OkStatus();
return absl::OkStatus();
};

// Create the while loop using an internal scope.
Expand Down Expand Up @@ -2312,7 +2312,7 @@ void TF_CloseSession(TF_Session* s, TF_Status* status) {
}

void TF_DeleteSession(TF_Session* s, TF_Status* status) {
status->status = ::tensorflow::OkStatus();
status->status = absl::OkStatus();
if (s == nullptr) return;
TF_Graph* const graph = s->graph;
if (graph != nullptr) {
Expand Down Expand Up @@ -2472,7 +2472,7 @@ TF_ApiDefMap* TF_NewApiDefMap(TF_Buffer* op_list_buffer, TF_Status* status) {
status->status = InvalidArgument("Unparseable OpList");
return nullptr;
}
status->status = ::tensorflow::OkStatus();
status->status = absl::OkStatus();
return new TF_ApiDefMap(op_list);
}

Expand Down
2 changes: 1 addition & 1 deletion tensorflow/c/c_api_experimental.cc
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ TFE_TensorHandle* TFE_NewTensorHandleFromScalar(TF_DataType data_type,
tensorflow::Tensor tensor(dtype, tensorflow::TensorShape({}));
std::memcpy(tensorflow::TensorCApi::Buffer(tensor)->data(), data, len);

status->status = ::tensorflow::OkStatus();
status->status = absl::OkStatus();
return tensorflow::wrap(tensorflow::TensorHandle::CreateLocalHandle(tensor));
}

Expand Down
Loading

0 comments on commit 17d2f6e

Please sign in to comment.