You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "sunchao (via GitHub)" <gi...@apache.org> on 2024/03/12 17:32:48 UTC

[PR] fix: Include active spiller when computing peak shuffle memory [arrow-datafusion-comet]

sunchao opened a new pull request, #196:
URL: https://github.com/apache/arrow-datafusion-comet/pull/196

   ## Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #.
   
   ## Rationale for this change
   
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   
   We should include `activeSpillerSorter` when calculating peak shuffle memory. Otherwise, the stats will be inaccurate.
   
   ## What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   \
   ## How are these changes tested?
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   -->
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: Include active spiller when computing peak shuffle memory [arrow-datafusion-comet]

Posted by "sunchao (via GitHub)" <gi...@apache.org>.
sunchao merged PR #196:
URL: https://github.com/apache/arrow-datafusion-comet/pull/196


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: Include active spiller when computing peak shuffle memory [arrow-datafusion-comet]

Posted by "sunchao (via GitHub)" <gi...@apache.org>.
sunchao commented on code in PR #196:
URL: https://github.com/apache/arrow-datafusion-comet/pull/196#discussion_r1522186708


##########
spark/src/main/java/org/apache/spark/shuffle/sort/CometShuffleExternalSorter.java:
##########
@@ -257,6 +257,7 @@ private long getMemoryUsage() {
     for (SpillSorter sorter : spillingSorters) {
       totalPageSize += sorter.getMemoryUsage();
     }
+    totalPageSize += activeSpillSorter.getMemoryUsage();

Review Comment:
   I'm not sure how to test this in a unit test, but this is clearly something missing. In the non-async path, only `activeSpillSorter` is used for sorting and spilling, and currently `getMemoryUsage` doesn't take account of it.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: Include active spiller when computing peak shuffle memory [arrow-datafusion-comet]

Posted by "viirya (via GitHub)" <gi...@apache.org>.
viirya commented on PR #196:
URL: https://github.com/apache/arrow-datafusion-comet/pull/196#issuecomment-1992427091

   Oh, seems you need to check if it is null.
   
   ```
     org.apache.spark.SparkException: Job aborted due to stage failure: Task 3 in stage 2108.0 failed 1 times, most recent failure: Lost task 3.0 in stage 2108.0 (TID 22860) (d3cb52f725b1 executor driver): java.lang.NullPointerException: Cannot invoke "org.apache.spark.shuffle.sort.CometShuffleExternalSorter$SpillSorter.getMemoryUsage()" because "this.activeSpillSorter" is null
   ```


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: Include active spiller when computing peak shuffle memory [arrow-datafusion-comet]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #196:
URL: https://github.com/apache/arrow-datafusion-comet/pull/196#issuecomment-1992527573

   ## [Codecov](https://app.codecov.io/gh/apache/arrow-datafusion-comet/pull/196?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Project coverage is 33.31%. Comparing base [(`6bedce4`)](https://app.codecov.io/gh/apache/arrow-datafusion-comet/commit/6bedce410f5a5b961eb2cc1dbc8840c17bdab4bb?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`d026cfd`)](https://app.codecov.io/gh/apache/arrow-datafusion-comet/pull/196?dropdown=coverage&src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@            Coverage Diff            @@
   ##               main     #196   +/-   ##
   =========================================
     Coverage     33.30%   33.31%           
     Complexity      767      767           
   =========================================
     Files           107      107           
     Lines         35372    35375    +3     
     Branches       7657     7658    +1     
   =========================================
   + Hits          11782    11784    +2     
     Misses        21144    21144           
   - Partials       2446     2447    +1     
   ```
   
   
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/arrow-datafusion-comet/pull/196?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: Include active spiller when computing peak shuffle memory [arrow-datafusion-comet]

Posted by "singhpk234 (via GitHub)" <gi...@apache.org>.
singhpk234 commented on code in PR #196:
URL: https://github.com/apache/arrow-datafusion-comet/pull/196#discussion_r1521955464


##########
spark/src/main/java/org/apache/spark/shuffle/sort/CometShuffleExternalSorter.java:
##########
@@ -257,6 +257,7 @@ private long getMemoryUsage() {
     for (SpillSorter sorter : spillingSorters) {
       totalPageSize += sorter.getMemoryUsage();
     }
+    totalPageSize += activeSpillSorter.getMemoryUsage();

Review Comment:
   [doubt] any ideas for testing it ? whats the max variance this can cause in worst case ? activeSpillSorter is just full ? 



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: Include active spiller when computing peak shuffle memory [arrow-datafusion-comet]

Posted by "sunchao (via GitHub)" <gi...@apache.org>.
sunchao commented on PR #196:
URL: https://github.com/apache/arrow-datafusion-comet/pull/196#issuecomment-1993619199

   Thanks, merged


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org