tensorboard-plugin-profile 2.16.0__tar.gz → 2.18.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/PKG-INFO +1 -3
  2. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/profile_plugin.py +107 -60
  3. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/protobuf/dcn_slack_analysis_pb2.py +3 -36
  4. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/protobuf/diagnostics_pb2.py +3 -12
  5. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/protobuf/input_pipeline_pb2.py +3 -68
  6. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/protobuf/kernel_stats_pb2.py +3 -20
  7. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/protobuf/overview_page_pb2.py +3 -85
  8. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/protobuf/power_metrics_pb2.py +3 -20
  9. tensorboard_plugin_profile-2.18.0/tensorboard_plugin_profile/protobuf/tf_data_stats_pb2.py +61 -0
  10. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/protobuf/tf_stats_pb2.py +3 -28
  11. tensorboard_plugin_profile-2.18.0/tensorboard_plugin_profile/protobuf/trace_events_pb2.py +43 -0
  12. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/static/bundle.js +247 -182
  13. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/static/trace_viewer_index.html +24 -4
  14. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/static/trace_viewer_index.js +126 -32
  15. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/version.py +1 -1
  16. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile.egg-info/PKG-INFO +1 -3
  17. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile.egg-info/entry_points.txt +0 -1
  18. tensorboard_plugin_profile-2.16.0/tensorboard_plugin_profile/protobuf/tf_data_stats_pb2.py +0 -172
  19. tensorboard_plugin_profile-2.16.0/tensorboard_plugin_profile/protobuf/trace_events_pb2.py +0 -103
  20. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/README.rst +0 -0
  21. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/setup.cfg +0 -0
  22. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/setup.py +0 -0
  23. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/__init__.py +0 -0
  24. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/convert/dcn_collective_stats_proto_to_gviz.py +0 -0
  25. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/convert/diagnostics.py +0 -0
  26. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/convert/input_pipeline_proto_to_gviz.py +0 -0
  27. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/convert/kernel_stats_proto_to_gviz.py +0 -0
  28. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/convert/overview_page_proto_to_gviz.py +0 -0
  29. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/convert/raw_to_tool_data.py +0 -0
  30. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/convert/tf_data_stats_proto_to_gviz.py +0 -0
  31. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/convert/tf_stats_proto_to_gviz.py +0 -0
  32. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/convert/trace_events_json.py +0 -0
  33. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/integration_tests/tf_mnist.py +0 -0
  34. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/integration_tests/tf_profiler_session.py +0 -0
  35. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/integration_tests/tpu/tensorflow/tpu_tf2_keras_test.py +0 -0
  36. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/profile_plugin_loader.py +0 -0
  37. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/static/index.html +0 -0
  38. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/static/index.js +0 -0
  39. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/static/materialicons.woff2 +0 -0
  40. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/static/styles.css +0 -0
  41. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile/static/zone.js +0 -0
  42. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile.egg-info/SOURCES.txt +0 -0
  43. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile.egg-info/dependency_links.txt +0 -0
  44. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile.egg-info/requires.txt +0 -0
  45. {tensorboard_plugin_profile-2.16.0 → tensorboard_plugin_profile-2.18.0}/tensorboard_plugin_profile.egg-info/top_level.txt +0 -0
@@ -1,13 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tensorboard_plugin_profile
3
- Version: 2.16.0
3
+ Version: 2.18.0
4
4
  Summary: Profile Tensorboard Plugin
5
5
  Home-page: https://github.com/tensorflow/profiler
6
6
  Author: Google Inc.
7
7
  Author-email: packages@tensorflow.org
8
8
  License: Apache 2.0
9
9
  Keywords: tensorflow tensorboard xprof profile plugin
10
- Platform: UNKNOWN
11
10
  Classifier: Intended Audience :: Developers
12
11
  Classifier: Intended Audience :: Education
13
12
  Classifier: Intended Audience :: Science/Research
@@ -20,4 +19,3 @@ Classifier: Topic :: Software Development :: Libraries
20
19
  Requires-Python: >= 2.7, != 3.0.*, != 3.1.*
21
20
 
22
21
  Profile Tensorboard Plugin
23
-
@@ -18,13 +18,16 @@ from __future__ import absolute_import
18
18
  from __future__ import division
19
19
  from __future__ import print_function
20
20
 
21
+ from collections.abc import Callable, Iterator
21
22
  import gzip
22
23
  import json
23
24
  import logging
24
25
  import os
25
26
  import re
26
27
  import threading
28
+ from typing import Any, List, TypedDict
27
29
 
30
+ from etils import epath
28
31
  import six
29
32
  import tensorflow.compat.v2 as tf
30
33
  from werkzeug import wrappers
