Research Papers 论文研究 4h ago Updated 1h ago 更新于 1小时前 47

JAXBench: Benchmarking Autonomous TPU Kernel Optimization JAXBench:基准测试自主TPU内核优化

JAXBench is introduced as the first TPU-native benchmark suite for autonomous AI-generated kernel optimization, addressing a gap left by existing GPU-focused benchmarks. The suite comprises 50 JAX workloads, including 17 operators extracted from major production models (e.g., Llama-3.1, AlphaFold2) and 33 translated from KernelBench, with expert upper-bound baselines provided by Tokamax. Research demonstrates that providing target-specific context (curated TPU documentation) significantly improv JAXBench是首个针对Google Cloud TPU的AI生成内核优化基准测试套件,包含50个JAX工作负载。 研究对比了四种反馈驱动方法,发现对于Pallas这种文档稀疏的DSL,特定上下文比模型规模更重要。 结合精心策划的TPU文档进行条件约束,可将样本正确率从5.8%提升至37.3%,并在48/50个基准测试中实现1.28x几何平均加速。 Autocomp的束搜索管道在正确性达成后显著提升性能,在8个手工优化内核上达到1.60x加速,接近Tokamax专家上限。

65
Hot 热度
70
Quality 质量
68
Impact 影响力

Analysis 深度分析

TL;DR

  • JAXBench is introduced as the first TPU-native benchmark suite for autonomous AI-generated kernel optimization, addressing a gap left by existing GPU-focused benchmarks.
  • The suite comprises 50 JAX workloads, including 17 operators extracted from major production models (e.g., Llama-3.1, AlphaFold2) and 33 translated from KernelBench, with expert upper-bound baselines provided by Tokamax.
  • Research demonstrates that providing target-specific context (curated TPU documentation) significantly improves AI correctness (from 5.8% to 37.3%) over model scale alone when generating Pallas kernels.
  • The Autocomp beam-search pipeline achieved a 1.36x geometric mean speedup over XLA on the full suite and recovered most of the expert baseline performance (1.60x over XLA) on hand-tuned kernels.

Why It Matters

This release establishes a standardized evaluation framework for TPU kernel optimization, enabling the community to measure progress in autonomous code generation for hardware-specific accelerators. By providing curated datasets and baselines, it lowers the barrier for researchers to develop and test AI-driven compiler optimizations, fostering open-source contributions to high-performance computing infrastructure.

Technical Details

  • Dataset Construction: JAXBench includes 50 JAX workloads; 17 are production operators from MaxText-based architectures (Llama-3.1, DeepSeek-V3, Mixtral, Mamba-2, AlphaFold2), while 33 are adapted from KernelBench with problem sizes optimized for TPU v6e MXU utilization.
  • Baselines: Eight production operators include hand-optimized Pallas kernels from the Tokamax library, tuned for block sizes to serve as an expert upper-bound baseline (achieving up to 2.08x speedup over XLA).
  • AI Evaluation: Four feedback-driven methods were evaluated using Gemini 3 Flash. Conditioning on curated TPU documentation increased per-sample correctness to 37.3% and solved 48/50 benchmarks.
  • Performance Results: Autocomp’s beam-search pipeline reached a 1.36x geomean speedup over XLA on the full suite. On the 8 hand-tuned kernels, it achieved 1.60x speedup, though it trailed on specialized paged and ragged attention operators.

Industry Insight

  • Context Engineering is Critical: For sparse DSLs like Pallas, providing curated, domain-specific documentation to LLMs yields higher returns than simply scaling model size. Practitioners should prioritize context curation in their AI coding workflows.
  • TPU Optimization Gap: As TPU usage grows in large-scale inference and training, the lack of automated optimization tools is a bottleneck. JAXBench provides the necessary infrastructure to close this gap, similar to how KernelBench accelerated GPU optimization.
  • Open Source Collaboration: The release of the benchmark, harness, and baselines invites community-driven improvements. Organizations relying on TPU efficiency should monitor and contribute to this ecosystem to benefit from faster, AI-generated kernel optimizations.

TL;DR

  • JAXBench是首个针对Google Cloud TPU的AI生成内核优化基准测试套件,包含50个JAX工作负载。
  • 研究对比了四种反馈驱动方法,发现对于Pallas这种文档稀疏的DSL,特定上下文比模型规模更重要。
  • 结合精心策划的TPU文档进行条件约束,可将样本正确率从5.8%提升至37.3%,并在48/50个基准测试中实现1.28x几何平均加速。
  • Autocomp的束搜索管道在正确性达成后显著提升性能,在8个手工优化内核上达到1.60x加速,接近Tokamax专家上限。

为什么值得看

本文填补了TPU领域自主内核优化的基准空白,为AI辅助硬件底层优化提供了标准化的评估框架。它揭示了在缺乏完善文档的情况下,利用高质量上下文信息提升大模型代码生成有效性的关键策略,对降低AI系统部署成本具有重要意义。

技术解析

  • 基准构成:JAXBench包含50个JAX工作负载,其中17个算子源自MaxText库中的主流架构(如Llama-3.1, DeepSeek-V3, Mamba-2等),33个算子源自KernelBench并经过正确性验证及针对TPU v6e MXU利用率调整问题规模。
  • 基线设定:为17个生产级算子中的8个提供了来自Tokamax库的手工优化Pallas内核作为专家上限基线,用于衡量自动化优化的潜力。
  • 实验发现:在使用Gemini 3 Flash进行评估时,引入 curated TPU 文档作为上下文,使每样本正确率从5.8%跃升至37.3%。
  • 性能优化:Autocomp采用束搜索管道,在解决正确性问题后通过搜索结构优化获得显著增益,整体达到1.36x几何平均加速(相对于XLA),在手工调优内核上达到1.60x加速。

行业启示

  • 上下文工程优于单纯扩大模型:在优化像Pallas这样文档稀缺、领域特定的语言时,提供高质量的领域特定上下文比单纯依赖更大规模的通用模型更能保证生成的正确性和性能。
  • 自动化内核优化仍有巨大空间:尽管AI生成的内核已能恢复大部分手工优化性能的80%以上(1.60x vs 2.08x),但在分页和稀疏注意力等复杂算子上仍存在差距,表明该领域仍是高价值研究方向。
  • 开源基准推动生态发展:发布完整的基准测试、评估工具和基线结果有助于社区协作,加速TPU生态下高性能AI推理引擎的开发与标准化。

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

Benchmark 基准测试 TPU TPU Research 科学研究 Open Source 开源