Skip to content

Commit

Permalink
Merge branch 'master' into tenglu/gen_onednn_version
Browse files Browse the repository at this point in the history
  • Loading branch information
Lu Teng committed May 6, 2024
2 parents e928f99 + a81aac2 commit 36eb24a
Show file tree
Hide file tree
Showing 6,344 changed files with 263,661 additions and 162,913 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
158 changes: 105 additions & 53 deletions .bazelrc

Large diffs are not rendered by default.

7 changes: 1 addition & 6 deletions .github/workflows/arm-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,10 @@ jobs:
build:
if: github.repository == 'tensorflow/tensorflow' # Don't do this in forks
runs-on: [self-hosted, linux, ARM64]
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
pyver: ['3.9', '3.10']
experimental: [false]
include:
- pyver: '3.11'
experimental: true
pyver: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Stop old running containers (if any)
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/arm-ci-extended.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
strategy:
fail-fast: false
matrix:
pyver: ['3.9', '3.10', '3.11']
pyver: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Stop old running containers (if any)
shell: bash
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/update-rbe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,25 @@ 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:
title: Update the RBE images to the latest container versions
committer: TensorFlow Release Automation <[email protected]>
token: ${{ secrets.JENKINS_TOKEN }}
reviewers: angerson,mihaimaruseac,learning-to-play,nitins17
reviewers: mihaimaruseac,learning-to-play,nitins17
body: |
This PR was created by a GitHub Actions workflow to update all the SIG Build-based RBE containers to the most recent containers. See:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Before sending your pull requests, make sure you do the following:

In a graphical form, the entire lifetime of a PR looks like

