-
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
feat: Add priority based memory reclaim framework #11598
Conversation
tanjialiang
commented
Nov 19, 2024
•
edited
Loading
edited
- Adds priority base reclaiming to memory reclaim framework. The priority determines which memory pool to reclaim first on the same level. This would help to make reclaim more application logic aware.
- Make join node reclaim priority lower than others. This is because cost of reclaiming (spilling) on join node is high compared to other nodes.
✅ Deploy Preview for meta-velox canceled.
|
38a339b
to
1661131
Compare
@tanjialiang has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
d5693b4
to
e352ec7
Compare
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.
@tanjialiang LGTM % minors. Thanks!
velox/exec/MemoryReclaimer.cpp
Outdated
if (candidate.reclaimableBytes == 0) { | ||
continue; | ||
uint64_t reclaimedBytes{0}; | ||
for (uint32_t i = 0, j = i; i < candidates.size(); i = j) { |
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.
Why we need to handle priority in parallel memory reclaimer? thanks!
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.
Right, we don't need to. They all run at once.
d65eaf7
to
beec9aa
Compare
@tanjialiang has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
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.
@tanjialiang thanks for the update % minors.
@@ -174,9 +174,10 @@ bool isLeftNullAwareJoinWithFilter( | |||
class HashJoinMemoryReclaimer final : public MemoryReclaimer { | |||
public: | |||
static std::unique_ptr<memory::MemoryReclaimer> create( | |||
std::shared_ptr<HashJoinBridge> joinBridge) { | |||
std::shared_ptr<HashJoinBridge> joinBridge, | |||
int32_t priority = 0) { |
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.
Do we enforce a priority input later?
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.
Yeah we can probably enforce that later. But now we don't want to enforce as the current priority setting is on Task level.
velox/exec/Task.h
Outdated
@@ -69,14 +69,17 @@ class Task : public std::enable_shared_from_this<Task> { | |||
/// thread are passed on to a separate consumer. | |||
/// @param onError Optional callback to receive an exception if task | |||
/// execution fails. | |||
/// @param memoryArbitrationPriority Optional priority on task that, in a |
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.
Let's be specific for memory arbitration for now?
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.
yeah
beec9aa
to
e46ef29
Compare
…11598) Summary: * Adds priority base reclaiming to memory reclaim framework. The priority determines which memory pool to reclaim first on the same level. This would help to make reclaim more application logic aware. * Make join node reclaim priority lower than others. This is because cost of reclaiming (spilling) on join node is high compared to other nodes. Reviewed By: xiaoxmeng Differential Revision: D66261340 Pulled By: tanjialiang
This pull request was exported from Phabricator. Differential Revision: D66261340 |
…11598) Summary: * Adds priority base reclaiming to memory reclaim framework. The priority determines which memory pool to reclaim first on the same level. This would help to make reclaim more application logic aware. * Make join node reclaim priority lower than others. This is because cost of reclaiming (spilling) on join node is high compared to other nodes. Reviewed By: xiaoxmeng Differential Revision: D66261340 Pulled By: tanjialiang
e46ef29
to
d0a22d0
Compare
This pull request was exported from Phabricator. Differential Revision: D66261340 |
…11598) Summary: * Adds priority base reclaiming to memory reclaim framework. The priority determines which memory pool to reclaim first on the same level. This would help to make reclaim more application logic aware. * Make join node reclaim priority lower than others. This is because cost of reclaiming (spilling) on join node is high compared to other nodes. Reviewed By: xiaoxmeng Differential Revision: D66261340 Pulled By: tanjialiang
d0a22d0
to
6dd01a9
Compare
This pull request was exported from Phabricator. Differential Revision: D66261340 |
…11598) Summary: * Adds priority base reclaiming to memory reclaim framework. The priority determines which memory pool to reclaim first on the same level. This would help to make reclaim more application logic aware. * Make join node reclaim priority lower than others. This is because cost of reclaiming (spilling) on join node is high compared to other nodes. Reviewed By: xiaoxmeng Differential Revision: D66261340 Pulled By: tanjialiang
6dd01a9
to
078c12a
Compare
This pull request was exported from Phabricator. Differential Revision: D66261340 |
…11598) Summary: * Adds priority base reclaiming to memory reclaim framework. The priority determines which memory pool to reclaim first on the same level. This would help to make reclaim more application logic aware. * Make join node reclaim priority lower than others. This is because cost of reclaiming (spilling) on join node is high compared to other nodes. Reviewed By: xiaoxmeng Differential Revision: D66261340 Pulled By: tanjialiang
078c12a
to
2cd6fce
Compare
This pull request was exported from Phabricator. Differential Revision: D66261340 |
…11598) Summary: * Adds priority base reclaiming to memory reclaim framework. The priority determines which memory pool to reclaim first on the same level. This would help to make reclaim more application logic aware. * Make join node reclaim priority lower than others. This is because cost of reclaiming (spilling) on join node is high compared to other nodes. Reviewed By: xiaoxmeng Differential Revision: D66261340 Pulled By: tanjialiang
2cd6fce
to
49605f5
Compare
This pull request was exported from Phabricator. Differential Revision: D66261340 |
…11598) Summary: * Adds priority base reclaiming to memory reclaim framework. The priority determines which memory pool to reclaim first on the same level. This would help to make reclaim more application logic aware. * Make join node reclaim priority lower than others. This is because cost of reclaiming (spilling) on join node is high compared to other nodes. Reviewed By: xiaoxmeng Differential Revision: D66261340 Pulled By: tanjialiang
49605f5
to
d9e761c
Compare
This pull request was exported from Phabricator. Differential Revision: D66261340 |
…11598) Summary: * Adds priority base reclaiming to memory reclaim framework. The priority determines which memory pool to reclaim first on the same level. This would help to make reclaim more application logic aware. * Make join node reclaim priority lower than others. This is because cost of reclaiming (spilling) on join node is high compared to other nodes. Reviewed By: xiaoxmeng Differential Revision: D66261340 Pulled By: tanjialiang
d9e761c
to
f9cf776
Compare
This pull request was exported from Phabricator. Differential Revision: D66261340 |
f9cf776
to
fb37a25
Compare
…11598) Summary: * Adds priority base reclaiming to memory reclaim framework. The priority determines which memory pool to reclaim first on the same level. This would help to make reclaim more application logic aware. * Make join node reclaim priority lower than others. This is because cost of reclaiming (spilling) on join node is high compared to other nodes. Reviewed By: xiaoxmeng Differential Revision: D66261340 Pulled By: tanjialiang
This pull request was exported from Phabricator. Differential Revision: D66261340 |
…11598) Summary: * Adds priority base reclaiming to memory reclaim framework. The priority determines which memory pool to reclaim first on the same level. This would help to make reclaim more application logic aware. * Make join node reclaim priority lower than others. This is because cost of reclaiming (spilling) on join node is high compared to other nodes. Reviewed By: xiaoxmeng Differential Revision: D66261340 Pulled By: tanjialiang
fb37a25
to
f89c432
Compare
This pull request was exported from Phabricator. Differential Revision: D66261340 |
Summary: * Adds priority base reclaiming to memory reclaim framework. The priority determines which memory pool to reclaim first on the same level. This would help to make reclaim more application logic aware. * Make join node reclaim priority lower than others. This is because cost of reclaiming (spilling) on join node is high compared to other nodes. X-link: facebookincubator/velox#11598 Reviewed By: xiaoxmeng Differential Revision: D66261340 Pulled By: tanjialiang
Summary: Pull Request resolved: #111 * Adds priority base reclaiming to memory reclaim framework. The priority determines which memory pool to reclaim first on the same level. This would help to make reclaim more application logic aware. * Make join node reclaim priority lower than others. This is because cost of reclaiming (spilling) on join node is high compared to other nodes. X-link: facebookincubator/velox#11598 Reviewed By: xiaoxmeng Differential Revision: D66261340 Pulled By: tanjialiang fbshipit-source-id: c03b2ef25b39dc8771f66321731d5a88da26638e
@tanjialiang merged this pull request in 939c102. |