Down to the Metal: Profiling JAX & Pallas on TPU

Stop trusting wall-clock timers on TPUs! In the third episode of the Bielik on TPU series, we open up the hardware and compiler toolbox to see what actually happens on the TPU v5e chip when running native JAX and custom Pallas kernels for the Bielik 1.5B LLM.

In the first two episodes, we built a memory-bound RMSNorm kernel and an autotuned bfloat16 Matmul kernel on the MXU - but we measured both using Python wall-clock time. Today, we go down to the metal with headless JAX trace profiling and post-optimization XLA High-Level Optimizer (HLO) inspection to separate Python dispatch overhead from pure on-chip execution.

Key highlights covered:

Resources: