NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Parallel In-Place Algorithms: Theory and Practice

Yan Gu, Omar Obeya, Julian ShunApocs 2021

TL;DR

This paper introduces new theoretical models and practical algorithms for "parallel in-place" (PIP) computation, which aims to perform parallel tasks using significantly less auxiliary memory than traditional methods. They demonstrate that these PIP algorithms can be competitive with, and sometimes even outperform, their non-in-place counterparts in terms of speed, making large-scale parallel processing more feasible on memory-constrained systems.

What Problem Does This Paper Address?

Modern multicore processors offer immense computational power, but their effectiveness for large-scale data processing is often bottlenecked by the limited memory capacity of a single machine. Many existing parallel algorithms, while efficient in terms of computation time (work and span), require a substantial amount of auxiliary memory (often linear in the input size) to avoid conflicts during parallel operations. This "non-in-place" nature makes processing very large datasets impossible on memory-limited machines, leading to significant costs for acquiring more memory or sacrificing performance. The authors aim to bridge this gap by developing parallel algorithms that use sublinear (or even polylogarithmic) auxiliary space, a concept known as "parallel in-place" (PIP) algorithms.

Methods

The core of the paper lies in defining two new models for parallel in-place algorithms: the Strong PIP model and the Relaxed PIP model. These models are based on the fork-join parallelism paradigm and the work-span model, which better reflect modern parallel programming environments than older PRAM models.

  • Strong PIP Model: Requires algorithms to use only O(log n) auxiliary stack-allocated space sequentially and achieve polylogarithmic span. This allows for efficient parallel execution with minimal auxiliary memory.
  • Relaxed PIP Model: Allows for O(n¹⁻ε) shared (heap-allocated) auxiliary space for some ε > 0, while still aiming for polylogarithmic span. This offers more flexibility in algorithm design.

A key theoretical contribution is the Decomposable Property. This property allows existing non-in-place parallel algorithms to be converted into efficient Relaxed PIP algorithms if they can reduce a problem of size n to a subproblem of size n - n¹⁻ε/r using n¹⁻ε work. This enables the reuse of highly optimized non-in-place algorithms for the reduction step.

The authors then present a suite of new PIP algorithms for various problems, including:

  • Scan (prefix sum)
  • Filter
  • Partition
  • Merge and Mergesort
  • Random Permutation
  • List Contraction and Tree Contraction
  • Graph Connectivity and Biconnectivity
  • Minimum Spanning Forest

They also introduce a novel strong PIP algorithm for scan that is optimal in terms of work and span.

Datasets

Not discussed in the paper. The algorithms operate on generic input arrays and data structures.

Key Insights and Ideas

  • Decoupling Space and Span: The authors successfully decouple the analysis of auxiliary space from the span (parallelism) by using the work-span model and distinguishing between stack-allocated and heap-allocated memory. This is a significant theoretical advancement over older PRAM models.
  • The Decomposable Property: This is a powerful algorithmic technique that allows existing, highly optimized non-in-place algorithms to be transformed into practical, memory-efficient PIP algorithms. It provides a systematic way to design PIP algorithms for a broad range of problems.
  • Practical Performance of PIP: Contrary to intuition that in-place algorithms might be slower due to memory access patterns, the authors demonstrate through extensive experiments that their PIP algorithms often match or outperform their non-in-place counterparts. This is attributed to reduced memory footprint, leading to fewer cache misses and page faults.
  • Strong PIP is Achievable: The paper shows that for fundamental operations like scan, optimal strong PIP algorithms (using only logarithmic auxiliary space) are indeed possible, challenging previous assumptions.

Key Results

  • New PIP Algorithms: The paper presents new Relaxed PIP algorithms for random permutation, list contraction, tree contraction, merging, filter, partition, and graph problems (connectivity, biconnectivity, MSF).
  • Optimal Strong PIP Scan: A new strong PIP algorithm for scan is presented with optimal O(n) work and O(log n) span, using only O(log n) auxiliary space.
  • Experimental Validation: Implementations of scan, filter, random permutation, list contraction, and tree contraction were compared against state-of-the-art non-in-place algorithms from the PBBS benchmark suite.
  • Scan and Filter: PIP versions were 25-45% faster than non-in-place counterparts.
  • List Contraction: PIP version was 15-20% faster.
  • Tree Contraction: PIP version was 60-70% faster.
  • Random Permutation: The most optimized PIP version (RP-Final) had only a modest 30-40% overhead compared to the non-in-place PBBS version, while using significantly less auxiliary space (e.g., 4% of RP-PBBS).
  • Space Efficiency: For relaxed PIP algorithms, auxiliary space usage was typically between 0.9% and 3.7% of input size, a dramatic improvement over linear space requirements.

Limitations and Future Work

  • Relaxed PIP Space Trade-off: While the Relaxed PIP model allows sublinear space, there's a trade-off: reducing space further can increase running time (as shown in Table 7 for random permutation).
  • Work-Efficiency in Strong PIP: While some strong PIP algorithms are presented, achieving work-efficiency for all problems in this model remains a challenge.
  • Graph Algorithms: The presented graph algorithms (connectivity, biconnectivity, MSF) are "almost" relaxed PIP, with some theoretical bounds that are slightly worse than the ideal relaxed PIP model.
  • Future Work: The authors suggest extending their work to other graph problems and exploring parallel in-place algorithms for more complex data structures and algorithms. They also plan to compare their algorithms with newer versions of PBBS that might include in-place variants.

Summary updated

BibTeX
@inproceedings{gu2021parallel,
  author = {Yan Gu and Omar Obeya and Julian Shun},
  title = {{Parallel In-Place Algorithms: Theory and Practice}},
  booktitle = {Apocs},
  year = {2021},
  doi = {10.1137/1.9781611976489.9},
}
Figure