6

I am trying to visualize the performance of tf.data.Datasets using TF2.0 (Beta). I found examples on how to use profiler in older versions of tensorflow. How is profiling done in TF2.0? I could use tf.compat.v1, but the procedure does not seem to be straight forward.

I want to measure memory consumption (device placement wise) and timeline.

Below examples explain profiling with TF1.x Can I measure the execution time of individual operations with TensorFlow?

Understanding tensorflow profiling results

yuva-rajulu
  • 406
  • 5
  • 13

1 Answers1

3

Meanwhile, I found solution to my question: Using the trace_on and trace_export around my training step to get the profiler output, as described here Example Profile

yuva-rajulu
  • 406
  • 5
  • 13
  • 1
    Do you remember who you got the chrome tracing tool working? With the instructions I get a profiling output consisting of the regular TB `events.out.tfevents....` files, a similar named `events.out.*.profile-empty` and `plugins/profile/{timestamp}/local.trace`. The last one seems like the one I am looking for, however chrome won't load it into the tracing tool. Any help/hint would be appreciated! – David S. Jan 20 '20 at 17:27
  • @DavidS. the tracing tool is currently broken on chrome 80+. See https://github.com/tensorflow/tensorboard/issues/3209#issuecomment-584292018 – Luke Feb 11 '20 at 17:13
  • @DavidS. Sorry that I missed your message. I used chrome version 75.0.3770.100 and it worked fine. Profiling records a lot of information, I've seen that recording for too long or larger computations takes times to load on chrome. or sometimes hangs. Hope this helps! Luke: Thanks for your hint. – yuva-rajulu Feb 13 '20 at 15:44
  • The link in the answer went dead. Is there another version? – Michael Litvin Mar 09 '22 at 13:33
  • 1
    @MichaelLitvin Here is the link for TF v2.8.0: https://www.tensorflow.org/api_docs/python/tf/summary/trace_on further, you can find in the relevant api_docs for your specific version as well. – yuva-rajulu Mar 15 '22 at 15:49