让大模型通过记忆优化经验,自动提升硬件内核性能。
Beyond Scaling: Self-Evolving LLM Agents for Hardware Kernel Optimization via an Experience-Driven Workflow and Experience Graph Memory

- 构建经验图谱记忆,记录决策与执行反馈
- 在固定上下文预算下实现84.6%的优化成功率
- 适合需要持续优化的硬件开发团队使用
硬件内核优化需反复编译、测试、分析和修改。大型语言模型代理可自动化部分流程,但现有方法难以留存优化过程中的决策与反馈。传统方式无法保存全部历史轨迹,且会挤占当前任务的上下文空间。本文提出KOPE框架,将优化轨迹及其正确性与性能反馈存入经验图谱记忆,并通过主动上下文管理与注入技术,在固定令牌预算下检索相关历史经验。图谱保留决策顺序、结果及备选路径,使目标硬件上的实测证据能指导后续优化步骤。在相同GLM-5.2设置下,KOPE的每算子加速比几何均值达CANNBot的1.54倍;完整53算子消融实验中,主动上下文管理将通过率从60.0%提升至84.6%,评估报告正向几何均值从0.0382增至0.0661,优化消耗令牌数从15.9B降至1.113B;启用经验图谱后,全套通过率由55.2%升至84.6%,有效时序比较下的几何平均加速比达1.43倍。结果表明,在基础模型不变的前提下,可通过外部经验实现持续优化。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。