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/07/22 03:56:37 UTC

[PR] [SPARK-58181][ML][CONNECT] Add OneVsRest size estimate [spark]

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

   ### What changes were proposed in this pull request?
   
   This patch adds a model-owned `estimatedSize` implementation for `OneVsRestModel`. The estimate includes the model's parameter metadata, label metadata, and the estimates of its binary classification submodels.
   
   ### Why are the changes needed?
   
   Spark Connect uses `Model.estimatedSize` to enforce ML model-cache limits. `OneVsRestModel` was the only concrete classification model that inherited the default graph traversal. Its copied submodels retain their parent estimators, so that traversal can include shared Spark session/context state rather than only the cached model's data. The explicit estimate follows the established classifier-model pattern and accounts only for state owned by the One-vs-Rest model.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Spark Connect cache accounting for One-vs-Rest models becomes more accurate, preventing shared runtime state from inflating the estimated model size. There is no public API change.
   
   ### How was this patch tested?
   
   Added a regression test that verifies the estimate is the sum of One-vs-Rest parameter metadata, label metadata, and its contained models' estimates.
   
   Ran:
   
   ```
   JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 build/sbt 'mllib/testOnly *OneVsRestSuite'
   ```
   
   All 17 tests passed.
   
   ### 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-58250][ML][CONNECT] Add OneVsRest size estimate [spark]

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

   **Merge Summary:**
   - merged into master https://github.com/apache/spark/commit/c1d87077e6e3f6d5b90d16d7e07a17b5e81f7a3a
   - merged into branch-4.x https://github.com/apache/spark/commit/27aebe769827715e9dec4af006e6a4f498cec988
   
   *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


Re: [PR] [SPARK-58250][ML][CONNECT] Add OneVsRest size estimate [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng closed pull request #57420: [SPARK-58250][ML][CONNECT] Add OneVsRest size estimate
URL: https://github.com/apache/spark/pull/57420


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