Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tensorboard/plugins/profile/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ py_binary(
"profile_demo.py",
"profile_demo_data.py",
],
data = ["profile_demo.op_profile.json"],
srcs_version = "PY2AND3",
deps = [
":profile_plugin",
Expand Down
96 changes: 96 additions & 0 deletions tensorboard/plugins/profile/profile_demo.op_profile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this expected? I see nothing in the parentheses.

knxthhfajij

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, "is overhead, and a good target for optimization" is a dangling half-sentence. I think something might be missing there.

"byCategory": {
"name": "byCategory",
"metrics": {
"time": 1,
"flops": 0.4
},
"children": [{
"name": "Good ops",
"metrics": {
"time": 0.6,
"flops": 0.4
},
"category": {},
"children": [{
"name": "%convolution",
"metrics": {
"time": 0.2,
"flops": 0.18
},
"xla": {
"op": "convolution",
"expression": "%convolution = something",
"provenance": "Convolution2D",
"category": "Good ops",
"layout": {"dimensions":[{
"size": 200,
"alignment": 128,
"semantics": "feature"
}, {
"size": 8,
"alignment": 8,
"semantics": "batch"
}, {
"size": 256,
"alignment": 0,
"semantics": "spatial"
}]}
},
"children": []
}, {
"name": "%fusion",
"metrics": {
"time": 0.4,
"flops": 0.22
},
"xla": {
"op": "fusion:kOutput",
"expression": "%fusion = something",
"provenance": "",
"category": "Good ops"
},
"children": [{
"name": "%dot.1",
"xla": {
"op": "dot",
"expression": "%dot.1 = something",
"provenance": "TfOpForFusedDot",
"category": "Good ops"
},
"children": []
}, {
"name": "%dot.2",
"xla": {
"op": "dot",
"expression": "%dot.2 = something",
"provenance": "",
"category": "Good ops"
},
"children": []
}]
}]
}, {
"name": "Overhead",
"metrics": {
"time": 0.4,
"flops": 0
},
"category": {},
"children": [{
"name": "%infeed",
"metrics": {
"time": 0.4,
"flops": 0
},
"xla": {
"op": "infeed",
"expression": "%infeed = something",
"provenance": "",
"category": "Overhead"
},
"children": []
}]
}]
}
}
3 changes: 3 additions & 0 deletions tensorboard/plugins/profile/profile_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from __future__ import print_function

import os
import shutil
import tensorflow as tf

from google.protobuf import text_format
Expand Down Expand Up @@ -59,6 +60,8 @@ def dump_data(logdir):
proto = trace_events_pb2.Trace()
text_format.Merge(profile_demo_data.TRACES[run], proto)
f.write(proto.SerializeToString())
shutil.copyfile('tensorboard/plugins/profile/profile_demo.op_profile.json',
os.path.join(run_dir, 'op_profile.json'))

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