Search code examples
gpflow

How do I profile my code in GPflow2? What happened to dump_timeline and gpflowrc?


I am trying profiling my code in GPflow 2 as I need to know which part of my code consumes the most CPU time. In GPflow 1 there was a gpflowrc file where you could set dump_timeline = True but this has changed in GPflow 2 (to the gpflow.config module) and I can't find a similar option in there.


Solution

  • Working with TensorFlow 2 is much simpler than TensorFlow 1, so with GPflow 2 we're relying a lot more on TensorFlow built-ins instead of adding extra code - GPflow 2 is "just another TensorFlow graph". So you should be able to directly use the TensorFlow profiler: see this blog post for an introduction and the guide in the TensorFlow documentation for more details.

    (According to https://github.com/tensorflow/tensorboard/issues/2874, TensorBoard's "Trace Viewer" for the timeline should now work fine in Firefox, but if you encounter any issues on the visualization side it's worth trying out Chrome.)