HTAM: 用于算子优化的层次化过渡注意力记忆
HTAM: Hierarchical Transition-Attended Memory for Operator Optimization
AI总结:
提出HTAM框架,通过构建层次化过渡图(HTG)组织粗粒度全局方向和细粒度局部策略,解决LLM在GPU算子优化中粒度不匹配问题,显著提升正确率和加速比。
摘要:
高性能GPU内核对于高效部署LLM至关重要,但其优化仍然需要大量专业知识。最近基于LLM的代码生成使得自动GPU算子生成变得有前景,但算子优化仍然是一个硬件感知的搜索问题。现有的基于LLM的方法面临粒度不匹配的问题:粗粒度的提示可重用但难以执行,而细粒度的记忆可操作但会扩大搜索空间并模糊优化瓶颈。因此,关键挑战在于以适当的粒度组织优化经验。为了解决这个问题,本文提出了HTAM(层次化过渡注意力记忆),一种用于基于LLM的算子优化的粗到细框架。HTAM构建了一个两层的层次化过渡图(HTG),用于组织粗粒度的全局方向、细粒度的局部策略以及优化步骤之间的过渡经验。在每个演化步骤中,HTAM从当前状态和最近的优化历史中选择一个全局方向,检索相应的局部策略记忆,并用它来指导具体的CUDA代码生成。在完整的KernelBench套件上的实验表明,与基于LLM的基线相比,HTAM在正确率、快速解率和加速比上均有持续提升,而后端和Robust-KBench研究则表明结构化记忆带来的可迁移优势。
英文摘要:
High-performance GPU kernels are essential for efficient LLM deployment, yet optimizing them remains expertise-intensive. Recent LLM-based code generation makes automatic GPU operator generation promising, but operator optimization remains a hardware-aware search problem. Existing LLM-based methods face a granularity mismatch: coarse hints are reusable but hard to execute, whereas detailed memories are actionable but enlarge the search space and obscure optimization bottlenecks. The key challenge is therefore to organize optimization experience at an appropriate granularity. To address this issue, this paper proposes HTAM (Hierarchical Transition-Attended Memory), a coarse-to-fine framework for LLM-based operator optimization. HTAM builds a two-level Hierarchical Transition Graph (HTG) to organize coarse global directions, detailed local strategies, and transition experience between optimization steps. During each evolution step, HTAM selects a global direction from the current state and recent optimization history, retrieves the corresponding local strategy memory, and uses it to guide concrete CUDA code generation. Experiments on KernelBench demonstrate that HTAM improves correctness, fast-solution rate, and speedup over LLM-based baselines, while backend and Robust-KBench studies indicate transferable benefits from structured memory.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。