1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
package(default_visibility = ["//visibility:public"])
licenses(["notice"]) # Apache 2.0
load("//tensorflow:tensorflow.bzl", "cuda_py_test")
load("//tensorflow:tensorflow.bzl", "py_test")
load("//tensorflow:tensorflow.bzl", "tf_py_test")
py_library(
name = "profiler",
srcs = ["profiler.py"],
srcs_version = "PY2AND3",
visibility = ["//visibility:public"],
deps = [
":model_analyzer",
":option_builder",
":tfprof_logger",
"//tensorflow/core/profiler:protos_all_py",
"//tensorflow/python:util",
],
)
py_library(
name = "option_builder",
srcs = ["option_builder.py"],
srcs_version = "PY2AND3",
deps = [
":tfprof_logger",
],
)
py_library(
name = "model_analyzer",
srcs = ["model_analyzer.py"],
srcs_version = "PY2AND3",
deps = [
":option_builder",
":tfprof_logger",
"//tensorflow/core/profiler:protos_all_py",
"//tensorflow/python:errors",
"//tensorflow/python:pywrap_tensorflow",
"@six_archive//:six",
],
)
cuda_py_test(
name = "model_analyzer_test",
srcs = ["model_analyzer_test.py"],
additional_deps = [
":profile_context",
":model_analyzer",
"//tensorflow/python/profiler/internal:model_analyzer_testlib",
"//tensorflow/python:client",
"//tensorflow/python:client_testlib",
"//tensorflow/python:framework_for_generated_wrappers",
"//tensorflow/python:distributed_framework_test_lib",
"//tensorflow/python:platform",
"//tensorflow/python:variables",
],
tags = [
"no_pip",
"oss_serial",
],
)
cuda_py_test(
name = "profiler_test",
srcs = ["profiler_test.py"],
additional_deps = [
":model_analyzer",
"//tensorflow/python:client",
"//tensorflow/python:client_testlib",
"//tensorflow/python:framework_for_generated_wrappers",
"//tensorflow/python:platform",
"//tensorflow/python/profiler/internal:model_analyzer_testlib",
"//tensorflow/python:variables",
],
tags = ["no_pip"],
)
py_library(
name = "tfprof_logger",
srcs = ["tfprof_logger.py"],
srcs_version = "PY2AND3",
deps = [
"//tensorflow/core/profiler:protos_all_py",
"//tensorflow/python:framework_for_generated_wrappers",
"//tensorflow/python:platform",
"//tensorflow/python/profiler/internal:flops_registry",
"@six_archive//:six",
],
)
tf_py_test(
name = "tfprof_logger_test",
size = "small",
srcs = ["tfprof_logger_test.py"],
additional_deps = [
":tfprof_logger",
"//tensorflow/core:protos_all_py",
"//tensorflow/core/profiler:protos_all_py",
"//tensorflow/python:array_ops",
"//tensorflow/python:client",
"//tensorflow/python:client_testlib",
"//tensorflow/python:framework_for_generated_wrappers",
"//tensorflow/python:math_ops",
],
)
py_library(
name = "profile_context",
srcs = ["profile_context.py"],
srcs_version = "PY2AND3",
deps = [
":model_analyzer",
":tfprof_logger",
],
)
cuda_py_test(
name = "profile_context_test",
srcs = ["profile_context_test.py"],
additional_deps = [
":profile_context",
"//tensorflow/python:client",
"//tensorflow/python:client_testlib",
"//tensorflow/python:framework_for_generated_wrappers",
"//tensorflow/python:platform",
"//tensorflow/python/profiler/internal:model_analyzer_testlib",
"//tensorflow/python:variables",
],
tags = ["no_pip"],
)
py_library(
name = "pprof_profiler",
srcs = ["pprof_profiler.py"],
srcs_version = "PY2AND3",
deps = ["@com_google_pprof//:pprof_proto_py"],
)
py_test(
name = "pprof_profiler_test",
size = "small",
srcs = ["pprof_profiler_test.py"],
main = "pprof_profiler_test.py",
srcs_version = "PY2AND3",
tags = ["no_pip"], # TODO(annarev): get it working with pip.
deps = [
":pprof_profiler",
"//tensorflow/core:protos_all_py",
"//tensorflow/python:client_testlib",
"//tensorflow/python:constant_op",
"//tensorflow/python:control_flow_ops",
"//tensorflow/python:math_ops",
"@com_google_pprof//:pprof_proto_py",
],
)
|