Skip to main content

TPU Monitoring Dashboard

Project description

TPU-TOP

A modern, terminal-based monitoring dashboard for Google Cloud TPUs, designed to give you real-time visibility into your machine's performance.

PyPI version GitHub Repository | PyPI Project

Project Overview

tpu-top provides a visual, interactive TUI (Terminal User Interface) to monitor system and TPU resources. It is specifically tailored for high-performance computing environments like GKE (Google Kubernetes Engine) where deep learning models are trained on TPUs.

tpu-top UI

Key Features

  • Responsive Layout: Automatically switches between 2x2 grid and 1x4 list for graphs based on terminal height.
  • Priority-Based Rendering: Dynamically shrinks or drops panels (Processes panel shrinks first) to fit severe vertical constraints.
  • Device Status Table: Detailed per-device breakdown showing duty cycle and memory usage. Compact 1-line layout for single-core TPUs (v6e) and multi-line for multi-core (v7).
  • Process Monitor: Lists active processes, prioritized by TPU processes (sorted by TPU index) and then CPU processes (sorted by memory usage).
  • Google Brand Styling: Color-coded graphs using Google's signature color palette (Blue, Red, Yellow, Green).
  • Version Awareness: Displays tpu-top, libtpu, and tpu-info versions directly in the header alongside detected TPU generation.

Installation

From PyPI (Recommended)

pip install tpu-top

From Source

You can also install tpu-top directly from the source directory.

Prerequisites

Ensure you have Python 3.12+ and access to a Cloud TPU environment. The tool relies on tpu-info to communicate with the TPU driver.

Standard Source Install

Navigate to the project root directory and run:

pip install .

Developer Install

If you are making modifications and want them to reflect immediately:

pip install -e .

How to Use

Once installed, you can launch the dashboard from anywhere in your terminal:

tpu-top

Environment Variables

  • TPU_TOP_MOCK=1: Force mock mode for testing on machines without physical TPUs.
  • TPU_TOP_ITERATIONS=N: Run for exactly N refresh cycles and exit (useful for automated tests).

Running Tests

To validate changes, run the unit tests:

python -m unittest test_main.py

(Note: If testing inside a GKE container, ensure dependencies are installed in your target environment).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tpu_top-0.1.3.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tpu_top-0.1.3-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file tpu_top-0.1.3.tar.gz.

File metadata

  • Download URL: tpu_top-0.1.3.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for tpu_top-0.1.3.tar.gz
Algorithm Hash digest
SHA256 e627910287f06d5a4d0c51f4738e3dbbc74fa08c7a6ed968fe4bae5e502629b2
MD5 129b4441c5c60b80f9b461a1807489b9
BLAKE2b-256 1b08a2f269ef04dcd8523ce931052765b09b0e3345f91c09d1615f3186badd77

See more details on using hashes here.

File details

Details for the file tpu_top-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: tpu_top-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for tpu_top-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 27201c0765ca4dc5512f37bb4e352770fa39ae2ef41d34b894cff2e5c26229f7
MD5 7b2fb73c819ad6854a1cec7b1c8f2936
BLAKE2b-256 0df3a97f986e4e4493dbb6ec77d86c9d955da42cf3c1a153ff7f7a1d008c93e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page