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_r263773233
##########
File path:
mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/RowMatrix.scala
##########
@@ -117,6 +117,7 @@ class RowMatrix @Since("1.0.0") (
// Computes n*(n+1)/2, avoiding overflow in the multiplication.
// This succeeds when n <= 65535, which is checked above
val nt = if (n % 2 == 0) ((n / 2) * (n + 1)) else (n * ((n + 1) / 2))
+ val gramianSizeInMb = (nt / 1000000) * 8
Review comment:
I'm not sure why, is it because (nt / 1M) * 8 would be hurt by double
precision issues after nt/1M ?
Anyway I'll apply your suggestion
----------------------------------------------------------------
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]