-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Reduce indices buffer memory usage in LocalPartition #7939
Conversation
✅ Deploy Preview for meta-velox canceled.
|
This pull request was exported from Phabricator. Differential Revision: D51984975 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Yuhta nice optimization. Thanks!
velox/exec/LocalPartition.cpp
Outdated
@@ -331,10 +330,14 @@ void LocalPartition::addInput(RowVectorPtr input) { | |||
} | |||
|
|||
auto numInput = input->size(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NYC: const auto numInput =
…or#7939) Summary: In the current code, if we partition N rows with M columns to K partitions, we allocate a buffer of N indices for each partitioned output M columns, so the total memory for these indices is $`O(NMK)`$. In this change we reduce this to $`O(NM)`$ by allocating the indices for each partition with the number of rows in that partition only. Reviewed By: xiaoxmeng Differential Revision: D51984975
6cdbb50
to
0470e54
Compare
This pull request was exported from Phabricator. Differential Revision: D51984975 |
1 similar comment
This pull request was exported from Phabricator. Differential Revision: D51984975 |
This pull request has been merged in 4f95700. |
Conbench analyzed the 1 benchmark run on commit There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
Summary: In the current code, if we partition N rows with M columns to K partitions, we allocate a buffer of N indices for each partitioned output M columns, so the total memory for these indices is$O(NMK)$ . In this change we reduce this to $O(NM)$ by allocating the indices for each partition with the number of rows in that partition only.
Differential Revision: D51984975