arXiv:2607.20466cs.AI2026-07

首个专为TPU设计的自动内核优化基准,助力AI提升计算效率。

JAXBench: Benchmarking Autonomous TPU Kernel Optimization

论文配图:JAXBench: Benchmarking Autonomous TPU Kernel Optimization
图 1 · 摘自论文原文
  • 构建50个JAX工作负载,覆盖主流大模型算子,适配TPU v6e高利用率
  • 引入高质量文档上下文后,正确率从5.8%升至37.3%,解决48个任务
  • 自动生成内核可实现1.36倍加速,适合研究TPU优化与自动化工具

严格的基准测试推动了自主GPU内核优化的发展,但针对TPU尚无类似体系。本文提出JAXBench,一个面向Google Cloud TPU的原生基准套件,用于人工智能生成的内核优化。该套件包含50个相关且具优化空间的JAX工作负载,从中提取17个来自MaxText公开架构(如Llama-3.1、DeepSeek-V3、Mixtral、Mamba-2、AlphaFold2)的真实生产级机器学习算子,并整合33个经验证正确的KernelBench算子,设定新问题规模以实现高TPU v6e MXU利用率。其中8个算子已由Tokamax库提供手工优化的Pallas内核并调优块大小,作为专家上限基线。我们在JAXBench上评估四种反馈驱动方法生成候选Pallas内核。使用Gemini 3 Flash时发现,在文档稀疏的Pallas DSL中,目标特定上下文比模型规模更重要:结合精选TPU文档后,单样本正确率从5.8%提升至37.3%,成功解决48/50个基准任务,获得1.28倍几何平均加速。一旦正确性达成,搜索结构带来显著收益,Autocomp的束搜索流水线相较XLA实现1.36倍几何平均加速。在8个手工优化内核上,Autocomp达到XLA的1.60倍,接近Tokamax的2.08倍上限,但在专用分页和不规则注意力算子上仍有差距。高质量TPU内核优化仍具挑战,我们发布JAXBench基准、评估框架与基线结果,支持开源贡献。

原文摘要 · Abstract (English)

Rigorous benchmarks have driven progress in autonomous GPU kernel performance optimization by establishing a shared target to hillclimb on, but no equivalent exists for TPUs. We present JAXBench, a TPU-native benchmark suite for AI-generated kernel optimization on Google Cloud TPUs. JAXBench comprises 50 JAX workloads that are both relevant and provide headroom for optimization. We extract 17 production ML operators from architectures in the public MaxText library such as Llama-3.1, DeepSeek-V3, Mixtral, Mamba-2, and AlphaFold2, and translate 33 operators from KernelBench that are validated for correctness and set with new problem sizes that achieve high TPU v6e MXU utilization. Eight of the 17 production operators ship with hand-optimized Pallas kernels from the public Tokamax library and block-size tuned to establish an expert upper-bound baseline. We evaluate four feedback-driven methods on generating candidate Pallas kernels for JAXBench. Across the full suite with Gemini 3 Flash, we find that target-specific context matters more than model scale on a sparsely-documented DSL like Pallas. Conditioning on curated TPU documentation raises per-sample correctness from 5.8% to 37.3% and solves 48 of 50 benchmarks at a 1.28x geomean speedup. Search structure yields significant gains once correctness is achieved, with Autocomp's beam-search pipeline reaching a 1.36x geomean speedup over XLA. On the 8 hand-tuned kernels, Autocomp reaches 1.60x geomean over XLA, recovering most of the 2.08x Tokamax upper bound but trailing on the specialized paged and ragged attention operators. High-quality TPU kernel optimization remains a challenging task, and we release the JAXBench benchmark, evaluation harness, and baseline results to support open source contributions.

TPU优化自动内核性能基准JAX

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。