TPUMS: TPU Microbenchmark Suite
TPUMS (TPU Microbenchmark Suite) is a modular, high-fidelity benchmarking and profiling framework designed to evaluate the compute, memory, and interconnect performance of Cloud TPUs (currently targeting tpu7x (ironwood) and v6e (trillium)) using JAX.
Important
Project Status — Active Development (Pre-Release): TPUMS is currently
under active development and has not yet reached an official stable release.
CLI flags, YAML configuration schemas, and reported metric names may evolve
prior to the first tagged release.
Overview
TPUMS provides a standardized, end-to-end benchmarking framework to measure, validate, and track the hardware performance of Cloud TPUs from single chips to multi-host topologies:
- Consistent, Reproducible Measurement: Eliminates measurement noise by automatically handling compilation warmup, device synchronization, and repeatable timing loops.
- Hardware-Accurate Roofline Insights: Captures both host wall-clock and on-device XProf hardware metrics, comparing achieved TFLOPS and GB/s directly against theoretical hardware limits (%).
- Flexible Sweeps & Structured Reporting: Runs single benchmarks,
interactive CLI parameter sweeps, or large YAML/CSV parameter sweeps and
exports structured CSV and JSON reports for dashboards and regression
tracking.
Core Capabilities Matrix
| Subsystem |
Benchmark Suite |
Operations & Scope |
Key Metrics Reported |
| Compute |
Matrix Multiplication (GEMM) |
Dense matrix multiplication ($$C = \alpha (A \times B) + \beta C$$) across configurable data types |
• Compute Throughput (TFLOPS) • Compute Roofline Efficiency (%) • Compute Latency (ms) |
| Memory (HBM) |
HBM Memory Bandwidth |
High Bandwidth Memory STREAM operations (Copy, Scale, Add, Triad, Read-Only, Write-Only) |
• Memory Bandwidth (GB/s) • Memory Roofline Efficiency (%) • Memory Access Latency (ms) |
| Host I/O (PCIe) |
Host-to-Device (H2D) Device-to-Host (D2H)
|
Host CPU memory to/from accelerator HBM data transfers |
• PCIe Transfer Bandwidth (GB/s) • Host Link Roofline Efficiency (%) • Transfer Latency (ms) |
| Interconnect (ICI) |
Device-to-Device (D2D) |
Data transfers between each device pair, over ICI (different chips) or die-to-die (same chip) |
• D2D Link Bandwidth (GB/s) • Pairwise N × N Device Bandwidth Matrix • Transfer Latency (ms) |
| Collectives |
All-Gather All-Reduce All-to-All
|
Distributed collective communication across multi-chip topologies |
• Collective Bus Bandwidth (GB/s) • Collective Step Latency (ms) |
⚡ Quickstart
Get up and running on your accelerator environment in seconds.
Prerequisites
- Hardware: A Cloud TPU VM or GKE TPU container (
tpu7x or v6e).
- Python: Python
3.12+.
1. Installation
Clone the repository and install in editable mode within your Python environment:
git clone https://github.com/AI-Hypercomputer/accelerator-microbenchmarks.git
cd accelerator-microbenchmarks
pip install -e .
2. Inspect Accelerator Hardware & Environment
Verify your TPU environment and detect active topology, chip count, and runtime libraries:
Example output on Cloud TPU tpu7x:
{
"tpu_type": "tpu7x",
"topology": "2x2x1",
"total_devices": 8,
"local_devices": 8,
"process_count": 1,
"process_index": 0,
"slice_count": 1,
"slice_index": 0,
"python_version": "3.12.14",
"jax_version": "0.10.1",
"jaxlib_version": "0.10.1",
"libtpu_version": "0.0.41"
}
3. Run Your First Benchmark
Execute an HBM memory bandwidth sweep across multiple array sizes (256 MiB to 2048 MiB total traffic) directly from the command line without writing any configuration files:
tpums benchmark run hbm --xprof_timing --op_type copy --num_elements 67108864 134217728 268435456 536870912 --dtype bfloat16 --scope device
4. Console Output Preview
TPUMS formats results into a clean, aligned summary banner:
================================================================================================================================================================================================================================================================================================================
Benchmark Results (HBMBandwidthBenchmark)
================================================================================================================================================================================================================================================================================================================
dtype op_type scope local_index num_devices num_elements data_size_mib wall_clock_p50_ms wall_clock_bandwidth_per_device_gb_s wall_clock_bandwidth_per_chip_gb_s wall_clock_bandwidth_per_host_gb_s xprof_p50_ms xprof_bandwidth_per_device_gb_s xprof_bandwidth_per_chip_gb_s xprof_bandwidth_per_host_gb_s
bfloat16 copy device 0 1 67108864 256.00 0.2788 962.86 - - 0.0835 3214.91 - -
bfloat16 copy device 0 1 134217728 512.00 0.3596 1492.96 - - 0.1669 3216.35 - -
bfloat16 copy device 0 1 268435456 1024.00 0.4889 2196.43 - - 0.3316 3238.06 - -
bfloat16 copy device 0 1 536870912 2048.00 0.8582 2502.18 - - 0.6642 3233.08 - -
================================================================================================================================================================================================================================================================================================================
🛠️ CLI Reference
The tpums executable provides a structured resource-action CLI organized into two functional categories:
- Discovery & Inspection Utilities:
tpums platform describe
tpums benchmark list
tpums benchmark run <benchmark_name> --help
- Benchmark Execution Modes:
tpums benchmark run (interactive single-benchmark or parameter sweep run)
tpums benchmark run-config (config-driven multi-case or parameter sweep run)
tpums
├── platform
│ └── describe # Query hardware topology, device count, and versions
└── benchmark
├── list # List all registered, production-ready benchmarks
├── run <benchmark_name> [options] # Mode 1: Run a single benchmark or interactive parameter sweep via CLI flags
└── run-config <path.yaml> # Mode 2: Run multi-case tests or parameter sweeps defined in YAML
1. Discovery & Environment Inspection
Query hardware topology, list available benchmarks, or inspect benchmark-specific CLI parameters before executing a run:
# 1. Query TPU hardware topology, chip count, and JAX/libtpu versions
tpums platform describe
# 2. List all registered, production-ready benchmarks
tpums benchmark list
tpums benchmark list --include_experimental # Also list experimental ones
# 3. Inspect typed CLI flags, per-field allowed choices (e.g. dtypes), and defaults
# tpums benchmark run <benchmark_name> --help
tpums benchmark run gemm --help
2. Interactive Benchmark & Sweep Runs (tpums benchmark run)
Execute benchmarks with typed arguments directly passed to the command line:
# 1. HBM Memory Bandwidth on Device 0 (STREAM copy kernel)
tpums benchmark run hbm --xprof_timing --op_type copy --num_elements 134217728 --dtype bfloat16 --scope device
# 2. Matrix Multiplication (GEMM 4096 x 4096 x 4096)
tpums benchmark run gemm --xprof_timing --m 4096 --k 4096 --n 4096 --in_dtype bfloat16 --out_dtype bfloat16
# 3. Host-to-Device (PCIe) Transfer Latency & Bandwidth on device 0 via tpu-sync
# (--transfer_backend jax|tpu_sync; --scope device|chip|host)
tpums benchmark run host_to_device --xprof_timing --data_size_mib 256 --dtype bfloat16 --transfer_backend tpu_sync --scope device --local_index 0
# 4. Device-to-Host (PCIe) Transfer Latency & Bandwidth on all local devices
tpums benchmark run device_to_host --xprof_timing --data_size_mib 256 --dtype bfloat16 --transfer_backend tpu_sync --scope host
# 5. Device-to-device (D2D) transfer across all pairs
tpums benchmark run device_to_device --xprof_timing --data_size 1GiB --direction uni --dtype bfloat16
# 6. Multi-Device All-Reduce Collective
# - tpu7x (2x2x1, 8 logical devices): --mesh_shape 2x2x2 --sharding_strategy 2x2x1
# - v6e (2x2, 4 logical devices): --mesh_shape 2x2 --sharding_strategy 2x2
tpums benchmark run all_reduce --xprof_timing --mesh_shape 2x2x2 --sharding_strategy 2x2x1 --matrix_dim 8192 --dtype bfloat16 --reduce_op sum
Interactive CLI Parameter Sweeps
Pass multiple space-separated values to any flag in tpums benchmark run to expand and run their Cartesian product in a single invocation:
# 1. Numeric + DType Sweep (HBM: 2 num_elements × 2 dtypes = 4 runs)
tpums benchmark run hbm --num_elements 134217728 268435456 --dtype bfloat16 float32
# 2. Enum + Integer Dimension Sweep (All-Reduce: 2 ops × 2 dims = 4 runs)
tpums benchmark run all_reduce --reduce_op sum max --matrix_dim 1024 2048
# 3. Boolean + Dimension Sweep (GEMM: 2 m × 2 n × 2 transpose_a = 8 runs)
tpums benchmark run gemm -m 1024 2048 -n 512 1024 --transpose_a true false
Note
CLI parameter sweeps are capped at 1,000 combinations per invocation.
3. Config-Driven Benchmark & Sweep Runs (tpums benchmark run-config)
Execute multi-case test lists, parameter sweeps, and profiling sessions defined in YAML:
tpums benchmark run-config configs/sample_configs/parameter_sweep.yaml \
--xprof_dir /tmp/tensorboard \
--output_dir results/
4. Common Execution Flags (run & run-config)