Skip to content

Commit 8bee492

Browse files
Xiao Yuwchargin
authored andcommitted
profile: update demo data to include trace-only run (#1942)
Summary: We make this change because we have a bug in profile plugin that will be triggered if logdir only contains trace data. Test Plan: Remove any old profile demo data, then regenerate the data and launch TensorBoard: ``` $ rm -rf /tmp/profile_demo/ $ bazel run //tensorboard/plugins/profile:profile_demo $ bazel run //tensorboard -- --logdir /tmp/profile_demo ``` Prior to this commit, this would have _appeared_ to work; now, it hangs on the “Processing datasets” screen. Fix to come shortly.
1 parent 387d52f commit 8bee492

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

tensorboard/plugins/profile/profile_demo.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,16 @@ def dump_data(logdir):
8181
proto = trace_events_pb2.Trace()
8282
text_format.Merge(profile_demo_data.TRACES[run], proto)
8383
f.write(proto.SerializeToString())
84-
shutil.copyfile('tensorboard/plugins/profile/profile_demo.op_profile.json',
85-
os.path.join(run_dir, 'op_profile.json'))
86-
shutil.copyfile(
87-
'tensorboard/plugins/profile/profile_demo.memory_viewer.json',
88-
os.path.join(run_dir, 'memory_viewer.json'))
89-
shutil.copyfile(
90-
'tensorboard/plugins/profile/profile_demo.google_chart_demo.json',
91-
os.path.join(run_dir, 'google_chart_demo.json'))
84+
85+
if run not in profile_demo_data.TRACE_ONLY:
86+
shutil.copyfile('tensorboard/plugins/profile/profile_demo.op_profile.json',
87+
os.path.join(run_dir, 'op_profile.json'))
88+
shutil.copyfile(
89+
'tensorboard/plugins/profile/profile_demo.memory_viewer.json',
90+
os.path.join(run_dir, 'memory_viewer.json'))
91+
shutil.copyfile(
92+
'tensorboard/plugins/profile/profile_demo.google_chart_demo.json',
93+
os.path.join(run_dir, 'google_chart_demo.json'))
9294

9395
# Unsupported tool data should not be displayed.
9496
run_dir = os.path.join(plugin_logdir, 'empty')

tensorboard/plugins/profile/profile_demo_data.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
RUNS = ['foo', 'bar']
2222

23+
TRACE_ONLY = ['foo']
24+
2325

2426
TRACES = {}
2527

0 commit comments

Comments
 (0)