You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/10/11 08:23:34 UTC

[GitHub] [spark] zhengruifeng opened a new pull request, #38203: [SPARK-40745][MLLIB] Reduce the shuffle size of ALS in mllib

zhengruifeng opened a new pull request, #38203:
URL: https://github.com/apache/spark/pull/38203

   ### What changes were proposed in this pull request?
   Reduce the shuffle size of ALS
   this is a corresponding change of https://github.com/apache/spark/pull/37918 on the `.mllib` side
   
   ### Why are the changes needed?
   Reduce the shuffle size of ALS
   
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   
   ### How was this patch tested?
   existing UT


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] srowen closed pull request #38203: [SPARK-40745][MLLIB] Reduce the shuffle size of ALS in `.mllib`

Posted by GitBox <gi...@apache.org>.
srowen closed pull request #38203: [SPARK-40745][MLLIB] Reduce the shuffle size of ALS in `.mllib`
URL: https://github.com/apache/spark/pull/38203


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] zhengruifeng commented on pull request #38203: [SPARK-40745][MLLIB] Reduce the shuffle size of ALS in `.mllib`

Posted by GitBox <gi...@apache.org>.
zhengruifeng commented on PR #38203:
URL: https://github.com/apache/spark/pull/38203#issuecomment-1274301748

   take [`RankingMetricsExample`](https://github.com/apache/spark/blob/e3058ba17cb4512537953eb4ded884e24ee93ba2/examples/src/main/scala/org/apache/spark/examples/mllib/RankingMetricsExample.scala) for example:
   
   ```
   import org.apache.spark.mllib.evaluation.{RankingMetrics, RegressionMetrics}
   import org.apache.spark.mllib.recommendation.{ALS, Rating}
   
   
   val ratings = spark.read.textFile("data/mllib/sample_movielens_data.txt").rdd.map { line =>
       val fields = line.split("::")
       Rating(fields(0).toInt, fields(1).toInt, fields(2).toDouble - 2.5)
   }.cache()
   
   // Map ratings to 1 or 0, 1 indicating a movie that should be recommended
   val binarizedRatings = ratings.map(r => Rating(r.user, r.product, if (r.rating > 0) 1.0 else 0.0)).cache()
   
   
   val numIterations = 1
   val rank = 10
   val lambda = 0.01
   val model = ALS.train(ratings, rank, numIterations, lambda)
   
   val userRecommended = model.recommendProductsForUsers(10)
   
   userRecommended.count()
   ```
   
   before:
   ![image](https://user-images.githubusercontent.com/7322292/195038806-acad9193-838e-4a32-9ec4-5e390d143e61.png)
   
   
   after:
   ![image](https://user-images.githubusercontent.com/7322292/195038629-9b249726-05a2-4b90-a804-7aef089f505f.png)
   
   the shuffle size was reduced from `310.1 KiB` to `110.9 KiB`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] zhengruifeng commented on pull request #38203: [SPARK-40745][MLLIB] Reduce the shuffle size of ALS in `.mllib`

Posted by GitBox <gi...@apache.org>.
zhengruifeng commented on PR #38203:
URL: https://github.com/apache/spark/pull/38203#issuecomment-1274591982

   @srowen the new implementation uses `Array[V]` instead of `BoundedPriorityQueue[V]` in ser/deser


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] zhengruifeng commented on pull request #38203: [SPARK-40745][MLLIB] Reduce the shuffle size of ALS in `.mllib`

Posted by GitBox <gi...@apache.org>.
zhengruifeng commented on PR #38203:
URL: https://github.com/apache/spark/pull/38203#issuecomment-1274521309

   cc @srowen @WeichenXu123 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] srowen commented on pull request #38203: [SPARK-40745][MLLIB] Reduce the shuffle size of ALS in `.mllib`

Posted by GitBox <gi...@apache.org>.
srowen commented on PR #38203:
URL: https://github.com/apache/spark/pull/38203#issuecomment-1274589226

   Seems fine. Do you have one sentence about what the optimization is here - why is it smaller?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] srowen commented on pull request #38203: [SPARK-40745][MLLIB] Reduce the shuffle size of ALS in `.mllib`

Posted by GitBox <gi...@apache.org>.
srowen commented on PR #38203:
URL: https://github.com/apache/spark/pull/38203#issuecomment-1274945241

   Merged to master


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org