内核循环:消除同步边界以实现峰值推理性能
Kernel Looping: Eliminating Synchronization Boundaries for Peak Inference Performance
AI总结:
针对GPU及数据流架构在令牌生成时因同步开销性能不足的问题,提出内核循环技术,通过流水线外层循环消除同内核连续调用的同步成本,在SN40L上实现解码性能最高2.2倍提升,多插槽下最高达3.7倍于DGX H100,已商用部署。
摘要:
令牌生成速度对支撑下一波AI推理应用至关重要。GPU在令牌生成过程中因内核边界的同步开销而性能表现不佳,仅能利用其峰值内存带宽的21%。尽管近期的数据流架构通过将解码器层激进融合为单个内核来缓解这些开销,但由于层边界的同步损耗,它们仍未充分发挥性能。\n 本文提出内核循环(kernel looping),这是一种专门的全局优化技术,它利用了现代数据流架构中独特的层级融合能力与大语言模型中重复的层结构相结合所带来的优化机遇。内核循环通过将同一内核的连续调用转换为对包含流水线外层循环的修改后内核的单次调用,消除了这些调用之间的同步开销。我们在SambaNova SN40L可重构数据流单元(Reconfigurable Dataflow Unit, RDU)——一款商用AI数据流加速器——上评估了内核循环的性能。实验表明,在SN40L上,内核循环将一系列强大的开源模型的解码阶段速度提升了最高2.2倍。内核循环支持在多个SN40L插槽上扩展解码性能,实现了最高2.5倍的速度提升。最后,内核循环使SN40L在8个和16个插槽上达到了峰值性能的90%以上,并且相较于DGX H100实现了最高3.7倍的速度提升。内核循环以及本文评估的模型已在商用AI推理云中部署投产。
英文摘要:
Token generation speed is critical to power the next wave of AI inference applications. GPUs significantly underperform during token generation due to synchronization overheads at kernel boundaries, utilizing only 21% of their peak memory bandwidth. While recent dataflow architectures mitigate these overheads by enabling aggressive fusion of decoder layers into a single kernel, they too leave performance on the table due to synchronization penalties at layer boundaries. This paper presents kernel looping, a specialized global optimization technique which exploits an optimization opportunity brought by combining the unique layer-level fusion possible in modern dataflow architectures with the repeated layer structure found in language models. Kernel looping eliminates synchronization costs between consecutive calls to the same kernel by transforming these calls into a single call to a modified kernel containing a pipelined outer loop. We evaluate kernel looping on the SambaNova SN40L Reconfigurable Dataflow Unit (RDU), a commercial dataflow accelerator for AI. Experiments demonstrate that kernel looping speeds up the decode phase of a wide array of powerful open-source models by up to 2.2$\times$ on SN40L. Kernel looping allows scaling of decode performance over multiple SN40L sockets, achieving speedups of up to 2.5$\times$. Finally, kernel looping enables SN40L to achieve over 90% of peak performance on 8 and 16 sockets and achieve a speedup of up to 3.7$\times$ over DGX H100. Kernel looping, as well as the models evaluated in this paper, are deployed in production in a commercial AI inference cloud.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。