![image](https://user-images.githubusercontent.com/323199/229561784-0a2f5509-b731-493f-ad88-bad487688c8d.png)
![image](https://github.com/tensorflow/tensorflow/assets/52792999/3eea4ca5-daa0-4570-b0b5-2a2b03a724a3)

### Contributor License Agreements

Expand Down
68 changes: 65 additions & 3 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
* <IF A CHANGE CLOSES A GITHUB ISSUE, IT SHOULD BE DOCUMENTED HERE>
* <NOTES SHOULD BE GROUPED PER AREA>

* GPU
* Support for NVIDIA GPUs with compute capability 8.9 (e.g. L4 & L40) has
been added to TF binary distributions (Python wheels).
* Replace `DebuggerOptions` of TensorFlow Quantizer, and migrate to
`DebuggerConfig` of StableHLO Quantizer.

## Keras

<INSERT SMALL BLURB ABOUT RELEASE FOCUS AREA AND POTENTIAL TOOLCHAIN CHANGES>
Expand All @@ -34,6 +40,9 @@

* <DOCUMENT BREAKING CHANGES HERE>
* <THIS SECTION SHOULD CONTAIN API, ABI AND BEHAVIORAL BREAKING CHANGES>
* GPU
* Support for NVIDIA GPUs with compute capability 5.x (Maxwell generation)
has been removed from TF binary distributions (Python wheels).

### Known Caveats

Expand All @@ -46,6 +55,19 @@
* <INSERT MAJOR FEATURE HERE, USING MARKDOWN SYNTAX>
* <IF RELEASE CONTAINS MULTIPLE FEATURES FROM SAME AREA, GROUP THEM TOGETHER>

* Add `is_cpu_target_available`, which indicates whether or not TensorFlow was
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 @@ -59,6 +81,26 @@
schema globally in the converter and inference engine. The new behaviour
can be disabled via experimental
flag `converter._experimental_disable_per_channel_quantization_for_dense_layers = True`.
* C API:
* The experimental `TfLiteRegistrationExternal` type has been renamed as
`TfLiteOperator`, and likewise for the corresponding API functions.
* The Python TF Lite Interpreter bindings now have an option
`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`.

* `tf.tpu.experimental.embedding.TPUEmbeddingV2`
* Add `compute_sparse_core_stats` for sparse core users to profile the
data with this API to get the `max_ids` and `max_unique_ids`. These
numbers will be needed to configure the sparse core embedding mid level
api.
* Remove the `preprocess_features` method since that's no longer needed.

## Thanks to our Contributors

Expand Down Expand Up @@ -118,8 +160,9 @@ This release contains contributions from many people at Google, as well as:
keras
* **Apple Silicon users:** If you previously installed TensorFlow using
`pip install tensorflow-macos`, please update your installation method. Use
`pip install tensorflow` from now on. Starting with TF 2.17, the
`tensorflow-macos` package will no longer receive updates.
`pip install tensorflow` from now on.
* **Mac x86 users:** Mac x86 builds are being deprecated and will no longer be
released as a Pip package from TF 2.17 onwards.

### Known Caveats

Expand Down Expand Up @@ -154,6 +197,25 @@ This release contains contributions from many people at Google, as well as:
* Added support for `stablehlo.maximum`.
* Added support for `stablehlo.minimum`.
* Added boolean parameter support for `tfl.gather_nd`.
* C API:
* New API functions:
* `tensorflow/lite/c/c_api_experimental.h`:
* `TfLiteInterpreterGetVariableTensorCount`
* `TfLiteInterpreterGetVariableTensor`
* `TfLiteInterpreterGetBufferHandle`
* `TfLiteInterpreterSetBufferHandle`
* `tensorflow/lite/c/c_api_opaque.h`:
* `TfLiteOpaqueTensorSetAllocationTypeToDynamic`
* API functions promoted from experimental to stable:
* `tensorflow/lite/c/c_api.h`:
* `TfLiteInterpreterOptionsEnableCancellation`
* `TfLiteInterpreterCancel`
* C++ API:
* New virtual methods in the `tflite::SimpleDelegateInterface` class in `tensorflow/lite/delegates/utils/simple_delegate.h`,
and likewise in the `tflite::SimpleOpaqueDelegateInterface` class in `tensorflow/lite/delegates/utils/simple_opaque_delegate.h`:
* `CopyFromBufferHandle`
* `CopyToBufferHandle`
* `FreeBufferHandle`

* `tf.train.CheckpointOptions` and `tf.saved_model.SaveOptions`
* These now take in a new argument called `experimental_sharding_callback`.
Expand Down Expand Up @@ -229,7 +291,7 @@ This release contains contributions from many people at Google, as well as:

This release contains contributions from many people at Google, as well as:

<INSERT>, <NAME>, <HERE>, <USING>, <GITHUB>, <HANDLE>
RoboTux, <INSERT>, <NAME>, <HERE>, <USING>, <GITHUB>, <HANDLE>

# Release 2.15.0.post1

Expand Down
13 changes: 12 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# buildifier: disable=load-on-top

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 @@ -12,18 +16,25 @@ 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()

load("@rules_python//python:repositories.bzl", "python_register_toolchains")
load("@rules_python//python:repositories.bzl", "python_register_toolchains") # buildifier: disable=same-origin-load
load(
"//tensorflow/tools/toolchains/python:python_repo.bzl",
"python_repository",
Expand Down
1 change: 1 addition & 0 deletions ci/official/envs/ci_default
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,6 @@ TFCI_PYTHON_VERSION=
TFCI_WHL_AUDIT_ENABLE=
TFCI_WHL_AUDIT_PLAT=
TFCI_WHL_BAZEL_TEST_ENABLE=
TFCI_WHL_IMPORT_TEST_ENABLE=1
TFCI_WHL_SIZE_LIMIT=
TFCI_WHL_SIZE_LIMIT_ENABLE=
1 change: 1 addition & 0 deletions ci/official/envs/linux_x86_tpu
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ TFCI_BAZEL_TARGET_SELECTING_CONFIG_PREFIX=linux_tpu
TFCI_BUILD_PIP_PACKAGE_ARGS="--repo_env=WHEEL_NAME=tensorflow_tpu"
TFCI_LIB_SUFFIX="-tpu-linux-x86_64"
TFCI_WHL_BAZEL_TEST_ENABLE=0
TFCI_WHL_IMPORT_TEST_ENABLE=0
TFCI_WHL_SIZE_LIMIT=580M
TFCI_PYTHON_VERIFY_PIP_INSTALL_ARGS="-f https://storage.googleapis.com/libtpu-tf-releases/index.html"
2 changes: 1 addition & 1 deletion ci/official/requirements_updater/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
# limitations under the License.
# ==============================================================================

load("@python//3.9:defs.bzl", compile_pip_requirements_3_9 = "compile_pip_requirements")
load("@python//3.10:defs.bzl", compile_pip_requirements_3_10 = "compile_pip_requirements")
load("@python//3.11:defs.bzl", compile_pip_requirements_3_11 = "compile_pip_requirements")
load("@python//3.12:defs.bzl", compile_pip_requirements_3_12 = "compile_pip_requirements")
load("@python//3.9:defs.bzl", compile_pip_requirements_3_9 = "compile_pip_requirements")
load("@updater_config_repository//:updater_config_repository.bzl", "REQUIREMENTS_FILE_NAME")

compile_pip_requirements_3_9(
Expand Down
7 changes: 6 additions & 1 deletion ci/official/requirements_updater/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# buildifier: disable=load-on-top

workspace(name = "requirements_updater")

# buildifier: disable=load-on-top

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

http_archive(
Expand All @@ -18,11 +22,12 @@ 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()

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

default_python_version = "3.10"
Expand Down
12 changes: 6 additions & 6 deletions ci/official/utilities/code_check_full.bats
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ EOF

@test "Pip package generated license includes all dependencies' licenses" {
do_external_licenses_check \
"//tensorflow/tools/pip_package:build_pip_package" \
"//tensorflow/tools/pip_package:wheel" \
"//tensorflow/tools/pip_package:licenses"
}

Expand Down Expand Up @@ -172,7 +172,7 @@ EOF

# Get the full list of files and targets which get included into the pip
# package
bazel cquery --keep_going 'deps(//tensorflow/tools/pip_package:build_pip_package)' | sort -u > $BATS_TEST_TMPDIR/pip_deps
bazel cquery --keep_going 'deps(//tensorflow/tools/pip_package:wheel)' | sort -u > $BATS_TEST_TMPDIR/pip_deps
# Find all Python py_test targets not tagged "no_pip" or "manual", excluding
# any targets in ignored packages. Combine this list of targets into a bazel
# query list (e.g. the list becomes "target+target2+target3")
Expand Down Expand Up @@ -215,7 +215,7 @@ EOF
bazel cquery \
--experimental_cc_shared_library \
--@local_config_cuda//:enable_cuda \
"somepath(//tensorflow/tools/pip_package:build_pip_package, " \
"somepath(//tensorflow/tools/pip_package:wheel, " \
"@local_config_cuda//cuda:cudart + "\
"@local_config_cuda//cuda:cudart + "\
"@local_config_cuda//cuda:cuda_driver + "\
Expand All @@ -225,7 +225,7 @@ EOF
"@local_config_tensorrt//:tensorrt)" --keep_going > $BATS_TEST_TMPDIR/out

cat <<EOF
There was a path found connecting //tensorflow/tools/pip_package:build_pip_package
There was a path found connecting //tensorflow/tools/pip_package:wheel
to a banned CUDA dependency. Here's the output from bazel query:
EOF
cat $BATS_TEST_TMPDIR/out
Expand All @@ -237,7 +237,7 @@ EOF
--experimental_cc_shared_library \
--@local_config_cuda//:enable_cuda \
--define framework_shared_object=false \
"somepath(//tensorflow/tools/pip_package:build_pip_package, " \
"somepath(//tensorflow/tools/pip_package:wheel, " \
"@local_config_cuda//cuda:cudart + "\
"@local_config_cuda//cuda:cudart + "\
"@local_config_cuda//cuda:cuda_driver + "\
Expand All @@ -247,7 +247,7 @@ EOF
"@local_config_tensorrt//:tensorrt)" --keep_going > $BATS_TEST_TMPDIR/out

cat <<EOF
There was a path found connecting //tensorflow/tools/pip_package:build_pip_package
There was a path found connecting //tensorflow/tools/pip_package:wheel
to a banned CUDA dependency when '--define framework_shared_object=false' is set.
This means that a CUDA target was probably included via an is_static condition,
used when targeting platforms like Windows where we build statically instead
Expand Down
6 changes: 4 additions & 2 deletions ci/official/utilities/rename_and_verify_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ venv=$(mktemp -d)
"python${TFCI_PYTHON_VERSION}" -m venv "$venv"
python="$venv/bin/python3"
"$python" -m pip install *.whl $TFCI_PYTHON_VERIFY_PIP_INSTALL_ARGS
"$python" -c 'import tensorflow as tf; t1=tf.constant([1,2,3,4]); t2=tf.constant([5,6,7,8]); print(tf.add(t1,t2).shape)'
"$python" -c 'import sys; import tensorflow as tf; sys.exit(0 if "keras" in tf.keras.__name__ else 1)'
if [[ "$TFCI_WHL_IMPORT_TEST_ENABLE" == "1" ]]; then
"$python" -c 'import tensorflow as tf; t1=tf.constant([1,2,3,4]); t2=tf.constant([5,6,7,8]); print(tf.add(t1,t2).shape)'
"$python" -c 'import sys; import tensorflow as tf; sys.exit(0 if "keras" in tf.keras.__name__ else 1)'
fi
# VERY basic check to ensure the [and-cuda] package variant is installable.
# Checks TFCI_BAZEL_COMMON_ARGS for "gpu" or "cuda", implying that the test is
# relevant. All of the GPU test machines have CUDA installed via other means,
Expand Down
2 changes: 1 addition & 1 deletion ci/official/wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if [[ "$TFCI_NIGHTLY_UPDATE_VERSION_ENABLE" == 1 ]]; then
export TFCI_BUILD_PIP_PACKAGE_ARGS="$(echo $TFCI_BUILD_PIP_PACKAGE_ARGS | sed 's/tensorflow/tf_nightly/')"
fi

tfrun bazel build $TFCI_BAZEL_COMMON_ARGS //tensorflow/tools/pip_package/v2:wheel $TFCI_BUILD_PIP_PACKAGE_ARGS
tfrun bazel build $TFCI_BAZEL_COMMON_ARGS //tensorflow/tools/pip_package:wheel $TFCI_BUILD_PIP_PACKAGE_ARGS
tfrun find ./bazel-bin/tensorflow/tools/pip_package -iname "*.whl" -exec cp {} $TFCI_OUTPUT_DIR \;
tfrun ./ci/official/utilities/rename_and_verify_wheels.sh

Expand Down
7 changes: 6 additions & 1 deletion ci/official/wheel_test/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# buildifier: disable=load-on-top

workspace(name = "wheel_test")

# buildifier: disable=load-on-top

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

http_archive(
Expand All @@ -18,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 All @@ -38,7 +43,7 @@ python_repository(name = "python_version_repo")
load("@python_version_repo//:py_version.bzl", "TF_PYTHON_VERSION")

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

python_register_toolchains(
name = "python",
Expand Down
Loading

0 comments on commit 36eb24a

Please sign in to comment.