JAXBench: Bridging the "Pallas Gap" in Autonomous TPU Kernel Optimization

JAXBench: Benchmarking Autonomous TPU Kernel Optimization

Arya Tschand, Charles Hong, Julian Walker, Nina Cai, Shangkun Wang, Suvinay Subramanian, Sundar Dev, Vijay Reddi, Amir Yazdanbakhsh, Sethu Sankaran
Summary
Problem
Method
Results
Takeaways
Abstract

JAXBench is a TPU-native benchmark suite designed for the autonomous optimization of AI-generated kernels. It comprises 50 JAX workloads, including 17 production-scale LLM operators (e.g., Llama-3.1, Mamba-2) and 33 fused operators, evaluated on Google Cloud TPU v6e using the Pallas DSL to outperform XLA-compiled baselines.

TL;DR

While GPU kernel optimization has seen a surge in automated benchmarking, TPUs have remained a "black box" for AI agents. JAXBench introduces the first rigorous, TPU-native benchmark suite of 50 workloads (including Llama-3.1 and AlphaFold2 operators). The core finding? Providing LLMs with target-specific hardware context is more effective than simply increasing model size, enabling agents to outperform XLA-compiled code by 1.36× on average.

Problem: The GPU-Centric Bias of AI Systems

Most modern AI-for-Systems research gravitates toward NVIDIA's ecosystem. Tools like Triton and CUDA have massive footprints in training corpora, allowing LLMs to "hallucinate" functional kernels reasonably well.

TPUs, however, operate on a different physical intuition:

  • Sequential vs. Parallel: Unlike the SIMT model of GPUs, TPUs are sequential machines with wide SIMD vectors and systolic Matrix Multiply Units (MXUs).
  • The Pallas DSL: Pallas, the low-level language for TPUs, is rarely seen in public codebases compared to CUDA.
  • Physical Constraints: Factors like VMEM/HBM hierarchies and lexicographic grid traversal make generic code generation fail at the compilation stage.

Methodology: High-Fidelity Benchmarking

JAXBench doesn't just evaluate "toy" problems. It targets the compute-bound regime where optimization actually matters for production.

1. Workload Composition

The suite consists of:

  • 17 Priority Kernels: Extracted from MaxText (Google's production library), featuring FlashAttention, GQA, and Mamba-2.
  • 33 Fused Operators: Translated from KernelBench, but resized to ensure 60-95% MXU utilization on TPU v6e (Trillium).

2. The Agent Framework (Autocomp)

The researchers evaluated several methods, but the standout was Autocomp, which utilizes a two-phase "Translate then Optimize" beam search. It injects a "Context Artifact" into the prompt:

  • 8KB Hardware summary.
  • 115KB Pallas API/ISA reference.
  • Annotated code examples and correctness rules.

JAXBench Overview Figure 1: The JAXBench evaluation harness workflow, from reference JAX workload to profiled Pallas kernel.

Experiments & Results: Context is King

The study compared Best-of-N, Iterative Refinement, and Autocomp using Gemini 3 Flash and 3.1 Pro.

The Breakdown of Success

  • Correctness Jump: Simply adding documentation (Iterative + Context) raised correctness from a dismal 5.8% to 37.3%.
  • Performance vs. XLA: Autocomp achieved a 1.36× geomean speedup over XLA. On a subset of hand-tuned kernels from the Tokamax library, it recovered most of the performance gap, trailing only on highly specialized ragged/paged attention operators.

Performance Comparison Figure 2: Performance trajectory showing how Autocomp's search strategy converts correctness into wall-clock speedups.

The "Model Scale" Illusion

In an ablation study using Gemini 3.1 Pro, the researchers found that while a larger model improves the "prior" knowledge of Pallas, it still cannot match a smaller model (Flash) that has been provided with the correct hardware context and a structured search algorithm.

Critical Analysis & Conclusion

Takeaway

JAXBench proves that for specialized hardware optimization, information is the bottleneck, not just reasoning. If the agent doesn't know the specific tiling constraints of a TPU v6e MXU, no amount of iterative feedback will help it "guess" the right memory-space annotation.

Limitations & Future Work

  • Single-Chip Limit: The current benchmark focuses on single TPU chips. The next frontier is multi-chip collective communication (sharding and pipelining), which is even more sparsely documented.
  • Expert Gap: Agents still struggle with complex control flows like PageAttention, where human-written scheduling is significantly more efficient.

Conclusion: JAXBench provides the necessary "hill-climbing" target for the next generation of TPU-resident AI agents. By open-sourcing the harness and baselines, the authors have set the stage for LLMs to move beyond GPU-centricity and into the heart of the AI Hypercomputer.

Find Similar Papers

Try Our Examples

  • Search for recent papers on LLM-based code generation specifically targeting sparsely documented or domain-specific languages (DSLs) in high-performance computing.
  • What are the architectural differences between the Mosaic backend used by Pallas and the Triton compiler for GPUs, and how do they impact automated kernel optimization?
  • Explore research applying agentic feedback loops or reinforcement learning to multi-chip collective communication optimization in XLA or similar ML compilers.
Contents
JAXBench: Bridging the "Pallas Gap" in Autonomous TPU Kernel Optimization
1. TL;DR
2. Problem: The GPU-Centric Bias of AI Systems
3. Methodology: High-Fidelity Benchmarking
3.1. 1. Workload Composition
3.2. 2. The Agent Framework (Autocomp)
4. Experiments & Results: Context is King
4.1. The Breakdown of Success
4.2. The "Model Scale" Illusion
5. Critical Analysis & Conclusion
5.1. Takeaway
5.2. Limitations & Future Work