Skip to main content
QUICK REVIEW

[Paper Review] Parallel Weighted Random Sampling

Lorenz Hübschle-Schneider, Peter Sanders|arXiv (Cornell University)|Jan 1, 2019
Data Management and AlgorithmsComputer Science5 citations
TL;DR

This paper presents efficient, scalable parallel algorithms for weighted random sampling across shared-memory and distributed-memory systems. It introduces output-sensitive, linear-work methods for sampling with and without replacement, alias tables, and reservoir sampling, achieving near-linear speedups on up to 158 threads and 256 nodes, with communication-efficient designs for distributed streaming data.

ABSTRACT

Data structures for efficient sampling from a set of weighted items are an important building block of many applications. However, few parallel solutions are known. We close many of these gaps both for shared-memory and distributed-memory machines. We give efficient, fast, and practicable algorithms for sampling single items, k items with/without replacement, permutations, subsets, and reservoirs. We also give improved sequential algorithms for alias table construction and for sampling with replacement. Experiments on shared-memory parallel machines with up to 158 threads show near linear speedups both for construction and queries.

Motivation & Objective

  • Address the lack of efficient parallel algorithms for weighted random sampling in large-scale data workloads.
  • Design scalable, communication-efficient algorithms for weighted sampling in distributed-memory systems with minimal coordination overhead.
  • Develop output-sensitive algorithms where work scales linearly with the number of samples, improving performance for skewed distributions.
  • Optimize alias table construction for both sequential and parallel execution, reducing space and improving practicality.
  • Enable efficient reservoir sampling from distributed data streams using a fully distributed model with minimal communication.

Proposed method

  • Use a hybrid approach combining table-based sampling and divide-and-conquer trees to achieve output-sensitive sampling with replacement.
  • Design a parallel construction of alias tables using work-efficient parallel primitives, including prefix sums and sample-based partitioning.
  • Apply a nonlinear transformation to random deviates to enable linear-work weighted random permutation via sorting.
  • Leverage the owner-computes model in distributed systems, where each processor handles its local data with minimal communication.
  • Introduce a communication-efficient reservoir sampling algorithm based on a fully distributed streaming model, minimizing inter-processor communication.
  • Use integer sorting primitives as subroutines, with complexity bounds depending on the log-weight ratio u = log(w_max/w_min).

Experimental results

Research questions

  • RQ1Can we design parallel algorithms for weighted random sampling that achieve linear work and logarithmic latency on shared-memory systems?
  • RQ2How can we make weighted sampling with replacement efficient when the number of distinct samples is much smaller than the total sample size?
  • RQ3What is the minimal communication cost for distributed weighted reservoir sampling while maintaining scalability?
  • RQ4Can we construct alias tables in parallel with better space efficiency and performance than existing sequential methods?
  • RQ5Is it possible to perform weighted random permutation in linear work using a nonlinear transformation of random deviates?

Key findings

  • The proposed parallel alias table construction achieves near-linear speedup on up to 158 threads for both preprocessing and query phases.
  • The output-sensitive sampling algorithm for sampling with replacement uses work linear in the number of distinct samples, significantly improving performance on skewed distributions.
  • Distributed weighted reservoir sampling achieves good speedups on up to 256 nodes (5120 cores), demonstrating high scalability and low communication overhead.
  • The algorithm for weighted random permutation uses a nonlinear transformation of random deviates, enabling linear work via sorting and avoiding expensive sampling steps.
  • The communication-efficient distributed reservoir sampling algorithm reduces inter-processor communication to sublinear levels in local work, especially under random data distribution.
  • The sequential alias table construction is simplified and more space-efficient, offering a practical improvement over prior methods.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.