Mambalaya:基于Einsum的State-Space模型融合优化
Mambalaya: Einsum-Based Fusion Optimizations on State-Space Models
AI总结:
针对Mamba工作负载中复杂依赖关系和内存交通问题,提出Mambalaya加速器,通过Einsum抽象和系统融合优化,实现预填和生成阶段性能提升。
摘要:
Mamba是一种新兴且复杂的计算工作负载,具有各种短程和长程依赖、非线性性和元素级计算,无法在现代硬件上接近峰值速度运行。具体而言,Mamba的复杂依赖图使得其全操作符级联的融合困难,导致大量跨操作符的内存交通被浪费。为解决这些问题,我们提出Mambalaya,一种新的可重构加速器,利用融合来克服Mamba的限制。我们使用最近提出的级联Einsum抽象来表征Mamba的完整计算结构,然后应用扩展的Einsum框架系统地探索跨Einsum的融合机会。这种原理性方法产生了一系列融合映射,减少了芯片间跨Einsum的交通。这些映射由底层的Mambalaya架构支持。Mambalaya在预填阶段实现比MARCA快4.9倍的层性能,在生成阶段实现1.9倍的提升。在以预填为主的工作负载中,它在最近的细粒度、内存感知融合加速器上实现了最高1.5倍的提升。
英文摘要:
Mamba is an emerging, complex workload with various short-range and long-range dependencies, nonlinearities, and elementwise computations that are unable to run at near-peak speeds on modern hardware. Specifically, Mamba's complex dependency graph makes fusion across its full operator cascade difficult, leaving substantial inter-operator memory traffic on the table. To address these challenges, we propose Mambalaya, a novel reconfigurable accelerator that leverages fusion to overcome the limitations of Mamba. We use the recently proposed cascade-of-Einsums abstraction to characterize Mamba's full computational structure, then apply the extended Einsum framework to systematically explore inter-Einsum fusion opportunities. This principled approach yields a series of fusion mappings that reduce off-chip inter-Einsum traffic. These mappings are supported by the underlying Mambalaya architecture. Mambalaya achieves a layer performance speedup of 4.9$\times$ for prefill and 1.9$\times$ for generation over MARCA. In prefill-dominated scenarios, it achieves up to 1.5$\times$ over a recent fine-grained, memory-aware fusion accelerator for Mamba.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。