-
Notifications
You must be signed in to change notification settings - Fork 29k
Revert "[SPARK-48628][CORE] Add task peak on/off heap memory metrics" #47747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
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
This reverts commit 717a6da.
Member
Author
|
cc @liuzqt , @JoshRosen, @cloud-fan , @jiangxb1987 , @Ngone51 , @mridulm from #47192 |
Member
Author
cloud-fan
approved these changes
Aug 14, 2024
LuciferYang
approved these changes
Aug 14, 2024
Member
Author
|
Thank you, @cloud-fan and @LuciferYang . |
Member
Author
|
All relevant tests passed. |
JoshRosen
pushed a commit
that referenced
this pull request
Aug 21, 2024
### What changes were proposed in this pull request? This PR is trying to revive #47192, which was [reverted](#47747) due to regression in `ExternalAppendOnlyUnsafeRowArrayBenchmark`. **Root cause** We eventually decided to aggregate peak memory usage from all consumers on each `acquireExecutionMemory` invocation. (see [this discussion](#47192 (comment))), which is O(n) complexity where `n` is the number of consumers. `ExternalAppendOnlyUnsafeRowArrayBenchmark` is implemented in a way that all iterations are run in a single task context, therefore the number of consumers is exploding. Notice that `TaskMemoryManager.consumers` is never cleaned up the whole lifecycle, and `TaskMemoryManager.acquireExecutionMemory` is a very frequent operation, doing a linear complexity(in terms of number of consumers) operation here might not be a good choice. This benchmark might be a corner case, but it's still possible to have a large number of consumers in a large query plan. I fallback to the previous implementation: maintain current execution memory with an extra lock. cc Ngone51 #### Benchmark result [ExternalAppendOnlyUnsafeRowArrayBenchmark-results](https://github.com/liuzqt/spark/actions/runs/10415213026) [ExternalAppendOnlyUnsafeRowArrayBenchmark-jdk21-results](https://github.com/liuzqt/spark/actions/runs/10414246805) ### Why are the changes needed? ### Does this PR introduce _any_ user-facing change? NO ### How was this patch tested? New unit tests. ### Was this patch authored or co-authored using generative AI tooling? NO Closes #47776 from liuzqt/SPARK-48628. Authored-by: Ziqi Liu <[email protected]> Signed-off-by: Josh Rosen <[email protected]>
a0x8o
added a commit
to a0x8o/spark
that referenced
this pull request
Aug 21, 2024
### What changes were proposed in this pull request? This PR is trying to revive apache/spark#47192, which was [reverted](apache/spark#47747) due to regression in `ExternalAppendOnlyUnsafeRowArrayBenchmark`. **Root cause** We eventually decided to aggregate peak memory usage from all consumers on each `acquireExecutionMemory` invocation. (see [this discussion](apache/spark#47192 (comment))), which is O(n) complexity where `n` is the number of consumers. `ExternalAppendOnlyUnsafeRowArrayBenchmark` is implemented in a way that all iterations are run in a single task context, therefore the number of consumers is exploding. Notice that `TaskMemoryManager.consumers` is never cleaned up the whole lifecycle, and `TaskMemoryManager.acquireExecutionMemory` is a very frequent operation, doing a linear complexity(in terms of number of consumers) operation here might not be a good choice. This benchmark might be a corner case, but it's still possible to have a large number of consumers in a large query plan. I fallback to the previous implementation: maintain current execution memory with an extra lock. cc Ngone51 #### Benchmark result [ExternalAppendOnlyUnsafeRowArrayBenchmark-results](https://github.com/liuzqt/spark/actions/runs/10415213026) [ExternalAppendOnlyUnsafeRowArrayBenchmark-jdk21-results](https://github.com/liuzqt/spark/actions/runs/10414246805) ### Why are the changes needed? ### Does this PR introduce _any_ user-facing change? NO ### How was this patch tested? New unit tests. ### Was this patch authored or co-authored using generative AI tooling? NO Closes #47776 from liuzqt/SPARK-48628. Authored-by: Ziqi Liu <[email protected]> Signed-off-by: Josh Rosen <[email protected]>
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?
This reverts commit 717a6da.
Why are the changes needed?
To fix a performance regression.
During the regular performance audit,
ExternalAppendOnlyUnsafeRowArrayBenchmarkdetected a performance regression caused by SPARK-48626.Does this PR introduce any user-facing change?
No. This is not released yet.
How was this patch tested?
Pass the CIs.
Was this patch authored or co-authored using generative AI tooling?
No.