arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2511.08083cs.LG
收藏

HipKittens:快速且高效的AMD内核

HipKittens: Fast and Furious AMD Kernels

AMD

William Hu, Drew Wadsworth, Sean Siddens, Stanley Winata, Daniel Y. Fu, Ryann Swann, Muhammad Osama, Christopher Ré, Simran Arora

AI总结:

该研究提出HipKittens框架,探索并验证了基于tile的编程原语在AMD GPU上的通用性,其内核性能与AMD手工优化汇编竞争,部分场景高出基线1.2-2.4倍,为跨GPU的高性能AI内核开发提供统一软件层。

摘要:

AMD GPU提供了最先进的计算和内存带宽;然而,峰值性能的AMD内核是用原始汇编编写的。为了解决将AI算法映射到硬件的困难,最近的工作提出了C++嵌入式和PyTorch启发的领域特定语言,如ThunderKittens(TK),以简化NVIDIA硬件上的高性能AI内核开发。我们探讨了这些原语——用于显式基于tile的编程、优化的内存访问以及跨工作者的细粒度异步执行——在多大程度上是NVIDIA特定的还是通用的。我们首次详细研究了导致高性能AMD AI内核的编程原语,并将这些见解封装在HipKittens(HK)编程框架中。我们发现,先前DSL中使用的基于tile的抽象可以推广到AMD GPU,但我们需要重新思考为AMD实例化这些抽象的算法。我们在CDNA3和CDNA4 AMD平台上验证了HK原语。在评估中,HK内核在GEMM和注意力方面与AMD的手工优化汇编内核竞争,并始终优于编译器基线。此外,汇编难以扩展到广泛的AI工作负载;反映这一点,在某些设置中,HK比所有可用的内核基线性能高出1.2-2.4倍(例如,d=64注意力、GQA反向、内存受限内核)。这些发现有助于为跨GPU供应商的高性能AI内核铺平道路,形成一个单一的、基于tile的软件层。HipKittens已发布于:https://github.com/HazyResearch/HipKittens。

英文摘要:

AMD GPUs offer state-of-the-art compute and memory bandwidth; however, peak performance AMD kernels are written in raw assembly. To address the difficulty of mapping AI algorithms to hardware, recent work proposes C++ embedded and PyTorch-inspired domain-specific languages like ThunderKittens (TK) to simplify high performance AI kernel development on NVIDIA hardware. We explore the extent to which such primitives -- for explicit tile-based programming with optimized memory accesses and fine-grained asynchronous execution across workers -- are NVIDIA-specific or general. We provide the first detailed study of the programming primitives that lead to performant AMD AI kernels, and we encapsulate these insights in the HipKittens (HK) programming framework. We find that tile-based abstractions used in prior DSLs generalize to AMD GPUs, however we need to rethink the algorithms that instantiate these abstractions for AMD. We validate the HK primitives across CDNA3 and CDNA4 AMD platforms. In evaluations, HK kernels compete with AMD's hand-optimized assembly kernels for GEMMs and attention, and consistently outperform compiler baselines. Moreover, assembly is difficult to scale to the breadth of AI workloads; reflecting this, in some settings HK outperforms all available kernel baselines by $1.2-2.4\times$ (e.g., $d=64$ attention, GQA backwards, memory-bound kernels). These findings help pave the way for a single, tile-based software layer for high-performance AI kernels that translates across GPU vendors. HipKittens is released at: https://github.com/HazyResearch/HipKittens.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