NumS: Scalable Array Programming for the Cloud

Melih Elibol, Vinamra Benara, Samyu Yagati, Lianmin Zheng, Alvin Cheung, Michael I. Jordan, Ion StoicaarXiv 2022 · DOI

TL;DR

NumS is a new Python library that brings NumPy-like array programming to distributed cloud systems. It introduces a novel scheduler, LSHS, that optimizes data and operation placement to significantly reduce memory and network overhead, leading to substantial performance gains over existing tools like Dask and Spark for various numerical tasks.

What Problem Does This Paper Address?

Modern scientific computing heavily relies on Python libraries like NumPy for array manipulation. However, scaling these operations to distributed systems (multiple machines) presents a significant challenge. Existing distributed Python tools often use dynamic schedulers that treat computations as abstract task graphs. While flexible, this approach can lead to inefficient data placement and excessive communication between nodes, creating bottlenecks. High-performance libraries like ScaLAPACK and SLATE offer better scaling but require specialized knowledge and don't integrate with the familiar Python ecosystem. The paper aims to bridge this gap by providing a NumPy-like interface for distributed computing that is both scalable and user-friendly.

Methods

The core innovation of NumS is its Load Simulated Hierarchical Scheduling (LSHS) algorithm. LSHS is a local search scheduler that aims to optimize operator placement by minimizing the maximum memory and network load on any given node in a distributed system. It achieves this by:

  • Hierarchical Data Layout: NumS employs a heuristic for creating load-balanced data layouts that co-locate operand partitions, minimizing communication for element-wise operations.
  • Operator Placement Optimization: LSHS simulates the impact of different placement decisions on cluster state (memory and network load) and chooses the placement that minimizes the maximum load across all nodes. This is formulated as an optimization problem.
  • Task-Based Execution: NumS builds upon task-based distributed systems like Ray, where operations are represented as tasks with dependencies. LSHS intelligently schedules these tasks to optimize data locality and resource utilization.

Datasets

The paper evaluates NumS on various synthetic datasets for benchmarks, including:

  • Logistic Regression: Synthetic classification data drawn from bimodal Gaussian distributions, with dataset sizes ranging from 64GB to 1TB.
  • DGEMM (Dense General Matrix Multiplication): Square matrices ranging from 2GB to 32GB.
  • Tensor Algebra (MTTKRP and Double Contraction): Tensors with sizes ranging from 8GB to 4TB.
  • QR Decomposition: Datasets for tall-and-skinny matrices.
  • HIGGS Dataset: Used for evaluating logistic regression performance on a single node.

The paper does not introduce new benchmark datasets but rather uses existing ones to evaluate NumS against established libraries.

Key Insights and Ideas

  • The "Abstract Task Graph" Bottleneck: The paper highlights how treating distributed computations as abstract task graphs, while good for software design, loses crucial information about data structure and locality, leading to suboptimal performance in numerical workloads.
  • Hierarchical Scheduling is Key: LSHS's success stems from its hierarchical approach, considering both node-level and worker-level placement, and its ability to simulate load before committing to a placement.
  • Data Layout Matters as Much as Scheduling: NumS's integrated approach, combining LSHS with optimized data layouts, is crucial for achieving communication lower bounds.
  • NumPy-like Interface for Distributed Power: The ability to express complex distributed computations using familiar NumPy syntax is a significant win for accessibility and productivity for scientists.
  • Ray's Object Store Advantage: Ray's shared-memory object store on each node simplifies inter-worker communication within a node, which LSHS leverages.

Key Results

  • Significant Performance Gains:
    • Logistic Regression: NumS achieved a 2x speedup compared to Dask ML and Spark MLlib on terabyte-scale data. It also reduced network load by 2x, memory usage by 4x, and execution time by 10x on Ray.
  • Tensor Factorization: Up to a 20x speedup over Dask Arrays on a key operation for tensor factorization on a 4TB tensor.
  • DGEMM: Competitive performance with HPC libraries like ScaLAPACK and SLATE on terabyte-scale data.
  • Robustness to Partitioning: NumS on Ray with LSHS was found to be more robust to different partitioning choices compared to Dask.
  • Near-Perfect Scaling: QR decomposition exhibited near-perfect scaling up to 16 nodes.
  • Communication Reduction: LSHS significantly reduces network load and memory usage, particularly on Ray.

Limitations and Future Work

  • Performance Degradation with Many Partitions: The paper notes that NumS's performance degrades as the number of array partitions increases, and when partition sizes become too small. This is attributed to the overhead of dispatching many small tasks.
  • Scalability Limits: For extremely large datasets (petabytes to exabytes), libraries like SLATE might be more suitable due to their specialized nature and different communication models.
  • Future Work:
    • Generalizing LSHS: Extending LSHS to other distributed data structures beyond arrays.
  • Improving Usability: Enhancing the user API to automate node grid specification and improve automatic block partitioning.
  • Reducing RFC Overhead: Investigating operator fusion to further minimize remote function call overhead.

Summary updated

BibTeX
@misc{elibol2022nums,
  author = {Melih Elibol and Vinamra Benara and Samyu Yagati and Lianmin Zheng and Alvin Cheung and Michael I. Jordan and Ion Stoica},
  title = {{NumS: Scalable Array Programming for the Cloud}},
  year = {2022},
  eprint = {2206.14276},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2206.14276},
}
Figure