Skip to content

Commit

Permalink
[SPARK-2544][MLLIB] Improve ALS algorithm resource usage
Browse files Browse the repository at this point in the history
Author: GuoQiang Li <[email protected]>
Author: witgo <[email protected]>

Closes apache#929 from witgo/improve_als and squashes the following commits:

ea25033 [GuoQiang Li] checkpoint products 3,6,9 ...
154dccf [GuoQiang Li] checkpoint products only
c5779ff [witgo] Improve ALS algorithm resource usage
  • Loading branch information
witgo authored and mengxr committed Jul 30, 2014
1 parent e3d85b7 commit fc47bb6
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ class ALS private (
rank, lambda, alpha, YtY)
previousProducts.unpersist()
logInfo("Re-computing U given I (Iteration %d/%d)".format(iter, iterations))
if (sc.checkpointDir.isDefined && (iter % 3 == 0)) {
products.checkpoint()
}
products.setName(s"products-$iter").persist()
val XtX = Some(sc.broadcast(computeYtY(products)))
val previousUsers = users
Expand All @@ -268,6 +271,9 @@ class ALS private (
logInfo("Re-computing I given U (Iteration %d/%d)".format(iter, iterations))
products = updateFeatures(numProductBlocks, users, userOutLinks, productInLinks,
rank, lambda, alpha, YtY = None)
if (sc.checkpointDir.isDefined && (iter % 3 == 0)) {
products.checkpoint()
}
products.setName(s"products-$iter")
logInfo("Re-computing U given I (Iteration %d/%d)".format(iter, iterations))
users = updateFeatures(numUserBlocks, products, productOutLinks, userInLinks,
Expand Down

0 comments on commit fc47bb6

Please sign in to comment.