MaxKernel:面向TPU的智能内核生成
研究论文 · 2026/09/07
为加速器设计高性能自定义内核是一项复杂的任务,需要深厚的硬件级专业知识。本文提出 MaxKernel,一个多智能体系统,实现了三种 TPU 内核开发范式:(1) 人机协同 (HITL) 智能体,用于协作式逐步设计;(2) 自主 (Auto) 智能体,执行全自动的基于指标/跟踪的优化循环;(3) 基于图的自主搜索,扩展 Auto 智能体以进行设计空间的全局探索。所有范式共享一组专门的子智能体,负责规划、实现、自我调试、测试和硬件剖析。我们在 JaxBench(包含 50 个 TPU 内核任务的综合基准)以及来自最先进开源模型的复杂真实工作负载上评估 MaxKernel。结果表明,MaxKernel 始终生成高度优化的实现,匹配专家手工调优的基线,并在基准上取得显著性能。智能体已开源,见 https://github.com/AI-Hypercomputer/accelerator-agents/tree/main/MaxKernel。
本文提出了一种新颖的多智能体系统,用于自动化 TPU 内核生成,解决了高性能计算中的关键挑战。其三种范式提供了灵活的人机协作和全自动优化选项,并在广泛基准上验证了有效性。开源实现便于复现和进一步研究,对加速器编程和 AI 系统领域具有重要价值。
Designing and authoring high-performance custom kernels for accelerators is a complex task that requires deep hardware-level expertise. Large Language Models (LLM) can be leveraged together with real-time compiler feedback to build agentic systems for kernel generation. In this work, we present MaxKernel, a multi-agent system that implements three distinct paradigms for TPU kernel development: (1) a Human-in-the-Loop (HITL) agent for collaborative, step-by-step design; (2) an Autonomous (Auto) agent that executes a fully automated, metric/trace-driven optimization loop; and (3) a Graph-Based Autonomous Search that scales the Auto agent for global exploration of the design space. All three paradigms leverage a shared pool of specialized sub-agents to handle planning, implementation, self-debugging, testing, and hardware profiling. We evaluate MaxKernel on JaxBench, a comprehensive suite of 50 diverse kernel tasks for TPUs, alongside complex, real-world workloads from state-of-the-art open-source models. We demonstrate that MaxKernel consistently generates highly optimized implementations, matching expert hand-tuned baselines and delivering significant performance across the benchmark. Our agent is open-sourced and available https://github.com/AI-Hypercomputer/accelerator-agents/tree/main/MaxKernel.