[论文解读] Towards Cold-Start Drafting and Continual Refining: A Value-Driven Memory Approach with Application to NPU Kernel Synthesis
EvoKernel 将 NPU 内核合成框架化为基于内存的强化学习任务,使用价值驱动的检索来起草可行内核并持续改进以提升延迟, frontier 模型正确性从 11.0% 提升到 83.0%,中位数获得 3.60× 的加速。
Deploying Large Language Models to data-scarce programming domains poses significant challenges, particularly for kernel synthesis on emerging Domain-Specific Architectures where a "Data Wall" limits available training data. While models excel on data-rich platforms like CUDA, they suffer catastrophic performance drops on data-scarce ecosystems such as NPU programming. To overcome this cold-start barrier without expensive fine-tuning, we introduce EvoKernel, a self-evolving agentic framework that automates the lifecycle of kernel synthesis from initial drafting to continual refining. EvoKernel addresses this by formulating the synthesis process as a memory-based reinforcement learning task. Through a novel value-driven retrieval mechanism, it learns stage-specific Q-values that prioritize experiences based on their contribution to the current objective, whether bootstrapping a feasible draft or iteratively refining latency. Furthermore, by enabling cross-task memory sharing, the agent generalizes insights from simple to complex operators. By building an NPU variant of KernelBench and evaluating on it, EvoKernel improves frontier models' correctness from 11.0% to 83.0% and achieves a median speedup of 3.60x over initial drafts through iterative refinement. This demonstrates that value-guided experience accumulation allows general-purpose models to master the kernel synthesis task on niche hardware ecosystems. Our official page is available at https://evokernel.zhuo.li.
研究动机与目标
- 解决 NPU 内核合成中数据匮乏的冷启动问题:公开数据有限且专家示范稀缺。
- 开发基于内存的 RL 框架,实现从初步草拟到持续 refining 的自动化,无需微调模型权重。
- 实现跨任务的内存共享,将简任务的洞见迁移到小众硬件上的复杂算子。
提出的方法
- 将内核合成形式化为 Memory-based MDP(M-MDP),其中生成器在检索上下文条件下对内核进行采样。
- 引入价值驱动的检索策略,学习阶段性 Q 值以选择用于起草(Q1)和 refining(Q2)的内存项。
- 维护一个动态、自进化的记忆 M,存储种子、轨迹和最佳实践;通过蒙特卡罗(MC)风格的值迭代更新记忆,而不进行权重更新。
- 实现两阶段管线:冷启动草拟以获得可行内核,然后通过优化轨迹与分析器信号进行持续 refine 以降低延迟。
- 使用多门控验证器提供结构化反馈(黑客、编译、正确性、延迟),并定义可行性门 gfeas 以决定推进。
- 通过跨算子类别和后端(Ascend C、CUDA)共享记忆来演示跨任务迁移,并在 KernelBench、Attention Set 和 mHC 内核上评估。
实验结果
研究问题
- RQ1一个基于内存的 RL 代理能否在数据稀缺的硬件生态中,在没有专家示范或微调的情况下启动内核合成?
- RQ2在冷启动内核合成中,价值驱动的检索机制是否比基于相似性或启发式检索在跨任务泛化和效率方面更优?
- RQ3跨任务记忆共享在多大程度上加速学习并提升在更困难算子块与新后端上的性能?
- RQ4EvoKernel 框架在从 KernelBench 迁移到 Attention Set 与 mHC 内核时,在 Ascend 和 CUDA 后端的表现如何?
主要发现
- EvoKernel 将 Ascend C 内核任务的 frontier 模型正确性从 11.0% 提升到 83.0%。
- 在 refine 过程中的中位数任务内延迟改进为初始可行草案的 3.60×。
- 价值驱动的检索在正确性与编译方面优于启发式检索,尤其是在较难算子上。
- 跨任务记忆共享带来显著收益,例如 Level 2 编译率从 55.0% 提升至 100%,在 GPT-5.2 下准确率从 3.0% 提升至 76.0%。
- 跨骨干网的记忆迁移显著提升编译和正确性(如 DeepSeek:CR 从 26% 提升至 80%;准确率从 6% 提升至 58%)。
- 该方法可推广到 Attention Set 和 mHC 内核,在 CUDA 与 Ascend 变体上实现 100% 编译率与接近 78–100% 的正确性。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。