MusaCoder让大模型直接生成高效GPU代码,性能超越闭源模型。
MusaCoder: Native GPU Kernel Generation with Full-Stack Training on Moore Threads GPU

- 用分步数据合成与执行反馈强化学习生成低层代码
- 9B模型达闭源前沿水平,27B模型创速度新纪录
- 专为摩尔线程显卡设计,支持完整大模型训练栈
原生GPU内核生成将高层张量程序转化为可执行的高效底层代码。现有大语言模型在此任务上表现不佳,而基于执行的强化学习存在奖励稀疏、奖励欺骗和训练不稳定等问题。我们提出MusaCoder,一个面向CUDA和MUSA后端的全栈训练框架,用于原生GPU内核生成。MusaCoder结合渐进式内核导向数据合成、保持多样性的拒绝微调,以及通过MooreEval(分布式验证器与奖励环境)实现的执行反馈强化学习。为稳定强化学习,MusaCoder引入PrimeEcho实现首轮锚定多轮奖励,Buffered Dynamic Retry用于从全失败的难样本中恢复信号,MirrorPop用于离策略序列过滤。在KernelBench及移植到MUSA的变体上的实验表明,MusaCoder在正确性和实测加速比方面均优于强开源与专有基线,9B模型达到或超过前沿闭源模型,27B模型建立新基准。结果不仅证明了全栈执行反馈训练在原生内核生成中的有效性,也展示了摩尔线程显卡支持完整LLM后训练栈的能力,为新兴加速器上的大模型训练与优化提供了实用基础。
原文摘要 · Abstract (English)
Native GPU kernel generation turns high-level tensor programs into executable, efficient low-level code. Existing Large Language Models (LLMs) struggle with this task, while execution-based reinforcement learning suffers from sparse rewards, reward hacking, and training instability. We present MusaCoder, a full-stack training framework for native GPU kernel generation on CUDA and MUSA backends. MusaCoder combines progressive kernel-oriented data synthesis, diversity-preserving rejection fine-tuning, and execution-feedback Reinforcement Learning (RL) through MooreEval, a distributed verifier and reward environment. To stabilize RL, MusaCoder introduces PrimeEcho for first-turn-anchored multi-turn rewards, Buffered Dynamic Retry for recovering signals from all-failed hard samples, and MirrorPop for off-policy sequence filtering. Experiments on KernelBench and a MUSA-ported variant show that MusaCoder outperforms strong open-source and proprietary baselines in both correctness and empirical speedup, with the 9B model matching or exceeding frontier closed-source models and the 27B model establishing a new state of the art. These results demonstrate not only the effectiveness of full-stack execution-feedback training for native kernel generation, but also the capability of Moore Threads GPUs to support the complete LLM post-training stack, providing a practical foundation for large-model training and optimization on emerging accelerators.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。