通过支持稀疏张量的上下文并行,大幅扩展推荐系统序列长度。
Scaling Generative Recommendations with Context Parallelism on Hierarchical Sequential Transducers
- 提出面向稀疏输入的上下文并行方法,解决长序列推荐的显存瓶颈。
- 在HSTU模型上实现5.3倍序列长度扩展,结合分布式训练达1.55倍缩放增益。
- 适用于大规模在线推荐系统,尤其适合高基数、非平稳用户行为建模。
大规模推荐系统需处理海量每日用户交互,要求有效建模高基数与异构特征以保障预测精度。此前我们提出层次化序列转换器(HSTU),一种基于注意力机制的架构,用于建模高基数、非平稳的流式推荐数据,在生成式推荐框架中表现良好。近期研究表明,更长的用户历史序列能显著提升指标。然而,延长序列会带来大量激活值,亟需并行方案分摊激活内存。在基于Transformer的LLM中,上下文并行(CP)通过跨GPU分配序列维度计算,有效降低注意力激活内存。但生产级排序模型通常使用锯齿状张量表示用户交互特征,带来独特的CP实现挑战。本文为HSTU注意力引入支持锯齿张量的上下文并行,建立可扩展序列维度的基础能力。该方法使支持的用户交互序列长度提升5.3倍,结合分布式数据并行(DDP)后达到1.55倍的缩放因子。
原文摘要 · Abstract (English)
Large-scale recommendation systems are pivotal to process an immense volume of daily user interactions, requiring the effective modeling of high cardinality and heterogeneous features to ensure accurate predictions. In prior work, we introduced Hierarchical Sequential Transducers (HSTU), an attention-based architecture for modeling high cardinality, non-stationary streaming recommendation data, providing good scaling law in the generative recommender framework (GR). Recent studies and experiments demonstrate that attending to longer user history sequences yields significant metric improvements. However, scaling sequence length is activation-heavy, necessitating parallelism solutions to effectively shard activation memory. In transformer-based LLMs, context parallelism (CP) is a commonly used technique that distributes computation along the sequence-length dimension across multiple GPUs, effectively reducing memory usage from attention activations. In contrast, production ranking models typically utilize jagged input tensors to represent user interaction features, introducing unique CP implementation challenges. In this work, we introduce context parallelism with jagged tensor support for HSTU attention, establishing foundational capabilities for scaling up sequence dimensions. Our approach enables a 5.3x increase in supported user interaction sequence length, while achieving a 1.55x scaling factor when combined with Distributed Data Parallelism (DDP).
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。