Why is Random Forest training considered embarrassingly parallel?
Last updated
Each tree is grown on its own bootstrap sample with its own random feature choices, and no tree depends on any other. All B trees can therefore be built simultaneously on separate cores or machines, and the only communication needed is collecting them at the end.
No sequential dependency: Contrast with boosting: tree t fits the residuals of trees 1..t-1, so trees must be built in order. Boosting can only parallelize work within a tree (e.g., split search).
Minimal coordination:
Each worker only needs the data and an independent random seed.
Aggregation (vote or average) is a trivial reduce step.
In practice:
In scikit-learn,
n_jobs=-1distributes trees across cores viajoblib.Spark MLlib distributes the work across a cluster.
Speedup is near-linear until cores exceed B.
Prediction is parallel for the same reason: every tree scores independently.
Caveats:
Each worker may need a copy of the data, which drives memory pressure with process-based parallelism.
Seeds must be set per tree for reproducibility.