@@ -83,6 +86,8 @@ TOOLS = {
83
86
 
84
87
  ALL_HOSTS = 'ALL_HOSTS'
85
88
 
89
+ HostMetadata = TypedDict('HostMetadata', {'hostname': str})
90
+
86
91
  _EXTENSION_TO_TOOL = {extension: tool for tool, extension in TOOLS.items()}
87
92
 
88
93
  _FILENAME_RE = re.compile(r'(?:(.*)\.)?(' +
@@ -123,7 +128,7 @@ XPLANE_TOOLS_ALL_HOSTS_ONLY = frozenset(
123
128
  ['overview_page^', 'pod_viewer^', 'tf_data_bottleneck_analysis^'])
124
129
 
125
130
 
126
- def use_xplane(tool):
131
+ def use_xplane(tool: str) -> bool:
127
132
  return tool[-1] == '^'
128
133
 
129
134
 
@@ -131,11 +136,11 @@ def use_xplane(tool):
131
136
  HLO_TOOLS = frozenset(['graph_viewer^', 'memory_viewer^'])
132
137
 
133
138
 
134
- def use_hlo(tool):
139
+ def use_hlo(tool: str) -> bool:
135
140
  return tool in HLO_TOOLS
136
141
 
137
142
 
138
- def make_filename(host, tool):
143
+ def make_filename(host: str, tool: str) -> str:
139
144
  """Returns the name of the file containing data for the given host and tool.
140
145
 
141
146
  Args:
@@ -154,7 +159,7 @@ def make_filename(host, tool):
154
159
  return filename + TOOLS[tool]
155
160
 
156
161
 
157
- def _parse_filename(filename):
162
+ def _parse_filename(filename: str) -> tuple[str | None, str | None]:
158
163
  """Returns the host and tool encoded in a filename in the run directory.
159
164
 
160
165
  Args:
@@ -172,7 +177,7 @@ def _parse_filename(filename):
172
177
  return m.group(1), _EXTENSION_TO_TOOL[m.group(2)]
173
178
 
174
179
 
175
- def _get_hosts(filenames):
180
+ def _get_hosts(filenames: list[str]) -> set[str]:
176
181
  """Parses a list of filenames and returns the set of hosts.
177
182
 
178
183
  Args:
@@ -189,14 +194,14 @@ def _get_hosts(filenames):
189
194
  return hosts
190
195
 
191
196
 
192
- def _get_tools(filenames, profile_run_dir):
197
+ def _get_tools(filenames: list[str], profile_run_dir: str) -> set[str]:
193
198
  """Parses a list of filenames and returns the set of tools.
194
199
 
195
200
  If xplane is present in the repository, add tools that can be generated by
196
201
  xplane if we don't have a file for the tool.
197
202
 
198
203
  Args:
199
- filenames: A list of filenames (just basenames, no directory).
204
+ filenames: A list of filenames.
200
205
  profile_run_dir: The run directory of the profile.
201
206
 
202
207
  Returns:
@@ -233,7 +238,9 @@ def _get_tools(filenames, profile_run_dir):
233
238
  return tools
234
239
 
235
240
 
236
- def get_worker_list(cluster_resolver):
241
+ def get_worker_list(
242
+ cluster_resolver: tf.distribute.cluster_resolver.ClusterResolver,
243
+ ) -> str:
237
244
  """Parses TPU workers list from the cluster resolver."""
238
245
  cluster_spec = cluster_resolver.cluster_spec()
239
246
  task_indices = cluster_spec.task_indices('worker')
@@ -244,7 +251,12 @@ def get_worker_list(cluster_resolver):
244
251
  return ','.join(worker_list)
245
252
 
246
253
 
247
- def respond(body, content_type, code=200, content_encoding=None):
254
+ def respond(
255
+ body: Any,
256
+ content_type: str,
257
+ code: int = 200,
258
+ content_encoding: tuple[str, str] | None = None,
259
+ ) -> wrappers.Response:
248
260
  """Create a Werkzeug response, handling JSON serialization and CSP.
249
261
 
250
262
  Args:
@@ -258,7 +270,7 @@ def respond(body, content_type, code=200, content_encoding=None):
258
270
  encoding would be set to gzip.
259
271
 
260
272
  Returns:
261
- A `werkzeug.wrappers.BaseResponse` object.
273
+ A `werkzeug.wrappers.Response` object.
262
274
  """
263
275
  if content_type == 'application/json' and isinstance(
264
276
  body, (dict, list, set, tuple)):
@@ -316,10 +328,13 @@ def respond(body, content_type, code=200, content_encoding=None):
316
328
  headers.append(('Content-Encoding', 'gzip'))
317
329
  body = gzip.compress(body)
318
330
  return wrappers.Response(
319
- body, content_type=content_type, status=code, headers=headers)
331
+ body, content_type=content_type, status=code, headers=headers
332
+ )
320
333
 
321
334
 
322
- def _plugin_assets(logdir, runs, plugin_name):
335
+ def _plugin_assets(
336
+ logdir: str, runs: list[str], plugin_name: str
337
+ ) -> dict[str, list[str]]:
323
338
  result = {}
324
339
  for run in runs:
325
340
  run_path = _tb_run_directory(logdir, run)
@@ -328,7 +343,7 @@ def _plugin_assets(logdir, runs, plugin_name):
328
343
  return result
329
344
 
330
345
 
331
- def _tb_run_directory(logdir, run):
346
+ def _tb_run_directory(logdir: str, run: str) -> str:
332
347
  """Returns the TensorBoard run directory for a TensorBoard run name.
333
348
 
334
349
  This helper returns the TensorBoard-level run directory (the one that would)
@@ -347,7 +362,7 @@ def _tb_run_directory(logdir, run):
347
362
  return logdir if run == '.' else os.path.join(logdir, run)
348
363
 
349
364
 
350
- def filenames_to_hosts(filenames, tool):
365
+ def filenames_to_hosts(filenames: list[str], tool: str) -> list[str]:
351
366
  """Convert a list of filenames to a list of host names given a tool.
352
367
 
353
368
  Args:
@@ -366,7 +381,9 @@ def filenames_to_hosts(filenames, tool):
366
381
  return sorted(hosts)
367
382
 
368
383
 
369
- def get_data_content_encoding(raw_data, tool, params):
384
+ def get_data_content_encoding(
385
+ raw_data: Any, tool: str, params: dict[str, Any]
386
+ ) -> tuple[Any, str, str | None]:
370
387
  """Converts raw tool proto into the correct tool data.
371
388
 
372
389
  Args:
@@ -413,7 +430,7 @@ class ProfilePlugin(base_plugin.TBPlugin):
413
430
  # Cache to map profile run name to corresponding tensorboard dir name
414
431
  self._run_to_profile_run_dir = {}
415
432
 
416
- def is_active(self):
433
+ def is_active(self) -> bool:
417
434
  """Whether this plugin is active and has any profile data to show.
418
435
 
419
436
  Returns:
@@ -423,7 +440,9 @@ class ProfilePlugin(base_plugin.TBPlugin):
423
440
  self._is_active = any(self.generate_runs())
424
441
  return self._is_active
425
442
 
426
- def get_plugin_apps(self):
443
+ def get_plugin_apps(
444
+ self,
445
+ ) -> dict[str, Callable[[wrappers.Request], wrappers.Response]]:
427
446
  return {
428
447
  INDEX_JS_ROUTE: self.static_file_route,
429
448
  INDEX_HTML_ROUTE: self.static_file_route,
@@ -440,10 +459,10 @@ class ProfilePlugin(base_plugin.TBPlugin):
440
459
  CAPTURE_ROUTE: self.capture_route,
441
460
  }
442
461
 
443
- def frontend_metadata(self):
462
+ def frontend_metadata(self) -> base_plugin.FrontendMetadata:
444
463
  return base_plugin.FrontendMetadata(es_module_path='/index.js')
445
464
 
446
- def _read_static_file_impl(self, filename):
465
+ def _read_static_file_impl(self, filename: str) -> bytes:
447
466
  """Reads contents from a filename.
448
467
 
449
468
  Args:
@@ -463,8 +482,10 @@ class ProfilePlugin(base_plugin.TBPlugin):
463
482
  raise io_error
464
483
  return contents
465
484
 
485
+ # pytype: disable=wrong-arg-types
466
486
  @wrappers.Request.application
467
- def static_file_route(self, request):
487
+ def static_file_route(self, request: wrappers.Request) -> wrappers.Response:
488
+ # pytype: enable=wrong-arg-types
468
489
  filename = os.path.basename(request.path)
469
490
  extention = os.path.splitext(filename)[1]
470
491
  if extention == '.html':
@@ -481,12 +502,14 @@ class ProfilePlugin(base_plugin.TBPlugin):
481
502
  return respond('Fail to read the files.', 'text/plain', code=404)
482
503
  return respond(contents, mimetype)
483
504
 
505
+ # pytype: disable=wrong-arg-types
484
506
  @wrappers.Request.application
485
- def runs_route(self, request):
507
+ def runs_route(self, request: wrappers.Request) -> wrappers.Response:
508
+ # pytype: enable=wrong-arg-types
486
509
  runs = self.runs_imp(request)
487
510
  return respond(runs, 'application/json')
488
511
 
489
- def runs_imp(self, request=None):
512
+ def runs_imp(self, request: wrappers.Request | None = None) -> list[str]:
490
513
  """Returns a list all runs for the profile plugin.
491
514
 
492
515
  Args:
@@ -495,13 +518,17 @@ class ProfilePlugin(base_plugin.TBPlugin):
495
518
  """
496
519
  return sorted(list(self.generate_runs()), reverse=True)
497
520
 
521
+ # pytype: disable=wrong-arg-types
498
522
  @wrappers.Request.application
499
- def run_tools_route(self, request):
523
+ def run_tools_route(self, request: wrappers.Request) -> wrappers.Response:
524
+ # pytype: enable=wrong-arg-types
500
525
  run = request.args.get('run')
501
526
  run_tools = self.run_tools_imp(run, request)
502
527
  return respond(run_tools, 'application/json')
503
528
 
504
- def run_tools_imp(self, run, request=None):
529
+ def run_tools_imp(
530
+ self, run, request: wrappers.Request | None = None
531
+ ) -> list[str]:
505
532
  """Returns a list of tools given a single run.
506
533
 
507
534
  Args:
@@ -511,22 +538,27 @@ class ProfilePlugin(base_plugin.TBPlugin):
511
538
  """
512
539
  return list(self.generate_tools_of_run(run))
513
540
 
514
- def _run_host_impl(self, run, run_dir, tool):
541
+ def _run_host_impl(
542
+ self, run: str, run_dir: str, tool: str
543
+ ) -> List[HostMetadata]:
515
544
  if not run_dir:
516
545
  logger.warning('Cannot find asset directory for: %s', run)
517
546
  return []
518
547
  tool_pattern = make_filename('*', tool)
519
548
  filenames = []
520
549
  try:
521
- filenames = tf.io.gfile.glob(os.path.join(run_dir, tool_pattern))
522
- except tf.errors.OpError as e:
550
+ path = epath.Path(run_dir)
551
+ filenames = path.glob(tool_pattern)
552
+ except OSError as e:
523
553
  logger.warning('Cannot read asset directory: %s, OpError %s', run_dir, e)
524
- filenames = [os.path.basename(f) for f in filenames]
554
+ filenames = [os.fspath(os.path.basename(f)) for f in filenames]
525
555
 
526
- return filenames_to_hosts(filenames, tool)
556
+ return [{'hostname': host} for host in filenames_to_hosts(filenames, tool)]
527
557
 
528
- def host_impl(self, run, tool, request=None):
529
- """Returns available hosts for the run and tool in the log directory.
558
+ def host_impl(
559
+ self, run: str, tool: str, request: wrappers.Request | None = None
560
+ ) -> List[HostMetadata]:
561
+ """Returns available hosts and their metadata for the run and tool in the log directory.
530
562
 
531
563
  For HLO tools like memory_viewer and graph_viewer, this functions returns
532
564
  the module names for the run and tool instead of host names, because these
@@ -560,20 +592,26 @@ class ProfilePlugin(base_plugin.TBPlugin):
560
592
 
561
593
  Returns:
562
594
  A list of host names, e.g.:
563
- host_impl(run1, trace_viewer) --> ["host1", "host2"]
564
- host_impl(run1, memory_viewer) --> ["module1", "module2"]
595
+ host_impl(run1, trace_viewer) --> [{"hostname": "host1", {"hostname":
596
+ "host2"}]
597
+ host_impl(run1, memory_viewer) --> [{"hostname": "module1", {"hostname":
598
+ "module2"}]
565
599
  """
566
600
  run_dir = self._run_dir(run)
567
601
  return self._run_host_impl(run, run_dir, tool)
568
602
 
603
+ # pytype: disable=wrong-arg-types
569
604
  @wrappers.Request.application
570
- def hosts_route(self, request):
605
+ def hosts_route(self, request: wrappers.Request) -> wrappers.Response:
606
+ # pytype: enable=wrong-arg-types
571
607
  run = request.args.get('run')
572
608
  tool = request.args.get('tag')
573
609
  hosts = self.host_impl(run, tool, request)
574
610
  return respond(hosts, 'application/json')
575
611
 
576
- def data_impl(self, request):
612
+ def data_impl(
613
+ self, request: wrappers.Request
614
+ ) -> tuple[str | None, str, str | None]:
577
615
  """Retrieves and processes the tool data for a run and a host.
578
616
 
579
617
  Args:
@@ -623,8 +661,9 @@ class ProfilePlugin(base_plugin.TBPlugin):
623
661
  if host == ALL_HOSTS:
624
662
  file_pattern = make_filename('*', 'xplane')
625
663
  try:
626
- asset_paths = tf.io.gfile.glob(os.path.join(run_dir, file_pattern))
627
- except tf.errors.OpError as e:
664
+ path = epath.Path(run_dir)
665
+ asset_paths = path.glob(file_pattern)
666
+ except OSError as e:
628
667
  logger.warning('Cannot read asset directory: %s, OpError %s', run_dir,
629
668
  e)
630
669
  raise IOError(
@@ -648,20 +687,20 @@ class ProfilePlugin(base_plugin.TBPlugin):
648
687
 
649
688
  raw_data = None
650
689
  try:
651
- with tf.io.gfile.GFile(asset_path, 'rb') as f:
652
- raw_data = f.read()
653
- except tf.errors.NotFoundError:
654
- logger.warning('Asset path %s not found', asset_path)
655
- except tf.errors.OpError as e:
656
- logger.warning("Couldn't read asset path: %s, OpError %s", asset_path, e)
690
+ path = epath.Path(asset_path)
691
+ raw_data = path.read_bytes()
692
+ except OSError as e:
693
+ logger.warning("Couldn't read asset path: %s, Error: %s", asset_path, e)
657
694
 
658
695
  if raw_data is None:
659
696
  return None, content_type, None
660
697
 
661
698
  return get_data_content_encoding(raw_data, tool, params)
662
699
 
700
+ # pytype: disable=wrong-arg-types
663
701
  @wrappers.Request.application
664
- def data_route(self, request):
702
+ def data_route(self, request: wrappers.Request) -> wrappers.Response:
703
+ # pytype: enable=wrong-arg-types
665
704
  # params
666
705
  # request: XMLHTTPRequest.
667
706
  try:
@@ -677,12 +716,15 @@ class ProfilePlugin(base_plugin.TBPlugin):
677
716
  except IOError as e:
678
717
  return respond(str(e), 'text/plain', code=500)
679
718
 
719
+ # pytype: disable=wrong-arg-types
680
720
  @wrappers.Request.application
681
- def capture_route(self, request):
721
+ def capture_route(self, request: wrappers.Request) -> wrappers.Response:
722
+ # pytype: enable=wrong-arg-types
682
723
  return self.capture_route_impl(request)
683
724
 
684
- def capture_route_impl(self, request):
725
+ def capture_route_impl(self, request: wrappers.Request) -> wrappers.Response:
685
726
  """Runs the client trace for capturing profiling information."""
727
+
686
728
  service_addr = request.args.get('service_addr')
687
729
  duration = int(request.args.get('duration', '1000'))
688
730
  is_tpu_name = request.args.get('is_tpu_name') == 'true'
@@ -703,11 +745,12 @@ class ProfilePlugin(base_plugin.TBPlugin):
703
745
 
704
746
  if is_tpu_name:
705
747
  try:
706
- tpu_cluster_resolver = tf.distribute.cluster_resolver.TPUClusterResolver(
707
- service_addr)
748
+ tpu_cluster_resolver = (
749
+ tf.distribute.cluster_resolver.TPUClusterResolver(service_addr)
750
+ )
708
751
  master_grpc_addr = tpu_cluster_resolver.get_master()
709
752
  except (ImportError, RuntimeError) as err:
710
- return respond({'error': err.message}, 'application/json', code=200)
753
+ return respond({'error': repr(err)}, 'application/json', code=200)
711
754
  except (ValueError, TypeError):
712
755
  return respond(
713
756
  {'error': 'no TPUs with the specified names exist.'},
@@ -756,7 +799,9 @@ class ProfilePlugin(base_plugin.TBPlugin):
756
799
  code=200,
757
800
  )
758
801
 
759
- def _get_graph_viewer_options(self, request):
802
+ def _get_graph_viewer_options(
803
+ self, request: wrappers.Request
804
+ ) -> dict[str, Any]:
760
805
  node_name = request.args.get('node_name')
761
806
  module_name = request.args.get('module_name')
762
807
  graph_width_str = request.args.get('graph_width') or ''
@@ -773,7 +818,7 @@ class ProfilePlugin(base_plugin.TBPlugin):
773
818
  'type': request.args.get('type')
774
819
  }
775
820
 
776
- def _run_dir(self, run):
821
+ def _run_dir(self, run: str) -> str:
777
822
  """Helper that maps a frontend run name to a profile "run" directory.
778
823
 
779
824
  The frontend run name consists of the TensorBoard run name (aka the relative
@@ -798,14 +843,14 @@ class ProfilePlugin(base_plugin.TBPlugin):
798
843
  if not tb_run_name:
799
844
  tb_run_name = '.'
800
845
  tb_run_directory = _tb_run_directory(self.logdir, tb_run_name)
801
- if not tf.io.gfile.isdir(tb_run_directory):
846
+ if not epath.Path(tb_run_directory).is_dir():
802
847
  raise RuntimeError('No matching run directory for run %s' % run)
803
848
 
804
849
  plugin_directory = plugin_asset_util.PluginDirectory(
805
850
  tb_run_directory, PLUGIN_NAME)
806
851
  return os.path.join(plugin_directory, profile_run_name)
807
852
 
808
- def generate_runs(self):
853
+ def generate_runs(self) -> Iterator[str]:
809
854
  """Generator for a list of runs.
810
855
 
811
856
  The "run name" here is a "frontend run name" - see _run_dir() for the
@@ -861,7 +906,7 @@ class ProfilePlugin(base_plugin.TBPlugin):
861
906
  # backwards compatible with previously profile plugin behavior. Note that we
862
907
  # check if logdir is a directory to handle case where it's actually a
863
908
  # multipart directory spec, which this plugin does not support.
864
- if '.' not in tb_runs and tf.io.gfile.isdir(self.logdir):
909
+ if '.' not in tb_runs and epath.Path(self.logdir).is_dir():
865
910
  tb_runs.append('.')
866
911
  tb_run_names_to_dirs = {
867
912
  run: _tb_run_directory(self.logdir, run) for run in tb_runs
@@ -880,22 +925,24 @@ class ProfilePlugin(base_plugin.TBPlugin):
880
925
  else:
881
926
  frontend_run = os.path.join(tb_run_name, profile_run)
882
927
  profile_run_dir = os.path.join(tb_plugin_dir, profile_run)
883
- if tf.io.gfile.isdir(profile_run_dir):
928
+ if epath.Path(profile_run_dir).is_dir():
884
929
  self._run_to_profile_run_dir[frontend_run] = profile_run_dir
885
930
  yield frontend_run
886
931
 
887
- def generate_tools_of_run(self, run):
932
+ def generate_tools_of_run(self, run: str) -> Iterator[str]:
888
933
  """Generate a list of tools given a certain run."""
889
934
  profile_run_dir = self._run_to_profile_run_dir[run]
890
- if tf.io.gfile.isdir(profile_run_dir):
935
+ if epath.Path(profile_run_dir).is_dir():
891
936
  try:
892
- filenames = tf.io.gfile.listdir(profile_run_dir)
893
- except tf.errors.NotFoundError as e:
937
+ filenames = epath.Path(profile_run_dir).iterdir()
938
+ except OSError as e:
894
939
  logger.warning('Cannot read asset directory: %s, NotFoundError %s',
895
940
  profile_run_dir, e)
896
941
  filenames = []
897
942
  if filenames:
898
- for tool in self._get_active_tools(filenames, profile_run_dir):
943
+ for tool in self._get_active_tools(
944
+ [name.name for name in filenames], profile_run_dir
945
+ ):
899
946
  yield tool
900
947
 
901
948
  def _get_active_tools(self, filenames, profile_run_dir=''):
@@ -2,10 +2,9 @@
2
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
3
3
  # source: plugin/tensorboard_plugin_profile/protobuf/dcn_slack_analysis.proto
4
4
  """Generated protocol buffer code."""
5
+ from google.protobuf.internal import builder as _builder
5
6
  from google.protobuf import descriptor as _descriptor
6
7
  from google.protobuf import descriptor_pool as _descriptor_pool
7
- from google.protobuf import message as _message
8
- from google.protobuf import reflection as _reflection
9
8
  from google.protobuf import symbol_database as _symbol_database
10
9
  # @@protoc_insertion_point(imports)
11
10
 
@@ -16,40 +15,8 @@ _sym_db = _symbol_database.Default()
16
15
 
17
16
  DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nCplugin/tensorboard_plugin_profile/protobuf/dcn_slack_analysis.proto\x12\x1atensorboard_plugin_profile\"8\n\nOpInstance\x12\x15\n\rstart_time_ps\x18\x01 \x01(\x04\x12\x13\n\x0b\x64uration_ps\x18\x02 \x01(\x04\"\x99\x04\n\x08\x44\x63nSlack\x12\x12\n\nrendezvous\x18\x01 \x01(\t\x12\x1a\n\x12send_start_time_us\x18\x02 \x01(\x04\x12\x1d\n\x15recv_done_end_time_us\x18\x03 \x01(\x04\x12\x10\n\x08slack_us\x18\x04 \x01(\x04\x12&\n\x1e\x62ytes_transmitted_over_network\x18\x05 \x01(\x04\x12\x19\n\x11stall_duration_us\x18\x06 \x01(\x04\x12\x14\n\x0crecv_op_name\x18\x07 \x01(\t\x12\x14\n\x0csend_op_name\x18\x08 \x01(\t\x12\x34\n\x04send\x18\t \x01(\x0b\x32&.tensorboard_plugin_profile.OpInstance\x12\x39\n\tsend_done\x18\n \x01(\x0b\x32&.tensorboard_plugin_profile.OpInstance\x12\x34\n\x04recv\x18\x0b \x01(\x0b\x32&.tensorboard_plugin_profile.OpInstance\x12\x39\n\trecv_done\x18\x0c \x01(\x0b\x32&.tensorboard_plugin_profile.OpInstance\x12\x15\n\rtransfer_type\x18\r \x01(\t\x12\x44\n\x14host_graph_execution\x18\x0e \x01(\x0b\x32&.tensorboard_plugin_profile.OpInstance\"\x94\x03\n\x0f\x44\x63nSlackSummary\x12\x12\n\nrendezvous\x18\x01 \x01(\t\x12\x10\n\x08slack_us\x18\x02 \x01(\x04\x12\x13\n\x0boccurrences\x18\x03 \x01(\x04\x12&\n\x1e\x62ytes_transmitted_over_network\x18\x04 \x01(\x04\x12\x19\n\x11stall_duration_us\x18\x05 \x01(\x04\x12\x1c\n\x14observed_duration_us\x18\x06 \x01(\x04\x12\x14\n\x0crecv_op_name\x18\x07 \x01(\t\x12\x14\n\x0csend_op_name\x18\x08 \x01(\t\x12\x18\n\x10send_duration_us\x18\t \x01(\x04\x12\x18\n\x10recv_duration_us\x18\n \x01(\x04\x12\x1d\n\x15send_done_duration_us\x18\x0b \x01(\x04\x12\x1d\n\x15recv_done_duration_us\x18\x0c \x01(\x04\x12\x15\n\rtransfer_type\x18\r \x01(\t\x12\x15\n\rhost_stall_us\x18\x0e \x01(\x03\x12\x19\n\x11host_events_count\x18\x0f \x01(\x04\"\x93\x01\n\x10\x44\x63nSlackAnalysis\x12\x37\n\tdcn_slack\x18\x01 \x03(\x0b\x32$.tensorboard_plugin_profile.DcnSlack\x12\x46\n\x11\x64\x63n_slack_summary\x18\x02 \x03(\x0b\x32+.tensorboard_plugin_profile.DcnSlackSummaryb\x06proto3')
18
17
 
19
-
20
-
21
- _OPINSTANCE = DESCRIPTOR.message_types_by_name['OpInstance']
22
- _DCNSLACK = DESCRIPTOR.message_types_by_name['DcnSlack']
23
- _DCNSLACKSUMMARY = DESCRIPTOR.message_types_by_name['DcnSlackSummary']
24
- _DCNSLACKANALYSIS = DESCRIPTOR.message_types_by_name['DcnSlackAnalysis']
25
- OpInstance = _reflection.GeneratedProtocolMessageType('OpInstance', (_message.Message,), {
26
- 'DESCRIPTOR' : _OPINSTANCE,
27
- '__module__' : 'plugin.tensorboard_plugin_profile.protobuf.dcn_slack_analysis_pb2'
28
- # @@protoc_insertion_point(class_scope:tensorboard_plugin_profile.OpInstance)
29
- })
30
- _sym_db.RegisterMessage(OpInstance)
31
-
32
- DcnSlack = _reflection.GeneratedProtocolMessageType('DcnSlack', (_message.Message,), {
33
- 'DESCRIPTOR' : _DCNSLACK,
34
- '__module__' : 'plugin.tensorboard_plugin_profile.protobuf.dcn_slack_analysis_pb2'
35
- # @@protoc_insertion_point(class_scope:tensorboard_plugin_profile.DcnSlack)
36
- })
37
- _sym_db.RegisterMessage(DcnSlack)
38
-
39
- DcnSlackSummary = _reflection.GeneratedProtocolMessageType('DcnSlackSummary', (_message.Message,), {
40
- 'DESCRIPTOR' : _DCNSLACKSUMMARY,
41
- '__module__' : 'plugin.tensorboard_plugin_profile.protobuf.dcn_slack_analysis_pb2'
42
- # @@protoc_insertion_point(class_scope:tensorboard_plugin_profile.DcnSlackSummary)
43
- })
44
- _sym_db.RegisterMessage(DcnSlackSummary)
45
-
46
- DcnSlackAnalysis = _reflection.GeneratedProtocolMessageType('DcnSlackAnalysis', (_message.Message,), {
47
- 'DESCRIPTOR' : _DCNSLACKANALYSIS,
48
- '__module__' : 'plugin.tensorboard_plugin_profile.protobuf.dcn_slack_analysis_pb2'
49
- # @@protoc_insertion_point(class_scope:tensorboard_plugin_profile.DcnSlackAnalysis)
50
- })
51
- _sym_db.RegisterMessage(DcnSlackAnalysis)
52
-
18
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
19
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'plugin.tensorboard_plugin_profile.protobuf.dcn_slack_analysis_pb2', globals())
53
20
  if _descriptor._USE_C_DESCRIPTORS == False:
54
21
 
55
22
  DESCRIPTOR._options = None
@@ -2,10 +2,9 @@
2
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
3
3
  # source: plugin/tensorboard_plugin_profile/protobuf/diagnostics.proto
4
4
  """Generated protocol buffer code."""
5
+ from google.protobuf.internal import builder as _builder
5
6
  from google.protobuf import descriptor as _descriptor
6
7
  from google.protobuf import descriptor_pool as _descriptor_pool
7
- from google.protobuf import message as _message
8
- from google.protobuf import reflection as _reflection
9
8
  from google.protobuf import symbol_database as _symbol_database
10
9
  # @@protoc_insertion_point(imports)
11
10
 
@@ -16,16 +15,8 @@ _sym_db = _symbol_database.Default()
16
15
 
17
16
  DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n<plugin/tensorboard_plugin_profile/protobuf/diagnostics.proto\x12\x13tensorflow.profiler\"=\n\x0b\x44iagnostics\x12\x0c\n\x04info\x18\x01 \x03(\t\x12\x10\n\x08warnings\x18\x02 \x03(\t\x12\x0e\n\x06\x65rrors\x18\x03 \x03(\tb\x06proto3')
18
17
 
19
-
20
-
21
- _DIAGNOSTICS = DESCRIPTOR.message_types_by_name['Diagnostics']
22
- Diagnostics = _reflection.GeneratedProtocolMessageType('Diagnostics', (_message.Message,), {
23
- 'DESCRIPTOR' : _DIAGNOSTICS,
24
- '__module__' : 'plugin.tensorboard_plugin_profile.protobuf.diagnostics_pb2'
25
- # @@protoc_insertion_point(class_scope:tensorflow.profiler.Diagnostics)
26
- })
27
- _sym_db.RegisterMessage(Diagnostics)
28
-
18
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
19
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'plugin.tensorboard_plugin_profile.protobuf.diagnostics_pb2', globals())
29
20
  if _descriptor._USE_C_DESCRIPTORS == False:
30
21
 
31
22
  DESCRIPTOR._options = None
@@ -2,10 +2,9 @@
2
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
3
3
  # source: plugin/tensorboard_plugin_profile/protobuf/input_pipeline.proto
4
4
  """Generated protocol buffer code."""
5
+ from google.protobuf.internal import builder as _builder
5
6
  from google.protobuf import descriptor as _descriptor
6
7
  from google.protobuf import descriptor_pool as _descriptor_pool
7
- from google.protobuf import message as _message
8
- from google.protobuf import reflection as _reflection
9
8
  from google.protobuf import symbol_database as _symbol_database
10
9
  # @@protoc_insertion_point(imports)
11
10
 
@@ -18,72 +17,8 @@ from tensorboard_plugin_profile.protobuf import diagnostics_pb2 as plugin_dot_te
18
17
 
19
18
  DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n?plugin/tensorboard_plugin_profile/protobuf/input_pipeline.proto\x12\x13tensorflow.profiler\x1a\x19google/protobuf/any.proto\x1a<plugin/tensorboard_plugin_profile/protobuf/diagnostics.proto\"\x80\x03\n\x12\x42ottleneckAnalysis\x12\x15\n\rinput_percent\x18\x07 \x01(\x01\x12\x16\n\x0eoutput_percent\x18\x08 \x01(\x01\x12\x14\n\x0cidle_percent\x18\t \x01(\x01\x12\x17\n\x0f\x63ompute_percent\x18\n \x01(\x01\x12\x1c\n\x14input_classification\x18\x01 \x01(\t\x12\x17\n\x0finput_statement\x18\x02 \x01(\t\x12$\n\x1ckernel_launch_classification\x18\x03 \x01(\t\x12\x1f\n\x17kernel_launch_statement\x18\x04 \x01(\t\x12 \n\x18\x61ll_other_classification\x18\x05 \x01(\t\x12\x1b\n\x13\x61ll_other_statement\x18\x06 \x01(\t\x12)\n!device_collectives_classification\x18\x0b \x01(\t\x12$\n\x1c\x64\x65vice_collectives_statement\x18\x0c \x01(\t\"\\\n\x0bStepSummary\x12\x0f\n\x07\x61verage\x18\x01 \x01(\x01\x12\x1a\n\x12standard_deviation\x18\x02 \x01(\x01\x12\x0f\n\x07minimum\x18\x03 \x01(\x01\x12\x0f\n\x07maximum\x18\x04 \x01(\x01\"\xe0\x02\n\x15PerGenericStepDetails\x12\x13\n\x0bstep_number\x18\x01 \x01(\x05\x12\x11\n\tstep_name\x18\x0e \x01(\t\x12\x14\n\x0cstep_time_ms\x18\x02 \x01(\x01\x12\x17\n\x0funknown_time_ms\x18\x03 \x01(\x01\x12\x1a\n\x12host_wait_input_ms\x18\x0b \x01(\x01\x12\x19\n\x11host_to_device_ms\x18\x0c \x01(\x01\x12\x11\n\toutput_ms\x18\x05 \x01(\x01\x12\x19\n\x11\x64\x65vice_compute_ms\x18\x06 \x01(\x01\x12\x1b\n\x13\x64\x65vice_to_device_ms\x18\x07 \x01(\x01\x12\x1d\n\x15\x64\x65vice_collectives_ms\x18\r \x01(\x01\x12\x17\n\x0fhost_compute_ms\x18\x08 \x01(\x01\x12\x17\n\x0fhost_prepare_ms\x18\t \x01(\x01\x12\x17\n\x0fhost_compile_ms\x18\n \x01(\x01J\x04\x08\x04\x10\x05\"\xa5\x01\n\x12InputTimeBreakdown\x12\x1d\n\x15\x64\x65manded_file_read_us\x18\x01 \x01(\x01\x12\x1d\n\x15\x61\x64vanced_file_read_us\x18\x02 \x01(\x01\x12\x18\n\x10preprocessing_us\x18\x03 \x01(\x01\x12\x12\n\nenqueue_us\x18\x04 \x01(\x01\x12#\n\x1bunclassified_non_enqueue_us\x18\x05 \x01(\x01\"\xa6\x01\n\x0eInputOpDetails\x12\x0f\n\x07op_name\x18\x01 \x01(\t\x12\r\n\x05\x63ount\x18\x02 \x01(\x04\x12\x12\n\ntime_in_ms\x18\x03 \x01(\x01\x12\x17\n\x0ftime_in_percent\x18\x04 \x01(\x01\x12\x17\n\x0fself_time_in_ms\x18\x05 \x01(\x01\x12\x1c\n\x14self_time_in_percent\x18\x06 \x01(\x01\x12\x10\n\x08\x63\x61tegory\x18\x07 \x01(\t\"\x84\x01\n#InputPipelineAnalysisRecommendation\x12\x0f\n\x07\x64\x65tails\x18\x01 \x03(\t\x12\x31\n\x13\x62ottleneck_analysis\x18\x02 \x01(\x0b\x32\x14.google.protobuf.Any\x12\x19\n\x11summary_next_step\x18\x03 \x01(\t\"\x85\x06\n\x18GenericStepTimeBreakdown\x12\x41\n\x17unknown_time_ms_summary\x18\x01 \x01(\x0b\x32 .tensorflow.profiler.StepSummary\x12\x44\n\x1ahost_wait_input_ms_summary\x18\t \x01(\x0b\x32 .tensorflow.profiler.StepSummary\x12\x43\n\x19host_to_device_ms_summary\x18\n \x01(\x0b\x32 .tensorflow.profiler.StepSummary\x12:\n\x10input_ms_summary\x18\x0b \x01(\x0b\x32 .tensorflow.profiler.StepSummary\x12;\n\x11output_ms_summary\x18\x03 \x01(\x0b\x32 .tensorflow.profiler.StepSummary\x12\x43\n\x19\x64\x65vice_compute_ms_summary\x18\x04 \x01(\x0b\x32 .tensorflow.profiler.StepSummary\x12\x45\n\x1b\x64\x65vice_to_device_ms_summary\x18\x05 \x01(\x0b\x32 .tensorflow.profiler.StepSummary\x12G\n\x1d\x64\x65vice_collectives_ms_summary\x18\x0c \x01(\x0b\x32 .tensorflow.profiler.StepSummary\x12\x41\n\x17host_compute_ms_summary\x18\x06 \x01(\x0b\x32 .tensorflow.profiler.StepSummary\x12\x41\n\x17host_prepare_ms_summary\x18\x07 \x01(\x0b\x32 .tensorflow.profiler.StepSummary\x12\x41\n\x17host_compile_ms_summary\x18\x08 \x01(\x0b\x32 .tensorflow.profiler.StepSummaryJ\x04\x08\x02\x10\x03\"\x97\x05\n\x1bInputPipelineAnalysisResult\x12\x0b\n\x03tag\x18\x10 \x01(\x08\x12\x15\n\rhardware_type\x18\t \x01(\t\x12;\n\x11step_time_summary\x18\x02 \x01(\x0b\x32 .tensorflow.profiler.StepSummary\x12?\n\x15input_percent_summary\x18\x03 \x01(\x0b\x32 .tensorflow.profiler.StepSummary\x12\x15\n\rinput_percent\x18\x0b \x01(\x01\x12\x16\n\x0eoutput_percent\x18\r \x01(\x01\x12\x14\n\x0cidle_percent\x18\x0e \x01(\x01\x12\x17\n\x0f\x63ompute_percent\x18\x0f \x01(\x01\x12*\n\x0cstep_details\x18\x04 \x03(\x0b\x32\x14.google.protobuf.Any\x12\x45\n\x14input_time_breakdown\x18\x05 \x01(\x0b\x32\'.tensorflow.profiler.InputTimeBreakdown\x12=\n\x10input_op_details\x18\x06 \x03(\x0b\x32#.tensorflow.profiler.InputOpDetails\x12P\n\x0erecommendation\x18\x07 \x01(\x0b\x32\x38.tensorflow.profiler.InputPipelineAnalysisRecommendation\x12\x31\n\x13step_time_breakdown\x18\x08 \x01(\x0b\x32\x14.google.protobuf.Any\x12\x35\n\x0b\x64iagnostics\x18\x0c \x01(\x0b\x32 .tensorflow.profiler.DiagnosticsJ\x04\x08\x01\x10\x02J\x04\x08\n\x10\x0b\x62\x06proto3')
20
19
 
21
-
22
-
23
- _BOTTLENECKANALYSIS = DESCRIPTOR.message_types_by_name['BottleneckAnalysis']
24
- _STEPSUMMARY = DESCRIPTOR.message_types_by_name['StepSummary']
25
- _PERGENERICSTEPDETAILS = DESCRIPTOR.message_types_by_name['PerGenericStepDetails']
26
- _INPUTTIMEBREAKDOWN = DESCRIPTOR.message_types_by_name['InputTimeBreakdown']
27
- _INPUTOPDETAILS = DESCRIPTOR.message_types_by_name['InputOpDetails']
28
- _INPUTPIPELINEANALYSISRECOMMENDATION = DESCRIPTOR.message_types_by_name['InputPipelineAnalysisRecommendation']
29
- _GENERICSTEPTIMEBREAKDOWN = DESCRIPTOR.message_types_by_name['GenericStepTimeBreakdown']
30
- _INPUTPIPELINEANALYSISRESULT = DESCRIPTOR.message_types_by_name['InputPipelineAnalysisResult']
31
- BottleneckAnalysis = _reflection.GeneratedProtocolMessageType('BottleneckAnalysis', (_message.Message,), {
32
- 'DESCRIPTOR' : _BOTTLENECKANALYSIS,
33
- '__module__' : 'plugin.tensorboard_plugin_profile.protobuf.input_pipeline_pb2'
34
- # @@protoc_insertion_point(class_scope:tensorflow.profiler.BottleneckAnalysis)
35
- })
36
- _sym_db.RegisterMessage(BottleneckAnalysis)
37
-
38
- StepSummary = _reflection.GeneratedProtocolMessageType('StepSummary', (_message.Message,), {
39
- 'DESCRIPTOR' : _STEPSUMMARY,
40
- '__module__' : 'plugin.tensorboard_plugin_profile.protobuf.input_pipeline_pb2'
41
- # @@protoc_insertion_point(class_scope:tensorflow.profiler.StepSummary)
42
- })
43
- _sym_db.RegisterMessage(StepSummary)
44
-
45
- PerGenericStepDetails = _reflection.GeneratedProtocolMessageType('PerGenericStepDetails', (_message.Message,), {
46
- 'DESCRIPTOR' : _PERGENERICSTEPDETAILS,
47
- '__module__' : 'plugin.tensorboard_plugin_profile.protobuf.input_pipeline_pb2'
48
- # @@protoc_insertion_point(class_scope:tensorflow.profiler.PerGenericStepDetails)
49
- })
50
- _sym_db.RegisterMessage(PerGenericStepDetails)
51
-
52
- InputTimeBreakdown = _reflection.GeneratedProtocolMessageType('InputTimeBreakdown', (_message.Message,), {
53
- 'DESCRIPTOR' : _INPUTTIMEBREAKDOWN,
54
- '__module__' : 'plugin.tensorboard_plugin_profile.protobuf.input_pipeline_pb2'
55
- # @@protoc_insertion_point(class_scope:tensorflow.profiler.InputTimeBreakdown)
56
- })
57
- _sym_db.RegisterMessage(InputTimeBreakdown)
58
-
59
- InputOpDetails = _reflection.GeneratedProtocolMessageType('InputOpDetails', (_message.Message,), {
60
- 'DESCRIPTOR' : _INPUTOPDETAILS,
61
- '__module__' : 'plugin.tensorboard_plugin_profile.protobuf.input_pipeline_pb2'
62
- # @@protoc_insertion_point(class_scope:tensorflow.profiler.InputOpDetails)
63
- })
64
- _sym_db.RegisterMessage(InputOpDetails)
65
-
66
- InputPipelineAnalysisRecommendation = _reflection.GeneratedProtocolMessageType('InputPipelineAnalysisRecommendation', (_message.Message,), {
67
- 'DESCRIPTOR' : _INPUTPIPELINEANALYSISRECOMMENDATION,
68
- '__module__' : 'plugin.tensorboard_plugin_profile.protobuf.input_pipeline_pb2'
69
- # @@protoc_insertion_point(class_scope:tensorflow.profiler.InputPipelineAnalysisRecommendation)
70
- })
71
- _sym_db.RegisterMessage(InputPipelineAnalysisRecommendation)
72
-
73
- GenericStepTimeBreakdown = _reflection.GeneratedProtocolMessageType('GenericStepTimeBreakdown', (_message.Message,), {
74
- 'DESCRIPTOR' : _GENERICSTEPTIMEBREAKDOWN,
75
- '__module__' : 'plugin.tensorboard_plugin_profile.protobuf.input_pipeline_pb2'
76
- # @@protoc_insertion_point(class_scope:tensorflow.profiler.GenericStepTimeBreakdown)
77
- })
78
- _sym_db.RegisterMessage(GenericStepTimeBreakdown)
79
-
80
- InputPipelineAnalysisResult = _reflection.GeneratedProtocolMessageType('InputPipelineAnalysisResult', (_message.Message,), {
81
- 'DESCRIPTOR' : _INPUTPIPELINEANALYSISRESULT,
82
- '__module__' : 'plugin.tensorboard_plugin_profile.protobuf.input_pipeline_pb2'
83
- # @@protoc_insertion_point(class_scope:tensorflow.profiler.InputPipelineAnalysisResult)
84
- })
85
- _sym_db.RegisterMessage(InputPipelineAnalysisResult)
86
-
20
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
21
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'plugin.tensorboard_plugin_profile.protobuf.input_pipeline_pb2', globals())
87
22
  if _descriptor._USE_C_DESCRIPTORS == False:
88
23
 
89
24
  DESCRIPTOR._options = None