[Paper Review] DreamShard: Generalizable Embedding Table Placement for Recommender Systems
DreamShard proposes a reinforcement learning approach for generalizable embedding table placement in distributed recommender systems, using a cost network to predict fused operation costs and a policy network trained on an estimated MDP to achieve zero-shot generalization across varying numbers of tables and devices. It achieves up to 19% training speedup over state-of-the-art baselines on synthetic and production workloads.
We study embedding table placement for distributed recommender systems, which aims to partition and place the tables on multiple hardware devices (e.g., GPUs) to balance the computation and communication costs. Although prior work has explored learning-based approaches for the device placement of computational graphs, embedding table placement remains to be a challenging problem because of 1) the operation fusion of embedding tables, and 2) the generalizability requirement on unseen placement tasks with different numbers of tables and/or devices. To this end, we present DreamShard, a reinforcement learning (RL) approach for embedding table placement. DreamShard achieves the reasoning of operation fusion and generalizability with 1) a cost network to directly predict the costs of the fused operation, and 2) a policy network that is efficiently trained on an estimated Markov decision process (MDP) without real GPU execution, where the states and the rewards are estimated with the cost network. Equipped with sum and max representation reductions, the two networks can directly generalize to any unseen tasks with different numbers of tables and/or devices without fine-tuning. Extensive experiments show that DreamShard substantially outperforms the existing human expert and RNN-based strategies with up to 19% speedup over the strongest baseline on large-scale synthetic tables and our production tables. The code is available at https://github.com/daochenzha/dreamshard
Motivation & Objective
- To address the challenge of embedding table placement in distributed recommender systems, where operation fusion and generalizability across unseen configurations are critical.
- To overcome the limitations of existing RL-based device placement methods, which fail to generalize to new table counts or device numbers and do not reason about fused operation costs.
- To design a system that can directly generalize to any unseen placement task without fine-tuning, leveraging representation reductions for scalability.
- To reduce training latency by balancing computation and communication costs through intelligent table fusion and placement.
- To outperform human-designed heuristics and RNN-based baselines in both synthetic and production environments.
Proposed method
- A cost network is trained to predict the computation and communication costs of fused embedding operations based on table features such as dimension, hash size, and distribution.
- A policy network is trained via reinforcement learning on an estimated Markov Decision Process (MDP), where states and rewards are derived from the cost network’s predictions, eliminating the need for real GPU execution.
- Sum reduction is applied to table representations and max reduction to device representations, enabling zero-shot generalization to new tasks with different numbers of tables and devices.
- The policy network learns to place tables in a way that minimizes the maximum latency across devices, balancing both computation and communication costs.
- The method is trained end-to-end on synthetic data and evaluated on both open-sourced synthetic benchmarks and real industrial production tables.
- The approach is evaluated on a 128-GPU cluster using an ultra-large industrial recommendation model with nearly 1,000 embedding tables.
Experimental results
Research questions
- RQ1Can a reinforcement learning-based approach generalize to unseen embedding table placement tasks with varying numbers of tables and devices without fine-tuning?
- RQ2How effectively can a learned cost network predict the performance of fused embedding operations across diverse table combinations?
- RQ3To what extent does DreamShard outperform human-designed heuristics and RNN-based baselines in balancing computation and communication costs?
- RQ4What is the impact of different table features (e.g., dimension, size, distribution) on the accuracy of cost prediction and final placement performance?
- RQ5Can the system achieve significant speedup in real-world industrial workloads with multi-terabyte embedding tables?
Key findings
- DreamShard achieves up to 19% training speedup over the strongest baseline on large-scale synthetic tables and production workloads.
- On an ultra-large industrial recommendation model with nearly 1,000 tables and multi-terabyte memory, DreamShard improves training throughput by 45.3%, outperforming the next best baseline by 30 percentage points.
- The cost network achieves a testing MSE of 0.303 on the production dataset, with table dimension, pooling factor, and distribution features being the most influential for accurate prediction.
- Ablation studies show that removing any individual feature increases the testing MSE, confirming the importance of all features in cost prediction.
- DreamShard consistently outperforms both random placement and the best human expert strategy across multiple test cases, including both balanced and imbalanced scenarios.
- Even in rare cases where DreamShard’s placement is slightly worse than the best heuristic, it still maintains competitive or better performance overall, demonstrating robustness and generalization.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.