Beyond Scaling: Self-Evolving LLM Agents for Hardware Kernel Optimization via an Experience-Driven Workflow and Experience Graph Memory

📄 arXiv: 2608.25570v1 📥 PDF

作者: Siyuan Chen, Runlin Hou, Shenxiu Wu, Yansong Sun, Junming Cao, Yiyu Zhang, Shudi Shao, Junhao Qiu, Zhichao Lu, Qingfu Zhang

分类: cs.LG, cs.MA

发布日期: 2026-08-26


💡 一句话要点

提出KOPE框架以优化硬件内核的自动化过程

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 硬件内核优化 经验图记忆 主动上下文管理 自动化编程 深度学习加速器

📋 核心要点

  1. 现有的内核优化代理缺乏保留决策及其执行反馈的能力,导致无法有效利用过去的优化经验。
  2. KOPE框架通过经验图记忆记录优化过程中的决策和反馈,并使用主动上下文管理技术来检索相关经验。
  3. 在实验中,KOPE的每个操作的几何平均加速比CANNBot高出1.54倍,且通过主动上下文管理,优化成功率从60%提升至84.6%。

📝 摘要(中文)

硬件内核优化需要反复进行编译、正确性测试、性能分析和修订。虽然更强大的基础模型和更长的上下文窗口在单个任务的优化中有所改善,但现有的内核优化代理很少保留决策及其执行反馈。本文提出KOPE,一个经验驱动的硬件内核优化框架,通过经验图记忆记录优化轨迹,并利用主动上下文管理和注入技术在固定的令牌预算下检索相关经验。实验结果显示,KOPE在多个指标上显著优于现有方法,支持通过外部经验实现持续优化。

🔬 方法详解

问题定义:本文旨在解决硬件内核优化过程中,现有方法无法有效利用历史优化经验的问题。现有的优化代理往往无法保留决策及其反馈,导致后续优化缺乏依据。

核心思路:KOPE框架的核心思想是通过经验图记忆记录优化过程中的决策和反馈,从而使得后续优化能够基于已有的经验进行调整和改进。这种设计旨在提升优化的效率和成功率。

技术框架:KOPE的整体架构包括经验图记忆模块、主动上下文管理模块和经验注入模块。经验图记忆用于记录优化轨迹,主动上下文管理负责在固定令牌预算下检索相关经验,而经验注入则将检索到的经验应用于当前优化任务。

关键创新:KOPE的主要创新在于引入了经验图记忆,能够有效保留决策顺序、观察结果和替代路径,与现有方法相比,显著提升了优化的连续性和效率。

关键设计:在设计上,KOPE采用了固定的令牌预算来管理上下文,同时通过优化算法调整参数设置,以确保在不同任务中都能有效利用经验图记忆。

🖼️ 关键图片

fig_0
img_1
img_2

📊 实验亮点

实验结果显示,KOPE在相同的GLM-5.2设置下,其每个操作的几何平均加速比CANNBot高出1.54倍。通过主动上下文管理,优化成功率从60%提升至84.6%,而优化令牌消耗从15.9B减少至1.113B,显示出显著的性能提升。

🎯 应用场景

KOPE框架在硬件内核优化领域具有广泛的应用潜力,能够显著提高编译和性能测试的效率。其经验驱动的优化方法可以应用于各种硬件平台,推动自动化编程和智能硬件设计的发展,未来可能在嵌入式系统、深度学习加速器等领域发挥重要作用。

📄 摘要(原文)

Hardware kernel optimization requires repeated compilation, correctness testing, profiling, and revision. LLM agents can automate parts of this process, and stronger foundation models, longer context windows, and longer execution horizons have improved optimization within individual tasks. These advances alone do not enable an agent to learn from completed optimization runs. Existing kernel-optimization agents seldom preserve a decision, its observed execution feedback, and the later decisions that use that evidence. Retaining every prior trajectory is also impractical because an expanding history competes with the current task for context. We present KOPE, an experience-driven framework for hardware kernel optimization. KOPE records optimization trajectories with correctness and performance feedback in Experience Graph Memory, then uses Active Context Management and Injection to retrieve relevant experience under a fixed token budget. The graph retains decision order, observed outcomes, and alternative branches, allowing evidence collected on the target hardware to inform later optimization steps and tasks. Under the same GLM-5.2 setting, the geometric mean of KOPE's per-operator speedups is $1.54\times$ that of CANNBot, the strongest competing baseline. In a complete 53-operator ablation, Active Context Management and Injection raises pass rate from 60.0\% to 84.6\%, increases the evaluator-reported positive-field geometric mean from 0.0382 to 0.0661, and reduces optimization token consumption from 15.9B to 1.113B tokens relative to passive agent-led context construction. Enabling Experience Graph Memory raises full-suite pass rate from 55.2\% to 84.6\% and yields a $1.43\times$ geometric-mean speedup on valid timing comparisons. These results support continual optimization through external experience while the foundation model remains fixed.