利用 Jagged Flash Attention 增强大规模推荐系统的性能与可扩展性
Enhancing Performance and Scalability of Large-Scale Recommendation Systems with Jagged Flash Attention
AI总结:
本文提出 Jagged Flash Attention,通过高效处理动态大小张量提取长类别特征细粒度信息,相比密集注意力实现高达9倍加速和22倍内存减少,在生产中提升10% QPS并节省18%内存,有效增强大规模推荐系统性能与可扩展性。
摘要:
硬件加速器的集成显著提升了现代推荐系统的能力,使得探索以前被认为不可行的复杂排序范式成为可能。然而,基于 GPU 的计算成本带来了巨大挑战。在本文中,我们展示了一种效率驱动方法的开发,以探索这些范式,超越了传统上对原生 PyTorch 模块的依赖。我们解决了排序模型依赖类别特征所带来的特定挑战,这些特征长度不一,使 GPU 利用率复杂化。我们引入了 Jagged Feature Interaction Kernels,这是一种新颖的方法,旨在通过高效处理动态大小的张量,从长类别特征中提取细粒度的见解。我们通过将 Jagged 张量与 Flash Attention 集成,进一步增强了注意力机制的性能。与密集注意力相比,我们新颖的 Jagged Flash Attention 实现了高达 9 倍的加速和 22 倍的内存减少。值得注意的是,它也优于密集 Flash Attention,实现了高达 3 倍的加速和 53% 的内存效率提升。在生产模型中,我们观察到 10% 的 QPS 提升和 18% 的内存节省,这使我们能够扩展推荐系统,以支持更长的特征和更复杂的架构。
英文摘要:
The integration of hardware accelerators has significantly advanced the capabilities of modern recommendation systems, enabling the exploration of complex ranking paradigms previously deemed impractical. However, the GPU-based computational costs present substantial challenges. In this paper, we demonstrate our development of an efficiency-driven approach to explore these paradigms, moving beyond traditional reliance on native PyTorch modules. We address the specific challenges posed by ranking models' dependence on categorical features, which vary in length and complicate GPU utilization. We introduce Jagged Feature Interaction Kernels, a novel method designed to extract fine-grained insights from long categorical features through efficient handling of dynamically sized tensors. We further enhance the performance of attention mechanisms by integrating Jagged tensors with Flash Attention. Our novel Jagged Flash Attention achieves up to 9x speedup and 22x memory reduction compared to dense attention. Notably, it also outperforms dense flash attention, with up to 3x speedup and 53% more memory efficiency. In production models, we observe 10% QPS improvement and 18% memory savings, enabling us to scale our recommendation systems with longer features and more complex architectures.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。