Github user mengxr commented on a diff in the pull request:

    https://github.com/apache/spark/pull/593#discussion_r12196231
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/recommendation/ALS.scala ---
    @@ -381,14 +399,15 @@ class ALS private (
        * the users (or (blockId, (p, u, r)) for the products). We create these 
simultaneously to avoid
        * having to shuffle the (blockId, (u, p, r)) RDD twice, or to cache it.
        */
    -  private def makeLinkRDDs(numBlocks: Int, ratings: RDD[(Int, Rating)], 
partitioner: Partitioner)
    +  private def makeLinkRDDs(numUserBlocks: Int, numProductBlocks: Int, 
ratings: RDD[(Int, Rating)],
    +    userPartitioner: Partitioner, productPartitioner: Partitioner)
         : (RDD[(Int, InLinkBlock)], RDD[(Int, OutLinkBlock)]) =
       {
    -    val grouped = ratings.partitionBy(new HashPartitioner(numBlocks))
    +    val grouped = ratings.partitionBy(new HashPartitioner(numUserBlocks))
    --- End diff --
    
    Instead of using `HashPartitioner`, we should use the same partitioner we 
used for creating in/out link blocks. This helps determine shuffle dependency. 
See my previous comment on subclassing partitioner.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to