tpu-info is a command-line interface (CLI) tool designed for detecting Cloud TPU devices and extracting runtime metrics from the `libtpu` library. These metrics include memory usage and duty cycle, providing insights into TPU utilization. It supports both static, one-time snapshots and a live streaming mode for continuous monitoring. The current version is 0.10.0, released on March 17, 2026, indicating an active development and release cadence.
pip install tpu-infoNo compatibility data collected yet for this library.
To use `tpu-info`, you must have an active workload running on your Cloud TPU with a supported machine learning framework (e.g., JAX or PyTorch/XLA). Once a workload is active, simply execute `tpu-info` in your terminal to get a one-time snapshot of the metrics. You can add the `--streaming` flag for continuous monitoring.
Start a machine learning workload on your TPU using a compatible framework (e.g., `import jax; _ = jax.numpy.ones((large_size, large_size))` or `import torch_xla; _ = torch.randn(..., device=torch_xla.device())`) before running `tpu-info`.
Regularly update `tpu-info` to the latest version using `pip install --upgrade tpu-info`. Ensure your `libtpu` installation is also up-to-date and compatible with your environment by checking `tpu-info --version` output.
Upgrade to `tpu-info` version 0.8.1 or newer (`pip install --upgrade tpu-info`) to resolve the `DeprecationWarning` in Python 3.11 and later environments.
Install the `tpu-info` package using `pip install tpu-info` and ensure your user's script directory (e.g., `~/.local/bin`) is in your PATH.
Ensure `libtpu.so` is installed and its path is included in the `LD_LIBRARY_PATH` environment variable, typically by setting up a correct JAX/TPU environment.
Verify that a TPU device is properly provisioned and accessible from your environment (e.g., running in a TPU VM or a container configured for TPU access).
Ensure the user has appropriate permissions to interact with TPU resources; if on a system with direct hardware access, this might involve running with `sudo` or adding the user to a specific group.