Primitives for Dynamic Big Model Parallelism

Seunghak Lee, Jin Kyu Kim, Xun Zheng, Qirong Ho, Garth A. Gibson, Eric P. XingarXiv 2014

TL;DR

This paper introduces STRADS, a novel framework of programmable primitives for "dynamic model parallelism" that allows for more efficient training of massive machine learning models across distributed systems. By enabling flexible partitioning and adaptive scheduling of model variables, STRADS improves memory efficiency and speeds up convergence, overcoming limitations of existing approaches that can lead to divergence or poor scaling.

What Problem Does This Paper Address?

Training large machine learning models, often referred to as "Big Model" problems, presents a significant challenge. These models can have millions or even billions of parameters, making it impossible to fit them into the memory of a single machine. While distributed computing offers a solution, naive parallelization strategies (like data parallelism) often struggle. Data parallelism requires every machine to have access to all model parameters, which is infeasible for Big Models. Model parallelism, on the other hand, partitions model variables across machines, offering better memory efficiency. However, existing model-parallel approaches are often application-specific and lack the flexibility to handle complex variable dependencies, which can lead to slow convergence or even divergence. This paper addresses the need for a general, programmable framework that can effectively manage model partitioning and dynamic scheduling of variable updates in distributed settings for Big Model problems.

Methods

The core contribution of this paper is the STRADS (STRucture-Aware Dynamic Scheduler) framework, which provides a set of user-defined primitives for dynamic model parallelism: schedule, push, and pull.

  • schedule: This primitive determines the order in which model variables are updated. Unlike static scheduling, STRADS allows for dynamic schedules that can adapt based on the model's state, prioritizing variables that are crucial for convergence or avoiding those with high interdependencies to prevent divergence.
  • push: This primitive handles the computation of partial updates for a subset of model variables on individual worker machines. It allows workers to leverage their local data partitions for efficient computation.
  • pull: This primitive aggregates the partial updates from workers to perform the full update of the model variables.
  • sync: An automatic primitive that ensures model variables are up-to-date, executed after each pull.

STRADS aims to provide the simplicity of frameworks like MapReduce but with the fine-grained control needed for complex model-parallel scenarios. The paper demonstrates the implementation of these primitives for Latent Dirichlet Allocation (LDA), Matrix Factorization (MF), and Lasso regression.

Datasets

The paper evaluates STRADS on several datasets and problem settings:

  • Latent Dirichlet Allocation (LDA):
  • Unigram (1-word) tokens: 3.9M English Wikipedia abstracts, 2.5M unique unigrams, 179M tokens.
  • Bigram (2-word) tokens: 3.9M English Wikipedia abstracts, 21.8M unique bigrams, 79M tokens.
  • The paper notes that their bigram vocabulary size is significantly larger than previous work.
  • Matrix Factorization (MF):
  • Netflix dataset: 100M anonymized ratings from 480,189 users on 17,770 movies.
  • Rank (K) varied from 20 to 2000, exceeding previous MF paper limits.
  • Lasso:
  • Synthetic data: 50K samples and 10M to 100M features, with each feature having only 25 non-zero samples.
  • Correlations between adjacent features were simulated.

Key Insights and Ideas

  • Dynamic Scheduling is Crucial for Big Models: The paper highlights that static scheduling can be suboptimal or even lead to divergence in Big Model problems due to complex interdependencies between variables. STRADS's dynamic scheduling, which adapts based on model state, is key to achieving faster convergence and avoiding errors.
  • Model Partitioning for Memory Efficiency: By partitioning model variables, STRADS allows for training much larger models than data-parallel approaches, as memory usage per machine decreases with an increasing number of machines. This is a critical advantage for Big Model problems.
  • Bridging the Gap Between Simplicity and Control: STRADS offers a programmable interface with primitives that are conceptually similar to MapReduce, making it accessible, but provides the necessary control for advanced model-parallelism strategies.
  • Prioritization Speeds Up Convergence: For problems like Lasso, prioritizing variables that contribute most to convergence (based on dynamic criteria) significantly accelerates the training process.
  • Reduced Synchronization Overhead: Careful model partitioning in STRADS leads to reduced synchronization requirements, contributing to faster convergence.

Key Results

  • Larger Model Sizes: STRADS successfully trained significantly larger LDA and MF models compared to baselines like YahooLDA and GraphLab-MF, which were limited by memory or convergence issues. For example, STRADS LDA handled 21.8M vocab/10K topics, while YahooLDA struggled with 2.5M vocab/5K topics.
  • Faster Convergence: STRADS consistently converged faster than baselines across LDA, MF, and Lasso. For instance, STRADS LDA achieved faster convergence with more machines, showing near-linear scaling.
  • Memory Efficiency: STRADS demonstrated lower memory usage per machine as the number of machines increased, a direct benefit of its model partitioning strategy.
  • Low Parallelization Error: For LDA, STRADS exhibited very small parallelization error (s-error ≤ 0.002), indicating that its dynamic scheduling effectively manages variable dependencies.
  • Competitive or Better Objective Values: STRADS achieved better objective values in LDA and MF, confirming that its speed does not come at the expense of convergence quality.

Limitations and Future Work

  • Communication Costs: The paper acknowledges that reducing communication costs is an important direction for future research. STRADS currently uses a star topology, which can become a bottleneck with a large number of machines.
  • Synchronization Schemes: The authors plan to explore alternative synchronization schemes beyond Bulk Synchronous Parallel (BSP), such as Asynchronous Parallelism and Stale Synchronous Parallelism, to further optimize performance.
  • Broader Application: The paper suggests extending STRADS to other popular ML applications like Support Vector Machines and Logistic Regression.
  • Dynamic Scheduling Complexity: While dynamic scheduling offers benefits, its implementation can be more complex than static approaches. Future work might focus on simplifying the development of sophisticated dynamic schedules.

Summary updated

BibTeX
@misc{lee2014primitives,
  author = {Seunghak Lee and Jin Kyu Kim and Xun Zheng and Qirong Ho and Garth A. Gibson and Eric P. Xing},
  title = {{Primitives for Dynamic Big Model Parallelism}},
  year = {2014},
  eprint = {1406.4580},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1406.4580},
}
Figure