Save the date! Google I/O returns May 18-20 Register now


View source on GitHub

Sends grpc requests to profiler server to perform on-demand monitoring.

The monitoring result is a light weight performance summary of your model execution. This method will block the caller thread until it receives the monitoring result. This method currently supports Cloud TPU only.

service_addr gRPC address of profiler service e.g. grpc://
duration_ms Duration of monitoring in ms.
level Choose a monitoring level between 1 and 2 to monitor your job. Level 2 is more verbose than level 1 and shows more metrics.

A string of monitoring output.

Example usage:

Continuously send gRPC requests to the Cloud TPU to monitor the model


for query in range(0, 100):
  print(tf.profiler.experimental.client.monitor('grpc://', 1000))