gagafunctor commented on a change in pull request #23983: [SPARK-26881][core] 
Heuristic for tree aggregate depth
URL: https://github.com/apache/spark/pull/23983#discussion_r263774048
 
 

 ##########
 File path: 
mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/RowMatrix.scala
 ##########
 @@ -775,6 +777,34 @@ class RowMatrix @Since("1.0.0") (
         s"The number of rows $m is different from what specified or previously 
computed: ${nRows}.")
     }
   }
+
+  /**
+    * Computing desired tree aggregate depth necessary to avoid exceeding
+    * driver.MaxResultSize during aggregation.
+    * Based on the formulae: (numPartitions)^(1/depth) * objectSize <= 
DriverMaxResultSize
+    * @param aggregatedObjectSizeInMb the size, in megabytes, of the object 
being tree aggregated
+    * @param numPartitions the number of partitions for which to aggregate 
partial results
+    * @param maxDriverResultSizeInMb the value of the parameter 
spark.driver.maxResultSize in MB
+    */
+  private[spark] def getTreeAggregateIdealDepth(
+      aggregatedObjectSizeInMb: Int,
+      numPartitions: Int = rows.getNumPartitions,
+      maxDriverResultSizeInMb: Long = rows.conf.get[Long](MAX_RESULT_SIZE)) = {
+    logWarning(
 
 Review comment:
   Okay to get rid of numPartitions argument.
   But with the same logic in mind, I guess I should I get rid of the 
maxDriverResultSizeInMb argument aswell, since we can access it from sparkConf.
   Will do that in next update, to come soon.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to