You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zhengruifeng (via GitHub)" <gi...@apache.org> on 2026/08/11 14:34:57 UTC

[PR] [SPARK-58715][ML] Use explicit fields for clustering model size estimation [spark]

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

   ### What changes were proposed in this pull request?
   
   This PR updates the ML `KMeansModel`, `BisectingKMeansModel`, and `GaussianMixtureModel` size estimates to pass only their persisted MLlib data fields to `SizeEstimator`.
   
   For Gaussian mixture models, it estimates each Gaussian mean and covariance rather than the `MultivariateGaussian` wrapper. For bisecting K-means, it makes the MLlib model root available to Spark-internal code so the ML wrapper can list the fields directly.
   
   ### Why are the changes needed?
   
   `SizeEstimator` recursively follows object references. Estimating an entire parent MLlib model can include transient or lazily initialized derived state, such as distance structures, statistics, or logging fields, rather than only persisted model data. Explicit fields make the accounting predictable and avoid retaining those auxiliary object graphs during estimation.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   ```
   build/sbt -java-home /usr/lib/jvm/java-17-openjdk-amd64 'mllib / Compile / compile'
   ```
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Codex (GPT-5)


-- 
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


Re: [PR] [SPARK-58715][ML][CONNECT] Use explicit fields for clustering model size estimation [spark]

Posted by "uros-b (via GitHub)" <gi...@apache.org>.
uros-b commented on PR #57932:
URL: https://github.com/apache/spark/pull/57932#issuecomment-5255339611

   LGTM, thank you @zhengruifeng!


-- 
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


Re: [PR] [SPARK-58715][ML][CONNECT] Use explicit fields for clustering model size estimation [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng closed pull request #57932: [SPARK-58715][ML][CONNECT] Use explicit fields for clustering model size estimation
URL: https://github.com/apache/spark/pull/57932


-- 
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


Re: [PR] [SPARK-58715][ML][CONNECT] Use explicit fields for clustering model size estimation [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #57932:
URL: https://github.com/apache/spark/pull/57932#issuecomment-5260371836

   **Merge Summary:**
   - merged into master https://github.com/apache/spark/commit/afa9031aafbe50259ff56ff68d78c0bc8c7ac79c
   - merged into branch-4.x https://github.com/apache/spark/commit/c121eb46fff841886cb77a1e992f51f6d3ee6d3f
   
   *Posted by `merge_spark_pr.py`*


-- 
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