Commit ea72dd6c authored by Igor Ganichev's avatar Igor Ganichev Committed by TensorFlower Gardener
Browse files

Add EagerTensor profiler and device shape utilities

This change includes the following steps to make
EagerTensor profiler work:
 - Add a PaddedShapeFn to XlaDevice::Metadata. We need a
   backend-independent way to get a fully-padded shape and
   its layout on the device. This function is set during
   device construction. CPU and GPU devices effectively get
   an identity function since they neither change the layout
   nor pad. TPU gets the appropriate function.
 - Add TFE_TensorDebugInfo struct and C API methods for it.
   These methods are necessary to fetch the shape and layout
   from under the C API to the Python level. This can be a home
   for more debug information later.
 - Make EagerTensor weak referencable. This involves adding a
   pointer to the list of current weak references. This addition
   should have negligible overhead when profiler is not used.
   The only operations on this field are setting it to null on
   construction and checking if it is null on destruction.
 - Adding C++ functions callable from Python to register an instance
   of EagerTensorProfiler and retrieve debug information for a given
   EagerTensor. These functions are used in the new "inspect" module.
 - Finally, writing the actual profiler.

PiperOrigin-RevId: 198098380
parent a6369634
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment