论文标题

Autoshard:推荐系统的自动嵌入式桌子碎片

AutoShard: Automated Embedding Table Sharding for Recommender Systems

论文作者

Zha, Daochen, Feng, Louis, Bhushanam, Bhargav, Choudhary, Dhruv, Nie, Jade, Tian, Yuandong, Chae, Jay, Ma, Yinbin, Kejariwal, Arun, Hu, Xia

论文摘要

嵌入学习是深度建议模型中的重要技术,可以将分类特征映射到密集的向量。但是,嵌入表通常需要大量参数,这些参数成为存储和效率瓶颈。已经采用了分布式培训解决方案将嵌入表分配到多个设备中。但是,如果不仔细分区,嵌入表很容易导致失衡。这是名为“嵌入桌碎片”的分布式系统的重大设计挑战,即我们应该如何对嵌入表进行分配以平衡跨设备的成本,这是一项非琐事的任务,因为1)很难有效,精确地衡量成本,以及2)已知分区问题是NP-HARD。在这项工作中,我们介绍了我们在Meta的新颖实践,即Autoshard,该实践使用神经成本模型直接预测多桌成本和利用深度强化学习以解决分区问题。开源的大规模合成数据集和Meta生产数据集的实验结果证明了Autoshard的优越性,而不是启发式方法。此外,Autoshard的学习政策可以转移到具有不同数量的表和不同表格比率的碎片任务中,而无需进行任何微调。此外,Autoshard可以在几秒钟内有效地将数百个桌子碎片。 Autoshard的有效性,可转移性和效率使其适合生产使用。我们的算法已在元生产环境中部署。可以在https://github.com/daochenzha/autoshard上找到原型

Embedding learning is an important technique in deep recommendation models to map categorical features to dense vectors. However, the embedding tables often demand an extremely large number of parameters, which become the storage and efficiency bottlenecks. Distributed training solutions have been adopted to partition the embedding tables into multiple devices. However, the embedding tables can easily lead to imbalances if not carefully partitioned. This is a significant design challenge of distributed systems named embedding table sharding, i.e., how we should partition the embedding tables to balance the costs across devices, which is a non-trivial task because 1) it is hard to efficiently and precisely measure the cost, and 2) the partition problem is known to be NP-hard. In this work, we introduce our novel practice in Meta, namely AutoShard, which uses a neural cost model to directly predict the multi-table costs and leverages deep reinforcement learning to solve the partition problem. Experimental results on an open-sourced large-scale synthetic dataset and Meta's production dataset demonstrate the superiority of AutoShard over the heuristics. Moreover, the learned policy of AutoShard can transfer to sharding tasks with various numbers of tables and different ratios of the unseen tables without any fine-tuning. Furthermore, AutoShard can efficiently shard hundreds of tables in seconds. The effectiveness, transferability, and efficiency of AutoShard make it desirable for production use. Our algorithms have been deployed in Meta production environment. A prototype is available at https://github.com/daochenzha/autoshard

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源