Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/14333#discussion_r72416823
--- Diff:
mllib/src/main/scala/org/apache/spark/mllib/clustering/BisectingKMeans.scala ---
@@ -194,8 +196,9 @@ class BisectingKMeans private (
newClusters = summarize(d, newAssignments)
newClusterCenters = newClusters.mapValues(_.center).map(identity)
}
- // TODO: Unpersist old indices.
- val indices = updateAssignments(assignments, divisibleIndices,
newClusterCenters).keys
+ if (preIndices != null) preIndices.unpersist()
+ preIndices = indices
+ indices = updateAssignments(assignments, divisibleIndices,
newClusterCenters).keys
--- End diff --
You are probably ahead of me on this, but let me check something. To
compute `assignments` in the next line, the current `indices` is needed, and
that in turn needs the current value of `assignments`, which needs the previous
copy of `indices` (`preIndices`). But that was unpersisted just above. Should
`preIndices` be unpersisted later, after `indices` is materialized?
But ... is there even an action here? if this just creating a large lineage
then the persisting isn't helping much.
---
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.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]