XProf introduces a Kernel Profiling suite for deep hardware-level debugging of custom TPU kernels written with Pallas, Mosaic, and Triton. It addresses the 'optimization blind spot' problem where traditional profilers treat custom compilation paths as opaque blocks. Key capabilities include: HLO Graph and MLIR inspection via debug flags to see how high-level code is compiled; Low-Level Operations (LLO) analysis providing cycle-level visibility into MXU, ALU, and memory unit utilization; and runtime performance counter sampling (available on TPU v7/Ironwood) that captures empirical hardware telemetry rather than relying on static cost models. A concrete example shows how triple buffering to overlap HBM memory loads with MXU compute reduced a matmul kernel runtime from 125.5µs to 88µs (~30% gain). XProf also introduces an External Event-Triggered profiling mode for sub-microsecond capture latency, supporting up to 28 hardware counters per core across four SparseCores.

7m read timeFrom opensource.googleblog.com
Post cover image
Table of contents
Deep visibility: HLO Graphs & MLIR InspectionTracing Instrumented Low-Level Operations (LLO) AnalysisRuntime Performance Counter SamplingOverall Utilization from Performance CountersAdvanced Sampling: Event-Triggered ProfilingGetting Started
40 Impressions