This library visualizes the runtime trace of TensorFlow.
Compare to built-in Chrome Tracing Format:
- Retains op execution details. (e.g., RecvTensor ops source and destination)
- Separates network ops from computing
- Faster Navigation
Example: timeline of Inception execution is available here.
- Collect Runtime metadata in TensorFlow:
from tfvis import Timeline ... with tf.train.MonitoredTrainingSession(...) as sess: ... with Timeline() as timeline: sess.run(train_op, **timeline.kwargs) ...
- Visualize:
... timeline.visualize("example.html") ...
Pass horovod=True
to Timeline
:
with Timeline(horovod=True) as timeline:
sess.run(train_op, **timeline.kwargs)
Use this:
with Timeline(horovod=True) as timeline:
sess.run(train_op, **timeline.kwargs)
timeline.to_pickle("example.pickle")
...
timeline.from_pickle("example.pickle", horovod=True)
It is supported experimentally, but has not been throughly tested.
Use this:
...
with tf.train.MonitoredTrainingSession(...) as sess:
...
run_metadata = tf.RunMetadata()
options = tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE)
sess.run(train_op, run_metadata=run_metadata, options=options)
...
Store:
import pickle
with open("example.pickle", "wb") as fp:
pickle.dump(run_metadata, fp)
Load and Visualize:
from tfvis import Timeline
Timeline.from_pickle("example.pickle").visualize("example.html")
@misc{Hashemi2018,
author = {Sayed Hadi Hashemi},
title = {TensorFlow Runtime Tracing Metadata Visualization},
year = {2018},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/xldrx/tensorflow-runtime-metadata-visualization}},
}