Parallel training of linear models without compromising convergence

Nikolas Ioannou, Celestine Dünner, Kornilios Kourtis, Thomas P. ParnellarXiv 2018

Abstract

In this paper we analyze, evaluate, and improve the performance of training generalized linear models on modern CPUs. We start with a state-of-the-art asynchronous parallel training algorithm, identify system-level performance bottlenecks, and apply optimizations that improve data parallelism, cache line locality, and cache line prefetching of the algorithm. These modifications reduce the per-epoch run-time significantly, but take a toll on algorithm convergence in terms of the required number of epochs. To alleviate these shortcomings of our systems-optimized version, we propose a novel, dynamic data partitioning scheme across threads which allows us to approach the convergence of the sequential version. The combined set of optimizations result in a consistent bottom line speedup in convergence of up to 12x compared to the initial asynchronous parallel training algorithm and up to 42x, compared to state of the art implementations (scikit-learn and h2o) on a range of multi-core CPU architectures.

Introduction

Training Generalized Linear Models (GLMs) on massive datasets is a cornerstone of modern machine learning. To accelerate this process, developers frequently employ asynchronous parallel algorithms, such as "Hogwild!", which allow multiple CPU cores to update a shared model simultaneously without the overhead of expensive locks. However, these algorithms often treat the CPU as a uniform collection of cores, ignoring the complexities of modern memory hierarchies (L1/L2/L3 caches) and Non-Uniform Memory Access (NUMA) architectures.

When asynchronous updates occur across different NUMA nodes, they trigger excessive cache coherence traffic, causing the CPU to spend more time managing memory updates than performing gradient calculations. Furthermore, while certain system-level optimizations can drastically reduce the time taken for a single "epoch" (one pass through the data), they can inadvertently damage the algorithm's randomness, leading to slower overall convergence. This paper introduces a "system-aware" approach to parallelizing Stochastic Coordinate Descent (SDCA) that optimizes for hardware while maintaining algorithmic integrity.

Algorithmic Foundation: SDCA

The research utilizes Stochastic Dual Coordinate Ascent (SDCA) as the baseline algorithm for training GLMs. SDCA is favored for its strong theoretical convergence guarantees and its ability to handle both dense and sparse datasets efficiently.

Algorithm 1: SDCA for training GLMs

As shown in Algorithm 1, the standard parallel implementation involves reading the current state of the model and shared vector, computing a coordinate update (δ), and then writing the update back. In a naive asynchronous environment, these reads and writes happen "wildly" across threads, leading to the performance bottlenecks addressed in this work.

System-Aware Optimizations

To bridge the gap between algorithmic theory and hardware reality, the authors propose three layers of optimization:

  1. Cache-Line Bucketing: Instead of processing individual training examples, data is grouped into "buckets" aligned with the CPU's cache line size (typically 64B or 128B). This improves cache reuse and enables more efficient hardware prefetching, turning a memory-bound bottleneck into a compute-bound process.
  2. NUMA-Awareness: The system treats each NUMA node as an independent worker. Each node maintains a local replica of the shared model vector, which is synchronized only at the end of an epoch. This "domestication" of the asynchronous updates drastically reduces cross-node communication overhead.
  3. Dynamic Data Partitioning: Static data splitting can harm convergence by reducing the randomness of example selection. The authors introduce a scheme where data buckets are reshuffled and reassigned to different threads at the start of every epoch, restoring the necessary stochasticity for rapid convergence.

Performance Evaluation

The "domesticated" SDCA was evaluated against synthetic and real-world benchmarks, including the Criteo-kaggle, HIGGS, and Epsilon datasets, on Intel Xeon and IBM POWER9 architectures.

Performance bottlenecks and convergence trade-offs

As illustrated in Figure 6(a), removing shared updates (the NUMA-aware optimization) significantly reduces the training time per epoch compared to the naive "wild" asynchronous approach. However, Figure 6(b) highlights the trade-off: as the number of partitions increases, the number of epochs required to converge can rise. The proposed dynamic partitioning scheme effectively mitigates this, allowing the system to achieve high per-epoch speeds without sacrificing convergence rates.

Key Results

  • Per-Epoch Speed: The system-aware modifications resulted in a 17.3x faster runtime per epoch on average compared to the baseline asynchronous implementation.
  • Bottom-Line Convergence: Accounting for total time to reach a solution, the combined optimizations were 5.1x faster than previous state-of-the-art implementations.
  • Competitive Benchmarking: Compared to industry standards, the optimized SDCA was 18.1x faster on average than scikit-learn and H2O, with speedups exceeding 40x on specific dense datasets like Epsilon.

Conclusion

This work demonstrates that significant performance gains in machine learning can be achieved by aligning algorithmic design with modern hardware architectures. By addressing cache locality and NUMA topologies while preserving the stochastic nature of the training process through dynamic partitioning, the authors provide a framework for high-performance, scalable linear model training. Future work will explore automating bucket size tuning and extending these optimizations to even larger-scale distributed systems.

Summary updated

BibTeX
@misc{ioannou2018parallel,
  author = {Nikolas Ioannou and Celestine Dünner and Kornilios Kourtis and Thomas P. Parnell},
  title = {{Parallel training of linear models without compromising convergence}},
  year = {2018},
  eprint = {1811.01564},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1811.01564},
}
Figure