MapReduce particle filtering with exact resampling and deterministic runtime

Jeyarajan Thiyagalingam, Lykourgos Kekempanos, Simon Maskell

Abstract

Particle filters are powerful tools for state estimation in non-linear, non-Gaussian systems, but their accuracy is heavily dependent on the number of particles used. Parallelizing the resampling step in these filters is challenging due to data-dependent bottlenecks that often lead to non-deterministic runtimes. This paper presents a novel, exact resampling algorithm designed for MapReduce frameworks that achieves a deterministic runtime with $O((\log N)^2)$ time complexity. We evaluate the implementation on Apache Hadoop and Apache Spark, demonstrating significant performance gains over previous $O((\log N)^3)$ methods while highlighting the current communication overheads inherent in standard MapReduce abstractions.

1. Introduction

Particle filters (PF) provide a robust Bayesian framework for tracking and estimating states in complex systems, such as robot localization and weather forecasting. The fundamental principle of PF is that increasing the number of particles improves estimation accuracy. Consequently, there is a strong motivation to leverage Big Data frameworks like Hadoop and Spark to scale these filters to millions of particles.

However, the "resampling" step—required to mitigate particle degeneracy by discarding low-weight particles and duplicating high-weight ones—is notoriously difficult to parallelize. Because the number of duplicates depends on the specific data distribution, naive parallel implementations often suffer from unpredictable, non-deterministic runtimes. This paper introduces a fully distributed, exact resampling algorithm that guarantees deterministic execution time, a critical requirement for real-time systems.

2. The Resampling Bottleneck

In a standard particle filter, particles eventually lose weight diversity, a phenomenon known as degeneracy. Resampling resets the particle population, but the process is inherently global: the decision to duplicate a particle depends on the weights of all other particles. Previous distributed resampling attempts either used approximations that altered the filter's statistical properties or relied on divide-and-conquer strategies with $O((\log N)^3)$ complexity.

3. Proposed Methodology: $O((\log N)^2)$ Exact Resampling

The core contribution of this work is an improved redistribution strategy that reduces time complexity to $O((\log N)^2)$.

3.1 Algorithmic Innovation

The authors introduce an "All-Trailing-Zeros" (ATZ) sequence-based strategy. Unlike previous methods that required sorting at every node of a divide-and-conquer tree, this approach performs a single Bitonic sort upfront to group non-zero copy counts. Subsequent operations—including element-wise mathematics, cumulative sums, and array rotations—are highly parallelizable and do not require further sorting.

3.2 MapReduce Mapping

The algorithm is mapped onto the MapReduce paradigm by treating each particle's index as a unique key. This allows the framework to handle the distribution and shuffling of particle data across a cluster.

The MapReduce workflow for particle filtering, illustrating the transition from input particles to updated values through mappers and reducers.

4. Experimental Evaluation

The algorithm was implemented and tested on two major frameworks: Apache Hadoop (disk-based) and Apache Spark (in-memory). A synthetic scalar estimation problem was used to stress-test the resampling component.

4.1 Framework Comparison

The results confirm that Spark is significantly better suited for the iterative nature of particle filtering. By utilizing Resilient Distributed Datasets (RDDs) to keep data in memory, Spark achieved a 25-fold speedup over Hadoop, which is hampered by frequent disk I/O to the Hadoop Distributed File System (HDFS).

4.2 Scalability and Speedup

The proposed $O((\log N)^2)$ algorithm demonstrated a 4x speedup over the $O((\log N)^3)$ state-of-the-art on a per-core basis. The system successfully scaled to $2^{24}$ (approximately 16.7 million) particles across 512 processor cores.

5. Discussion: The MapReduce Abstraction Tax

Despite the algorithmic improvements, the authors provide a candid assessment of the "MapReduce tax." Currently, a highly optimized single-core implementation outperforms the distributed MapReduce version by a factor of approximately 20. This is primarily due to the massive communication overhead and "lineage bloat" in Spark caused by assigning a unique key to every individual particle.

6. Conclusion and Future Work

This research establishes a deterministic, exact foundation for distributed resampling. To overcome current performance bottlenecks, future work will focus on "coarse-grained" MapReduce implementations, where multiple particles are grouped under a single key to reduce network traffic and metadata overhead. The authors anticipate that the benefits of this distributed framework will be most apparent in applications involving computationally intensive likelihood and dynamic models, where the parallelization of the model itself outweighs the overhead of the resampling step.

Summary updated

BibTeX
@article{thiyagalingam2017mapreduce,
  author = {Jeyarajan Thiyagalingam and Lykourgos Kekempanos and Simon Maskell},
  title = {{MapReduce particle filtering with exact resampling and deterministic runtime}},
  journal = {EURASIP J. Adv. Signal Process.},
  year = {2017},
  doi = {10.1186/s13634-017-0505-9},
}
Figure