16d3f15320
ARM CI / build (3.10) (push) Has been cancelled
cffconvert / validate (push) Has been cancelled
Creates a GitHub Issue when a PR Rolled back via Commit to Master / create-issue-on-pr-rollback (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
148 lines
4.4 KiB
Python
148 lines
4.4 KiB
Python
# Copyright 2026 The TensorFlow Authors. All Rights Reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# 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.
|
|
# ==============================================================================
|
|
|
|
load("@xla//third_party/rules_python/python:py_library.bzl", "py_library")
|
|
load(
|
|
"//tensorflow/tools/test:performance.bzl",
|
|
"tf_py_benchmark_test",
|
|
)
|
|
|
|
package(
|
|
# copybara:uncomment default_applicable_licenses = ["//tensorflow:license"],
|
|
default_visibility = ["//tensorflow:internal"],
|
|
licenses = ["notice"],
|
|
)
|
|
|
|
py_library(
|
|
name = "benchmark_base",
|
|
srcs = ["benchmark_base.py"],
|
|
strict_deps = True,
|
|
deps = [
|
|
"//tensorflow/python/client:session",
|
|
"//tensorflow/python/data/ops:dataset_ops",
|
|
"//tensorflow/python/data/ops:options",
|
|
"//tensorflow/python/data/util:nest",
|
|
"//tensorflow/python/eager:context",
|
|
"//tensorflow/python/platform:client_testlib",
|
|
"//third_party/py/numpy",
|
|
],
|
|
)
|
|
|
|
tf_py_benchmark_test(
|
|
name = "meta_benchmark",
|
|
srcs = ["meta_benchmark.py"],
|
|
deps = [
|
|
"//tensorflow/python/client:session",
|
|
"//tensorflow/python/data/experimental/ops:testing",
|
|
"//tensorflow/python/data/ops:dataset_ops",
|
|
"//tensorflow/python/data/ops:options",
|
|
"//tensorflow/python/eager:context",
|
|
"//tensorflow/python/platform:client_testlib",
|
|
"//third_party/py/numpy",
|
|
],
|
|
)
|
|
|
|
tf_py_benchmark_test(
|
|
name = "batch_benchmark",
|
|
srcs = ["batch_benchmark.py"],
|
|
deps = [
|
|
":benchmark_base",
|
|
"//tensorflow/python/data/ops:dataset_ops",
|
|
"//tensorflow/python/data/ops:options",
|
|
"//tensorflow/python/framework:sparse_tensor",
|
|
"//tensorflow/python/ops:random_ops",
|
|
"//third_party/py/numpy",
|
|
],
|
|
)
|
|
|
|
tf_py_benchmark_test(
|
|
name = "filter_benchmark",
|
|
srcs = ["filter_benchmark.py"],
|
|
deps = [
|
|
":benchmark_base",
|
|
"//tensorflow/python/data/ops:dataset_ops",
|
|
"//tensorflow/python/ops:array_ops",
|
|
],
|
|
)
|
|
|
|
tf_py_benchmark_test(
|
|
name = "from_tensor_slices_benchmark",
|
|
srcs = ["from_tensor_slices_benchmark.py"],
|
|
deps = [
|
|
":benchmark_base",
|
|
"//tensorflow/python/data/experimental/ops:get_single_element",
|
|
"//tensorflow/python/data/ops:dataset_ops",
|
|
"//tensorflow/python/data/ops:structured_function",
|
|
"//tensorflow/python/eager:def_function",
|
|
"//tensorflow/python/framework:sparse_tensor",
|
|
"//tensorflow/python/ops:dataset_ops_gen",
|
|
"//third_party/py/numpy",
|
|
],
|
|
)
|
|
|
|
tf_py_benchmark_test(
|
|
name = "interleave_benchmark",
|
|
srcs = ["interleave_benchmark.py"],
|
|
deps = [
|
|
":benchmark_base",
|
|
"//tensorflow/python/data/experimental/ops:interleave_ops",
|
|
"//tensorflow/python/data/experimental/ops:testing",
|
|
"//tensorflow/python/data/ops:dataset_ops",
|
|
],
|
|
)
|
|
|
|
tf_py_benchmark_test(
|
|
name = "list_files_benchmark",
|
|
srcs = ["list_files_benchmark.py"],
|
|
deps = [
|
|
":benchmark_base",
|
|
"//tensorflow/python/data/ops:dataset_ops",
|
|
],
|
|
)
|
|
|
|
tf_py_benchmark_test(
|
|
name = "map_benchmark",
|
|
srcs = ["map_benchmark.py"],
|
|
deps = [
|
|
":benchmark_base",
|
|
"//tensorflow/python/data/ops:dataset_ops",
|
|
"//tensorflow/python/framework:constant_op",
|
|
"//tensorflow/python/ops:array_ops",
|
|
"//tensorflow/python/ops:map_fn",
|
|
"//tensorflow/python/ops:math_ops",
|
|
"//tensorflow/python/ops:random_ops",
|
|
"//tensorflow/python/ops:while_loop",
|
|
],
|
|
)
|
|
|
|
tf_py_benchmark_test(
|
|
name = "prefetch_benchmark",
|
|
srcs = ["prefetch_benchmark.py"],
|
|
deps = [
|
|
":benchmark_base",
|
|
"//tensorflow/python/data/ops:dataset_ops",
|
|
],
|
|
)
|
|
|
|
tf_py_benchmark_test(
|
|
name = "range_benchmark",
|
|
srcs = ["range_benchmark.py"],
|
|
deps = [
|
|
":benchmark_base",
|
|
"//tensorflow/python/data/ops:dataset_ops",
|
|
"//tensorflow/python/data/ops:options",
|
|
],
|
|
)
|