Efficient Irregular Wavefront Propagation Algorithms on Hybrid CPU-GPU Machines

George Teodoro, Tony Pan, Tahsin Kurc, Jun Kong, Lee Cooper, Joel SaltzarXiv 2012

TL;DR

The authors present a highly efficient parallel framework for the Irregular Wavefront Propagation Pattern (IWPP), a foundational computation pattern in large-scale image processing. By combining a novel hierarchical multi-level queue structure for GPUs with a tile-based cooperative CPU-GPU scheduling strategy, they achieve up to 85× speedups, enabling researchers to process massive 96K×96K biomedical images in seconds.

What Problem Does This Paper Address?

High-resolution whole-slide tissue images (often ranging from 50K×50K to 100K×100K pixels) are vital for modern biomedical research and patient care. However, processing these images on standard single-CPU systems can take hours. Key low-level segmentation operations, such as morphological reconstruction and distance transforms, rely on what the authors define as the Irregular Wavefront Propagation Pattern (IWPP).

Unlike classic wavefront patterns that sweep predictably across a grid, an irregular wavefront expands dynamically and unpredictably based on the underlying image data.

Binary morphological reconstruction from markers

This data-dependent irregularity makes IWPP notoriously difficult to parallelize efficiently on GPUs. Naive implementations suffer from massive thread synchronization overheads, poor utilization of fast on-chip memories, and severe load imbalances when attempting to coordinate both CPUs and GPUs simultaneously.

Methods

To tackle these challenges, the authors developed a multi-tiered parallelization framework:

  • Hierarchical Multi-Level Queue: To prevent thousands of GPU threads from bottlenecking on a single global queue, the authors designed a three-level queue structure:
  • Per-Thread Queues (TQ): Very small private queues residing in ultra-fast shared memory requiring zero synchronization.
  • Block-Level Queues (BQ): Shared memory queues aggregated from TQs using warp-level parallel prefix-sums.
  • Global Block-Level Queues (GBQ): Located in global memory, populated via high-throughput coalesced memory copies only when a BQ fills up.
  • Tile-Based Parallelization: The input image domain is divided into non-overlapping tiles. Processing units compute local wavefronts independently within their tiles. A dedicated Border Propagation (BP) stage then resolves dependencies across tile boundaries, re-instantiating tile processing only where waves cross borders.
  • Cooperative CPU-GPU Scheduling: To prevent slow CPU cores from bottlenecking fast GPUs, the runtime dynamically allocates tiles using a demand-driven approach. Furthermore, tiles assigned to CPUs are subdivided into smaller micro-partitions and processed in parallel using OpenMP, ensuring a single CPU tile finishes at a pace closer to a GPU tile.

Datasets

The framework was evaluated using high-resolution RGB whole-slide tissue microscopy images provided by the In Silico Brain Tumor Research Center (ISBTRC) at Emory University. The algorithms were pushed to their limits using extreme image resolutions, specifically 64K×64K and 96K×96K pixels, representing the maximum sizes that could fit into the evaluation machine's main system memory.

Key Insights and Ideas

  • Ditching Global Atomics: The transition from a naive atomic-addition queue to a prefix-sum aggregated queue yielded a massive 2.31× performance improvement. This highlights that managing thread communication hierarchically is paramount for irregular grid algorithms on GPUs.
  • Exploiting Commutativity for Overflow Handling: Because IWPP updates are commutative and atomic, the exact order of execution does not alter the final result. The authors leveraged this property to handle queue overflows elegantly: if the global queue space is exceeded, excess elements are simply dropped. The system catches the drop and re-runs the kernel using the partial solution as the next input, incurring a minimal performance penalty (only 6% to 9%).
  • Micro-Tiling Eliminates Load Imbalance: Simply giving a CPU group and a GPU the same size tile ruins heterogeneous performance due to the massive performance gap. Breaking CPU tiles into micro-tiles via OpenMP proved to be the secret sauce for true cooperative execution.
Figure 2: Gray scale morphological reconstruction in 1-dimension. The marker image intensity profile is represented as the red line, and the mask image intensity profile is represented as the blue line. The final image intensity profile is represented as the green line. The arrows show the direction of propagation from the marker intensity profile to the mask intensity profile. The green region shows the changes introduced by the morphological reconstruction process.

Key Results

The framework was tested on a hybrid node equipped with 12 CPU cores and 3 NVIDIA Tesla M2090 (Fermi) GPUs:

  • Morphological Reconstruction: Achieved a 50× speedup over a single-core CPU, processing a massive 96K×96K image in just 21 seconds.
  • Euclidean Distance Transform: Attained an 85.6× speedup, processing a 64K×64K image in a mere 4.1 seconds.
  • The proposed framework consistently outperformed previous state-of-the-art GPU implementations (such as Karas' raster-scan method) by an average of 2.6× to 3.1×, particularly on images with sparse tissue coverage where raster scans waste cycles on empty pixels.

Limitations and Future Work

The primary limitation acknowledged by the authors is that the current framework is restricted to shared-memory hybrid systems (i.e., a single node containing multiple CPUs and GPUs). It does not currently support distributed multi-node cluster architectures.

As a direction for future work, the authors note that their tile-based parallelization strategy can be extended to distributed environments by implementing a message-passing mechanism (like MPI) to exchange border propagation data across network nodes.

Summary updated

BibTeX
@misc{teodoro2012efficient,
  author = {George Teodoro and Tony Pan and Tahsin Kurc and Jun Kong and Lee Cooper and Joel Saltz},
  title = {{Efficient Irregular Wavefront Propagation Algorithms on Hybrid CPU-GPU Machines}},
  year = {2012},
  eprint = {1209.3314},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1209.3314},
}
Figure