1load("//tensorflow:tensorflow.bzl", "cuda_py_test") 2load("//tensorflow:tensorflow.bzl", "py_binary", "py_test") 3 4package( 5 default_visibility = ["//tensorflow:internal"], 6 licenses = ["notice"], 7) 8 9py_library( 10 name = "profile_analyzer_cli", 11 srcs = ["profile_analyzer_cli.py"], 12 srcs_version = "PY3", 13 deps = [ 14 ":cli_shared", 15 ":command_parser", 16 ":debugger_cli_common", 17 ":ui_factory", 18 "//tensorflow/python/debug/lib:profiling", 19 "//tensorflow/python/debug/lib:source_utils", 20 "//third_party/py/numpy", 21 ], 22) 23 24py_library( 25 name = "base_ui", 26 srcs = ["base_ui.py"], 27 srcs_version = "PY3", 28 deps = [ 29 ":cli_config", 30 ":command_parser", 31 ":debugger_cli_common", 32 ], 33) 34 35py_library( 36 name = "curses_widgets", 37 srcs = ["curses_widgets.py"], 38 srcs_version = "PY3", 39 deps = [":debugger_cli_common"], 40) 41 42py_library( 43 name = "curses_ui", 44 srcs = ["curses_ui.py"], 45 srcs_version = "PY3", 46 deps = [ 47 ":base_ui", 48 ":cli_shared", 49 ":command_parser", 50 ":curses_widgets", 51 ":debugger_cli_common", 52 ":tensor_format", 53 ], 54) 55 56py_library( 57 name = "readline_ui", 58 srcs = ["readline_ui.py"], 59 srcs_version = "PY3", 60 deps = [ 61 ":base_ui", 62 ":debugger_cli_common", 63 ], 64) 65 66py_library( 67 name = "ui_factory", 68 srcs = ["ui_factory.py"], 69 srcs_version = "PY3", 70 deps = [ 71 ":curses_ui", 72 ":readline_ui", 73 ], 74) 75 76py_library( 77 name = "command_parser", 78 srcs = ["command_parser.py"], 79 srcs_version = "PY3", 80) 81 82py_library( 83 name = "tensor_format", 84 srcs = ["tensor_format.py"], 85 srcs_version = "PY3", 86 deps = [ 87 ":debugger_cli_common", 88 "//tensorflow/python/debug/lib:debug_data", 89 "//third_party/py/numpy", 90 ], 91) 92 93py_library( 94 name = "cli_shared", 95 srcs = ["cli_shared.py"], 96 srcs_version = "PY3", 97 deps = [ 98 ":command_parser", 99 ":debugger_cli_common", 100 ":tensor_format", 101 "//tensorflow/python:framework_for_generated_wrappers", 102 "//tensorflow/python:platform", 103 "//tensorflow/python:variables", 104 "//tensorflow/python/debug/lib:common", 105 "//third_party/py/numpy", 106 ], 107) 108 109py_library( 110 name = "evaluator", 111 srcs = ["evaluator.py"], 112 srcs_version = "PY3", 113 deps = [ 114 "//tensorflow/python/debug/lib:debug_data", 115 "//third_party/py/numpy", 116 ], 117) 118 119py_library( 120 name = "analyzer_cli", 121 srcs = ["analyzer_cli.py"], 122 srcs_version = "PY3", 123 deps = [ 124 ":cli_config", 125 ":cli_shared", 126 ":command_parser", 127 ":debugger_cli_common", 128 ":evaluator", 129 ":ui_factory", 130 "//tensorflow/python/debug/lib:debug_graphs", 131 "//tensorflow/python/debug/lib:source_utils", 132 ], 133) 134 135py_library( 136 name = "cli_config", 137 srcs = ["cli_config.py"], 138 srcs_version = "PY3", 139 deps = [ 140 ":debugger_cli_common", 141 "//tensorflow/python/platform", 142 ], 143) 144 145py_library( 146 name = "debugger_cli_common", 147 srcs = ["debugger_cli_common.py"], 148 srcs_version = "PY3", 149 deps = [ 150 "//tensorflow/python:platform", 151 "//tensorflow/python:pywrap_tf_session", 152 "//third_party/py/numpy", 153 ], 154) 155 156py_binary( 157 name = "offline_analyzer", 158 srcs = ["offline_analyzer.py"], 159 python_version = "PY3", 160 srcs_version = "PY3", 161 deps = [":offline_analyzer_lib"], 162) 163 164py_library( 165 name = "offline_analyzer_lib", 166 srcs = ["offline_analyzer.py"], 167 srcs_version = "PY3", 168 deps = [ 169 ":analyzer_cli", 170 "//tensorflow/python", # TODO(b/34059704): remove when fixed 171 "//tensorflow/python:platform", 172 "//tensorflow/python/debug/lib:debug_data", 173 ], 174) 175 176py_test( 177 name = "curses_ui_test", 178 size = "small", 179 srcs = ["curses_ui_test.py"], 180 python_version = "PY3", 181 srcs_version = "PY3", 182 tags = [ 183 "no_windows", 184 ], 185 deps = [ 186 ":cli_config", 187 ":cli_test_utils", 188 ":curses_ui", 189 ":debugger_cli_common", 190 ":tensor_format", 191 "//tensorflow/python:framework_test_lib", 192 "//tensorflow/python:platform", 193 "//tensorflow/python:platform_test", 194 "//third_party/py/numpy", 195 ], 196) 197 198py_test( 199 name = "readline_ui_test", 200 size = "small", 201 srcs = ["readline_ui_test.py"], 202 python_version = "PY3", 203 srcs_version = "PY3", 204 tags = ["no_windows"], # TODO(b/214427155) 205 deps = [ 206 ":cli_config", 207 ":debugger_cli_common", 208 ":readline_ui", 209 ":ui_factory", 210 "//tensorflow/python:framework_test_lib", 211 "//tensorflow/python:platform", 212 "//tensorflow/python:platform_test", 213 ], 214) 215 216py_test( 217 name = "debugger_cli_common_test", 218 size = "small", 219 srcs = ["debugger_cli_common_test.py"], 220 python_version = "PY3", 221 srcs_version = "PY3", 222 deps = [ 223 ":debugger_cli_common", 224 "//tensorflow/python:framework_test_lib", 225 "//tensorflow/python:platform", 226 "//tensorflow/python:platform_test", 227 "//tensorflow/python:pywrap_tf_session", 228 "//third_party/py/numpy", 229 ], 230) 231 232py_test( 233 name = "cli_config_test", 234 size = "small", 235 srcs = ["cli_config_test.py"], 236 python_version = "PY3", 237 srcs_version = "PY3", 238 deps = [ 239 ":cli_config", 240 "//tensorflow/python:framework_test_lib", 241 "//tensorflow/python:platform", 242 "//tensorflow/python:platform_test", 243 "//tensorflow/python/lib/io:lib", 244 ], 245) 246 247py_test( 248 name = "command_parser_test", 249 size = "small", 250 srcs = ["command_parser_test.py"], 251 python_version = "PY3", 252 srcs_version = "PY3", 253 deps = [ 254 ":command_parser", 255 "//tensorflow/python:framework_test_lib", 256 "//tensorflow/python:platform_test", 257 ], 258) 259 260py_test( 261 name = "tensor_format_test", 262 size = "small", 263 srcs = ["tensor_format_test.py"], 264 python_version = "PY3", 265 srcs_version = "PY3", 266 deps = [ 267 ":cli_test_utils", 268 ":tensor_format", 269 "//tensorflow/python:framework_test_lib", 270 "//tensorflow/python:platform_test", 271 "//tensorflow/python/debug/lib:debug_data", 272 "//third_party/py/numpy", 273 ], 274) 275 276py_test( 277 name = "cli_shared_test", 278 size = "small", 279 srcs = ["cli_shared_test.py"], 280 python_version = "PY3", 281 srcs_version = "PY3", 282 deps = [ 283 ":cli_shared", 284 ":debugger_cli_common", 285 "//tensorflow/python:errors", 286 "//tensorflow/python:framework_for_generated_wrappers", 287 "//tensorflow/python:framework_test_lib", 288 "//tensorflow/python:platform_test", 289 "//tensorflow/python:sparse_tensor", 290 "//tensorflow/python:variables", 291 "//tensorflow/python/framework:constant_op", 292 ], 293) 294 295py_test( 296 name = "evaluator_test", 297 size = "small", 298 srcs = [ 299 "evaluator_test.py", 300 ], 301 python_version = "PY3", 302 srcs_version = "PY3", 303 tags = ["no_windows"], # TODO(b/184424727): Enable this test on Windows. 304 deps = [ 305 ":evaluator", 306 "//tensorflow/python:client_testlib", 307 "//tensorflow/python:framework_test_lib", 308 "//tensorflow/python/debug/lib:debug_data", 309 "//third_party/py/numpy", 310 ], 311) 312 313py_library( 314 name = "cli_test_utils", 315 srcs = ["cli_test_utils.py"], 316 srcs_version = "PY3", 317 deps = ["//third_party/py/numpy"], 318) 319 320cuda_py_test( 321 name = "analyzer_cli_test", 322 size = "small", 323 srcs = ["analyzer_cli_test.py"], 324 python_version = "PY3", 325 tags = ["no_windows"], # TODO: needs investigation on Windows 326 xla_enable_strict_auto_jit = False, # Node names are different with autojit 327 deps = [ 328 ":analyzer_cli", 329 ":cli_config", 330 ":cli_shared", 331 ":cli_test_utils", 332 ":command_parser", 333 ":debugger_cli_common", 334 "//tensorflow/core:protos_all_py", 335 "//tensorflow/python:array_ops", 336 "//tensorflow/python:client_testlib", 337 "//tensorflow/python:control_flow_ops", 338 "//tensorflow/python:framework_for_generated_wrappers", 339 "//tensorflow/python:framework_test_lib", 340 "//tensorflow/python:math_ops", 341 "//tensorflow/python:platform_test", 342 "//tensorflow/python:session", 343 "//tensorflow/python:util", 344 "//tensorflow/python:variables", 345 "//tensorflow/python/debug/lib:debug_data", 346 "//tensorflow/python/debug/lib:debug_utils", 347 "//tensorflow/python/debug/lib:source_utils", 348 "//tensorflow/python/framework:constant_op", 349 "//tensorflow/python/lib/io:lib", 350 "//third_party/py/numpy", 351 ], 352) 353 354py_test( 355 name = "profile_analyzer_cli_test", 356 size = "small", 357 srcs = ["profile_analyzer_cli_test.py"], 358 python_version = "PY3", 359 srcs_version = "PY3", 360 deps = [ 361 ":debugger_cli_common", 362 ":profile_analyzer_cli", 363 "//tensorflow/core:protos_all_py", 364 "//tensorflow/python:client_testlib", 365 "//tensorflow/python:control_flow_ops", 366 "//tensorflow/python:framework_for_generated_wrappers", 367 "//tensorflow/python:framework_test_lib", 368 "//tensorflow/python:math_ops", 369 "//tensorflow/python:platform_test", 370 "//tensorflow/python:session", 371 "//tensorflow/python:util", 372 "//tensorflow/python/framework:constant_op", 373 ], 374) 375