Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-28866][ML] Persist item factors RDD when checkpointing in ALS
### What changes were proposed in this pull request? In ALS ML implementation, for non-implicit case, we checkpoint the RDD of item factors, between intervals. Before checkpointing (.checkpoint()) and materializing (.count()) RDD, this RDD was not persisted. It causes recomputation. In an experiment, there is performance difference between persisting and no persisting before checkpointing the RDD. The performance difference is not big, but this change is not big too. The actual performance difference varies depending the interval of checkpoint, training dataset, etc. ### Why are the changes needed? Persisting the RDD before checkpointing the RDD of item factors can avoid recomputation. ### Does this PR introduce any user-facing change? No ### How was this patch tested? Manual check RDD recomputation or not. Taking 30% MovieLens 20M Dataset as training dataset. Setting checkpoint dir for SparkContext. Fitting an ALS model like: ```scala val als = new ALS() .setMaxIter(100) .setCheckpointInterval(5) .setRegParam(0.01) .setUserCol("userId") .setItemCol("movieId") .setRatingCol("rating") val t0 = System.currentTimeMillis() val model = als.fit(training) val t1 = System.currentTimeMillis() ``` Before this patch: 65.386 s After this patch: 61.022 s Closes #25576 from viirya/persist-item-factors. Authored-by: Liang-Chi Hsieh <[email protected]> Signed-off-by: Sean Owen <[email protected]>
- Loading branch information