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

Forest Packing: Fast Parallel, Decision Forests

James Browne, Disa Mhembere, Tyler M. Tomita, Joshua T. Vogelstein, Randal C. BurnsSDM 2018 · DOI

Introduction

Decision forests, such as Random Forests, remain a cornerstone of machine learning due to their interpretability, robustness, and computational efficiency. However, in High-Performance Computing (HPC) environments, they face a significant "memory problem." Classifying data requires traversing hundreds or thousands of trees from root to leaf. In standard memory layouts, each step often points to a random memory location, triggering frequent "cache misses." These random jumps force the processor to wait for data from slow main memory (RAM), severely bottlenecking performance.

Methods: The Forest Packing Suite

To address this, the authors introduce Forest Packing, a suite of memory-layout and scheduling optimizations designed to maximize cache performance.

Visualizing memory layout optimizations: Breadth-First (BF), Depth-First (DF), Leaf Compression (DF-), Statistical Ordering (Stat), and Interleaving (Bin).

The optimization follows a hierarchical approach:

  1. Leaf Compression (DF-): Redundant leaf nodes are replaced with a single class node per category at the end of the array, nearly halving the tree size.
  2. Statistical Ordering (Stat): By tracking frequent paths during training, the algorithm places the most likely child node immediately after its parent in memory. This increases the probability of cache hits for common traversal paths.
  3. Interleaving (Bin): Nodes from multiple trees are "interleaved" into a single "bin" at frequently accessed top levels. A single cache line fetch then provides data for several trees simultaneously.
  4. Asynchronous Execution (Bin+): To hide remaining latency, the system uses out-of-order execution. It issues prefetch commands for upcoming trees while performing computations for the current one.

Evaluation and Datasets

The system was evaluated on three diverse benchmarks representing common HPC workloads:

  • Allstate Claim Prediction: 33 features, 500,000 observations (Kaggle).
  • Higgs Boson: 30 features, 250,000 observations (Physics).
  • MNIST: 784 features, 60,000 handwritten digits (Computer Vision).

Key Results

Forest Packing achieves substantial performance gains over existing state-of-the-art implementations.

Mean prediction time per observation across three datasets for different memory layouts.
  • Raw Speedup: The system achieved a 4x speedup over Ranger (optimized C++) and a 50x speedup over R-RerF (popular R library).
  • Layout Impact: As shown in the performance comparison, the "Stat" layout alone significantly reduces execution time compared to standard breadth-first (BF) layouts, often by 30% or more. The "Bin" layout further improves throughput by exploiting memory-level parallelism.
  • Scaling: The system demonstrates linear weak scaling and efficient multicore utilization, achieving a 26x speedup on 32 cores. Scaling is slightly sublinear due to memory interference at high core counts.

Key Insights

  • Predictable Paths: Tree traversal is not truly random. Using "leaf cardinality" allows for statistical prediction of likely paths, enabling layout optimization.
  • Memory-Level Parallelism: By interleaving nodes, the ensemble nature of forests is exploited to turn slow memory fetches into productive ones for multiple trees.
  • Software-Controlled Prefetching: Manual prefetch instructions help the hardware overcome the difficulties of predicting non-linear tree structures.

Limitations and Future Work

While highly effective for deep trees, the current approach does not yet address shallow trees typical of Gradient Boosting (e.g., XGBoost). Additionally, as core counts increase, shared memory bandwidth becomes a bottleneck, suggesting a need for more "cache-aware" scheduling. Future research could also explore applying these packing techniques to "online" learning scenarios where trees are updated dynamically.

Summary updated

BibTeX
@inproceedings{browne2018forest,
  author = {James Browne and Disa Mhembere and Tyler M. Tomita and Joshua T. Vogelstein and Randal C. Burns},
  title = {{Forest Packing: Fast Parallel, Decision Forests}},
  booktitle = {SDM},
  year = {2018},
  doi = {10.1137/1.9781611975673.6},
}
Figure