Research Papers 论文研究 8d ago Updated 7d ago 更新于 7天前 48

CAKE: Compiler-Agent Co-Design for Frontier Kernel Evolution CAKE:编译器-智能体协同设计用于前沿内核演进

CAKE introduces a compiler-agent co-design where AI agents author CAKE IR, a typed, hardware-explicit intermediate representation that exposes warp roles, memory movement, synchronization, and pipelines The system treats the compiler as a co-design partner rather than a black box, enabling agents to make informed scheduling decisions instead of relying solely on error messages and timing feedback On B200 GPUs, CAKE-generated Flash-KMeans outperforms both direct CUDA/PTX (1.144x vs 0.928x relativ CAKE提出编译器-代理协同设计,让AI代理直接编写硬件显式的CAKE IR,而非将编译器视为仅返回错误和时序的黑盒 在B200 GPU的Flash-KMeans基准测试中,CAKE IR候选者在8000万token预算下达到1.144x FlashML基线性能,显著优于直接CUDA/PTX的0.928x Agent生成的Kimi Delta Attention实现2.05x几何平均加速并通过了端到端服务验证,KNN和KMeans在400+形状上获得1.42x-2.12x性能提升 CAKE支持NVIDIA Ampere至Blackwell架构,将单次形状进化与库泛化、分发机制分离,且四次内核改

62
Hot 热度
75
Quality 质量
68
Impact 影响力

Analysis 深度分析

TL;DR

  • CAKE introduces a compiler-agent co-design where AI agents author CAKE IR, a typed, hardware-explicit intermediate representation that exposes warp roles, memory movement, synchronization, and pipelines
  • The system treats the compiler as a co-design partner rather than a black box, enabling agents to make informed scheduling decisions instead of relying solely on error messages and timing feedback
  • On B200 GPUs, CAKE-generated Flash-KMeans outperforms both direct CUDA/PTX (1.144x vs 0.928x relative to tuned FlashML baseline) and achieves a 2.05x geometric-mean speedup over official FlashKDA for Kimi Delta Attention
  • The harness is self-evolving: recurring failures automatically become verifier rules, IR primitives, model calibrations, and reusable optimization tactics
  • CAKE supports NVIDIA GPUs from Ampere through Blackwell, with dispatcher-backed KNN and KMeans improving performance by 1.42x–2.12x across 400+ shapes and four kernels submitted as upstream PRs

Why It Matters

CAKE bridges a critical gap between AI agent capabilities and low-level GPU kernel optimization, demonstrating that agents can produce expert-level kernels when given the right hardware-explicit representation. This approach could democratize high-performance kernel development, reducing reliance on scarce GPU programming expertise while pushing performance beyond what traditional manual tuning achieves.

Technical Details

  • CAKE IR: A typed, hardware-explicit schedule representation that exposes warp roles, memory movement patterns, synchronization points, and pipeline structures—giving agents visibility into decisions typically hidden by compilers or abstracted away by DSLs
  • Compiler-agent co-design: Unlike prior approaches where agents treat compilers as black boxes receiving only errors and timing, CAKE integrates the compiler into the agent loop, supporting verification, cost modeling, and localized diagnostics
  • Self-evolving harness: The system learns from recurring failures by automatically converting them into verifier rules, new IR primitives, model calibrations, and reusable optimization tactics, creating a compounding improvement loop
  • Benchmark results: Flash-KMeans on B200 at 80M tokens achieves 1.144x tuned FlashML baseline (vs 0.928x for CUDA/PTX); Kimi Delta Attention gets 2.05x geometric-mean speedup over FlashKDA; KNN/KMeans dispatcher covers 400+ shapes with 1.42x–2.12x improvement
  • Hardware coverage: Targets NVIDIA GPUs from Ampere through Blackwell, with a clean separation between single-shape evolution and library generalization/dispatch

Industry Insight

  • The CAKE paradigm signals a shift toward AI-driven systems programming, where agents can autonomously produce production-grade kernels—potentially reducing the GPU expert bottleneck that constrains ML infrastructure scaling
  • The self-evolving harness design offers a blueprint for other domains where iterative refinement against hardware feedback is needed, suggesting that "learning from failure" at the compiler level can compound into significant performance gains
  • With four kernels already accepted as upstream PRs, CAKE demonstrates that agent-generated code can meet production quality standards, making it a viable path for organizations to accelerate kernel development without proportional increases in specialized staffing

TL;DR

  • CAKE提出编译器-代理协同设计,让AI代理直接编写硬件显式的CAKE IR,而非将编译器视为仅返回错误和时序的黑盒
  • 在B200 GPU的Flash-KMeans基准测试中,CAKE IR候选者在8000万token预算下达到1.144x FlashML基线性能,显著优于直接CUDA/PTX的0.928x
  • Agent生成的Kimi Delta Attention实现2.05x几何平均加速并通过了端到端服务验证,KNN和KMeans在400+形状上获得1.42x-2.12x性能提升
  • CAKE支持NVIDIA Ampere至Blackwell架构,将单次形状进化与库泛化、分发机制分离,且四次内核改进已作为上游PR提交

为什么值得看

CAKE解决了GPU专家内核难以复现的核心痛点,通过编译器-代理协同设计让AI代理能够直接操控底层硬件调度细节,为自动化高性能计算开辟了新路径。这一方法在B200等前沿GPU上已验证超越人工调优的潜力,标志着AI辅助底层系统优化的重要进展。

技术解析

CAKE IR是一种类型化、硬件显式的调度表示,暴露了warp角色、内存移动、同步原语和流水线结构,同时支持验证、成本建模和局部诊断,使代理能够精确控制GPU执行细节。

系统采用自进化机制:反复出现的失败会被转化为验证器规则、IR原语、模型校准和可重用的优化策略,形成持续改进的闭环。

在B200上,CAKE IR候选者在8000万token预算下达到1.144x FlashML基线性能,而直接CUDA/PTX仅0.928x,证明显式硬件调度设计的优势。

Kimi Delta Attention通过CAKE实现2.05x几何平均加速并通过了端到端服务验证;Dispatcher支持的KNN和KMeans在400多个形状上获得1.42x-2.12x性能提升,四次内核改进已作为上游PR提交。

行业启示

AI代理正从"调用编译器"向"参与底层硬件调度设计"演进,编译器-代理协同设计将成为自动化高性能计算的新范式,降低专家级GPU优化的门槛。

GPU内核自动化生成与优化技术快速成熟,CAKE在B200等前沿架构上的表现表明,AI驱动的内核开发有望在部分场景超越人工调优,改变传统高性能计算的开发流程。

CAKE将单次形状进化与库泛化、分发分离的设计思路,为构建可扩展的自动化系统优化框架提供了可复用的架构模式,值得业界关注。

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

GPU GPU Agent Agent Research 科学研究 Programming 编程 Chip 芯片