[SPARK-51974][CONNECT][ML] Limit model size and per-session model cache size#50751
Closed
WeichenXu123 wants to merge 25 commits intoapache:masterfrom
Closed
[SPARK-51974][CONNECT][ML] Limit model size and per-session model cache size#50751WeichenXu123 wants to merge 25 commits intoapache:masterfrom
WeichenXu123 wants to merge 25 commits intoapache:masterfrom
Conversation
Signed-off-by: Weichen Xu <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
xi-db
reviewed
May 2, 2025
sql/connect/server/src/main/scala/org/apache/spark/sql/connect/config/Connect.scala
Outdated
Show resolved
Hide resolved
xi-db
reviewed
May 2, 2025
|
|
||
| private[ml] val totalSizeBytes: AtomicLong = new AtomicLong(0) | ||
|
|
||
| private[ml] val totalModelCacheSizeBytes: AtomicLong = new AtomicLong(0) |
Contributor
There was a problem hiding this comment.
The "totalSizeBytes" above is tracking the total size in memory. Why do we need to use a different totalModelCacheSizeBytes?
Contributor
Author
There was a problem hiding this comment.
totalModelCacheSizeBytes is for counting in-memory + offloaded data size
totalSizeBytes is for counting in-memory size, I will rename it to totalInMemorySizeBytes
zhengruifeng
reviewed
May 5, 2025
sql/connect/server/src/main/scala/org/apache/spark/sql/connect/ml/MLCache.scala
Outdated
Show resolved
Hide resolved
zhengruifeng
reviewed
May 5, 2025
zhengruifeng
reviewed
May 5, 2025
Contributor
zhengruifeng
left a comment
There was a problem hiding this comment.
I think we need to reformat the error classes, otherwise LGTM
Signed-off-by: Weichen Xu <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
Contributor
Author
|
Refactored configurations: @zhengruifeng @xi-db
Only when |
Signed-off-by: Weichen Xu <[email protected]>
zhengruifeng
approved these changes
May 6, 2025
Contributor
|
LGTM pending CI |
Signed-off-by: Weichen Xu <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
Signed-off-by: Weichen Xu <[email protected]>
Contributor
Author
|
merged to master |
yhuang-db
pushed a commit
to yhuang-db/spark
that referenced
this pull request
Jun 9, 2025
…he size ### What changes were proposed in this pull request? Limit model size and per-session model cache size. Configurations: ``` spark.connect.session.connectML.mlCache.memoryControl.enabled spark.connect.session.connectML.mlCache.memoryControl.maxInMemorySize spark.connect.session.connectML.mlCache.memoryControl.offloadingTimeout spark.connect.session.connectML.mlCache.memoryControl.maxModelSize spark.connect.session.connectML.mlCache.memoryControl.maxSize ``` Only when spark.connect.session.connectML.mlCache.memoryControl.enabled is true, the rest configures can work. ### Why are the changes needed? Motivation: This is for ML cache management, to avoid huge ML cache affecting Spark driver availability. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? UT. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#50751 from WeichenXu123/tree-early-stop. Authored-by: Weichen Xu <[email protected]> Signed-off-by: Weichen Xu <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Limit model size and per-session model cache size.
Configurations:
Only when spark.connect.session.connectML.mlCache.memoryControl.enabled is true, the rest configures can work.
Why are the changes needed?
Motivation: This is for ML cache management, to avoid huge ML cache affecting Spark driver availability.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
UT.
Was this patch authored or co-authored using generative AI tooling?
No.