tpu-info
CLI tool to view TPU metrics
Description
tpu-info CLI
tpu-info is a simple CLI tool for detecting Cloud TPU devices and reading
runtime metrics from libtpu, including memory usage and duty cycle. It
supports both a static, one-time snapshot and a live streaming mode to monitor
metrics continuously.
Note: to access libtpu utilization metrics, you must have a workload
running with a supported ML framework, such as JAX or PyTorch/XLA. See the
Usage section for more information.
What's New in Version 0.8.1
๐ New Features
- Metrics
hlo_exec_timing&hlo_queue_sizeintroduced in0.8.0work for some older versions oflibtpu- It is still recommended to update to most recent
libtpuversion for full support in all metrics available intpu-info
- It is still recommended to update to most recent
- Addresses a
DeprecationWarningin Python 3.11+ related to classes inenum.
Installing
Install the latest release using pip:
pip install tpu-info
Alternatively, install tpu-info from source:
pip install git+https://github.com/google/cloud-accelerator-diagnostics/#subdirectory=tpu_info
Usage
To view current TPU utilization data, tpu-info requires a running TPU workload
with supported ML framework[^1] such as JAX or PyTorch/XLA. For example:
# JAX
>>> import jax
>>> jax.device_count()
4
# Create a tensor on the TPU
>>> t = jax.numpy.ones((300, 300))
# PyTorch/XLA
>>> import torch
>>> import torch_xla
>>> t = torch.randn((300, 300), device=torch_xla.device())
Then, on the same machine, you can run the tpu-info command in your terminal.
Static Mode
Run the following command for a one-time snapshot of the current metrics.
$ tpu-info
Libtpu version: 0.0.19.dev20250721+nightly
Accelerator type: v6e
TPU Chips
โโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโณโโโโโโโโโโณโโโโโโโโโ
โ Chip โ Type โ Devices โ PID โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ /dev/vfio/0 โ TPU v6e chip โ 1 โ 1052 โ
โ /dev/vfio/1 โ TPU v6e chip โ 1 โ 1052 โ
โ /dev/vfio/2 โ TPU v6e chip โ 1 โ 1052 โ
โ /dev/vfio/3 โ TPU v6e chip โ 1 โ 1052 โ
โโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโ
TPU Runtime Utilization
โโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโ
โ Chip โ HBM usage โ Duty cycle โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ 8 โ 18.45 GiB / 31.25 GiB โ 100.00% โ
โ 9 โ 10.40 GiB / 31.25 GiB โ 100.00% โ
โ 12 โ 10.40 GiB / 31.25 GiB โ 100.00% โ
โ 13 โ 10.40 GiB / 31.25 GiB โ 100.00% โ
โโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโ
TensorCore Utilization
โโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Core ID โ TensorCore Utilization โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ 0 โ 13.60%โ
โ 1 โ 14.81%โ
โ 2 โ 14.36%โ
โ 3 โ 13.60%โ
โโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโ
TPU Buffer Transfer Latency
โโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโ
โ Buffer Size โ P50 โ P90 โ P95 โ P999 โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ 8MB+ โ 108978.82 us โ 164849.81 us โ 177366.42 us โ 212419.07 us โ
โ 4MB+ โ 21739.38 us โ 38126.84 us โ 42110.12 us โ 55474.21 us โ
โโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโ
TPU gRPC TCP Minimum RTT
โโโโโโโโโโโโณโโโโโโโโโโโณโโโโโโโโโโโณโโโโโโโโโโโ
โ P50 โ P90 โ P95 โ P999 โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ 35.99 us โ 52.15 us โ 53.83 us โ 55.51 us โ
โโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโ
TPU gRPC TCP Delivery Rate
โโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโ
โ P50 โ P90 โ P95 โ P999 โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ 12305.96 Mbps โ 18367.10 Mbps โ 24872.11 Mbps โ 44841.55 Mbps โ
โโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโ
Streaming Mode
You can run tpu-info in a streaming mode to periodically refresh and display
the utilization statistics.
# Refresh stats every 2 seconds
tpu-info --streaming --rate 2
Refresh rate: 0.1s
Last update: 2025-07-24 11:00:59 UTC
Libtpu version: 0.0.19.dev20250721+nightly
Accelerator type: v6e
TPU Chips
โโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโณโโโโโโโโโโณโโโโโโโโโ
โ Chip โ Type โ Devices โ PID โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโขโโโโโโโโโโขโโโโโโโโโช
โ /dev/vfio/0 โ TPU v6e chip โ 1 โ 1022 โ
โ /dev/vfio/1 โ TPU v6e chip โ 1 โ 1022 โ
โ /dev/vfio/2 โ TPU v6e chip โ 1 โ 1022 โ
โ /dev/vfio/3 โ TPU v6e chip โ 1 โ 1022 โ
โโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโ
TPU Runtime Utilization
โโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโ
โ Chip โ HBM usage โ Duty cycle โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ 8 โ 17.26 GiB / 31.25 GiB โ 100.00% โ
โ 9 โ 9.26 GiB / 31.25 GiB โ 100.00% โ
โ 12 โ 9.26 GiB / 31.25 GiB โ 100.00% โ
โ 13 โ 9.26 GiB / 31.25 GiB โ 100.00% โ
โโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโ
TensorCore Utilization
โโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Core ID โ TensorCore Utilization โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ 0 โ 15.17%โ
โ 1 โ 14.62%โ
โ 2 โ 14.68%โ
โ 3 โ 15.14%โ
โโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโ
TPU Buffer Transfer Latency
โโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโ
โ Buffer Size โ P50 โ P90 โ P95 โ P999 โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ 8MB+ โ 18264.03 us โ 33263.06 us โ 35990.98 us โ 53997.32 us โ
โโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโ
TPU gRPC TCP Minimum RTT
โโโโโโโโโโโโณโโโโโโโโโโโณโโโโโโโโโโโณโโโโโโโโโโโ
โ P50 โ P90 โ P95 โ P999 โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ 35.99 us โ 52.15 us โ 53.83 us โ 55.51 us โ
โโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโโโ
TPU gRPC TCP Delivery Rate
โโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโ
โ P50 โ P90 โ P95 โ P999 โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ 12305.96 Mbps โ 18367.10 Mbps โ 24872.11 Mbps โ 44841.55 Mbps โ
โโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโ
Version
To check the installed version of tpu-info, libtpu version and accelerator
type of the TPU chip, use the --version or -v flag.
Compatible Environment:
$ tpu-info --version
- tpu-info version: 0.8.0
- libtpu version: 0.0.18
- accelerator type: v6e
Incompatible Environment (Python 3.12+):
$ tpu-info --version
- tpu-info version: 0.8.0
- libtpu version: N/A (incompatible environment)
- accelerator type: N/A (incompatible environment)
Process
You can use the --process or -p flag to display information about the
processes currently running on the TPU.
$ tpu-info --process
TPU Process Info
โโโโโโโโโโโโโโโณโโโโโโโโโณโโโโโโโโโโโโโโโ
โ Chip โ PID โ Process Name โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ /dev/vfio/0 โ 799657 โ python3 โ
โ /dev/vfio/1 โ 799657 โ python3 โ
โ /dev/vfio/2 โ 799657 โ python3 โ
โ /dev/vfio/3 โ 799657 โ python3 โ
โ /dev/vfio/4 โ 799657 โ python3 โ
โ /dev/vfio/5 โ 799657 โ python3 โ
โ /dev/vfio/6 โ 799657 โ python3 โ
โ /dev/vfio/7 โ 799657 โ python3 โ
โโโโโโโโโโโโโโโดโโโโโโโโโดโโโโโโโโโโโโโโโ
List Metrics
You can use the --list_metrics flag to display all supported metrics that can
be given along with the --metric flag.
$ tpu-info --list_metrics
โญโ Supported Metrics โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ buffer_transfer_latency โ
โ collective_e2e_latency โ
โ core_state โ
โ device_to_host_transfer_latency โ
โ duty_cycle_percent โ
โ grpc_tcp_delivery_rate โ
โ grpc_tcp_min_rtt โ
โ hbm_usage โ
โ hlo_exec_timing โ
โ hlo_queue_size โ
โ host_to_device_transfer_latency โ
โ queued_programs โ
โ sequencer_state โ
โ sequencer_state_detailed โ
โ tensorcore_utilization