1# Description: 2# Tools for testing 3 4load( 5 "//tensorflow/tools/test:performance.bzl", 6 "tf_cc_logged_benchmark", 7 "tf_py_logged_benchmark", 8) 9 10package( 11 default_visibility = ["//tensorflow:internal"], 12 licenses = ["notice"], 13) 14 15exports_files(["run_and_gather_logs_lib.py"]) 16 17py_library( 18 name = "system_info_lib", 19 srcs = [ 20 "gpu_info_lib.py", 21 "system_info_lib.py", 22 ], 23 srcs_version = "PY3", 24 deps = [ 25 "//tensorflow:tensorflow_py", 26 "//tensorflow/core:protos_all_py", 27 "//tensorflow/python:client", 28 "//tensorflow/python:errors", 29 "//tensorflow/python:platform", 30 "@six_archive//:six", 31 ], 32) 33 34py_binary( 35 name = "system_info", 36 srcs = ["system_info.py"], 37 python_version = "PY3", 38 srcs_version = "PY3", 39 deps = [ 40 ":system_info_lib", 41 "//tensorflow/python:platform", 42 ], 43) 44 45py_library( 46 name = "run_and_gather_logs_lib", 47 srcs = [ 48 "run_and_gather_logs_lib.py", 49 ], 50 srcs_version = "PY3", 51 deps = [ 52 ":system_info_lib", 53 "//tensorflow/core:protos_all_py", 54 "//tensorflow/python:platform", 55 "@six_archive//:six", 56 ], 57) 58 59py_binary( 60 name = "run_and_gather_logs", 61 srcs = ["run_and_gather_logs.py"], 62 python_version = "PY3", 63 srcs_version = "PY3", 64 visibility = ["//visibility:public"], 65 deps = [ 66 ":run_and_gather_logs_main_lib", 67 "@six_archive//:six", 68 ], 69) 70 71py_library( 72 name = "run_and_gather_logs_main_lib", 73 srcs = ["run_and_gather_logs.py"], 74 srcs_version = "PY3", 75 visibility = ["//visibility:public"], 76 deps = [ 77 ":run_and_gather_logs_lib", 78 "//tensorflow/core:protos_all_py", 79 "//tensorflow/python:client_testlib", 80 "//tensorflow/python:platform", 81 "@six_archive//:six", 82 ], 83) 84 85# Unit test that calls run_and_gather_logs on a benchmark, and 86# prints the result. 87#cuda_py_test( 88# name = "run_and_gather_logs_test", 89# srcs = ["run_and_gather_logs.py"], 90# deps = [ 91# ":run_and_gather_logs", 92# ], 93# args = [ 94# "--test_name=" + "//tensorflow/core/kernels:cast_op_test", 95# "--test_args=" + "'--benchmark_filter=BM_cpu_float'", 96# ], 97# data = [ 98# "//tensorflow/core/kernels:cast_op_test", 99# ], 100# main = "run_and_gather_logs.py", 101#) 102 103tf_cc_logged_benchmark( 104 name = "cast_op_benchmark", 105 target = "//tensorflow/core/kernels:cast_op_test_gpu", 106) 107 108tf_py_logged_benchmark( 109 name = "rnn_op_benchmark", 110 target = "//tensorflow/python/kernel_tests/nn_ops:rnn_test", 111) 112 113tf_py_logged_benchmark( 114 name = "sparse_csr_matrix_ops_benchmark", 115 target = "//tensorflow/python/kernel_tests/linalg/sparse:csr_sparse_matrix_ops_test", 116) 117