Repository navigation
[core] Force message refresh if no message is received in ray syncer mode. - #29905
Merged
Merged
Conversation
Signed-off-by: Yi Cheng <[email protected]>
Signed-off-by: Yi Cheng <[email protected]>
Signed-off-by: Yi Cheng <[email protected]>
Signed-off-by: Yi Cheng <[email protected]>
Signed-off-by: Yi Cheng <[email protected]>
Signed-off-by: Yi Cheng <[email protected]>
Signed-off-by: Yi Cheng <[email protected]>
Signed-off-by: Yi Cheng <[email protected]>
Signed-off-by: Yi Cheng <[email protected]>
Signed-off-by: Yi Cheng <[email protected]>
Signed-off-by: Yi Cheng <[email protected]>
Signed-off-by: Yi Cheng <[email protected]>
Signed-off-by: Yi Cheng <[email protected]>
fishbone
marked this pull request as ready for review
November 2, 2022 07:39
Contributor
Author
|
synced with @jjyao offline. One concern is about the some corner cases where allocate happens but new message hasn't received, but refresh happened. It's actually also happening in the current code. I'll try to fix this with syncer too. |
Signed-off-by: Yi Cheng <[email protected]>
jjyao
reviewed
Nov 3, 2022
| RAY_CONFIG(bool, use_ray_syncer, false) | ||
| /// Due to the protocol draw back, raylet needs to refresh the message if | ||
| /// no message is received for a while. | ||
| RAY_CONFIG(int64_t, message_refresh_interval_ms, 3000) |
Contributor
There was a problem hiding this comment.
maybe name it ray_syncer_message_refresh_interval_ms for now until ray syner is rolled out.
Contributor
There was a problem hiding this comment.
Also add a link to the protocol draw back for future reference.
Contributor
Author
There was a problem hiding this comment.
I think we need this until the protocol is updated.
We'll roll out ray syncer with this config.
I'll add comment and rename it.
Signed-off-by: Yi Cheng <[email protected]>
jjyao
approved these changes
Nov 5, 2022
|
|
||
| /// Feature flag to use the ray syncer for resource synchronization | ||
| RAY_CONFIG(bool, use_ray_syncer, false) | ||
| /// Due to the protocol draw back, raylet needs to refresh the message if |
Signed-off-by: Yi Cheng <[email protected]>
WeichenXu123
pushed a commit
to WeichenXu123/ray
that referenced
this pull request
Dec 19, 2022
…mode. (ray-project#29905) In the current protocol of scheduling, it depends on resource refresh to fix some deadlocks. Ray syncer will only send the message if it's updated, so it breaks the previous assumption. The idea case is to fix the protocol, but it's way more complicated. So instead we fix it by making it the same as before. [Here](ray-project@da74e7e#diff-09f46509f86d054afbfa3f7d08dff86e821c15001a79705ce7f4d67fc3fa1ad4R359) is more details about how it breaks the current protocol and lead a deadlock. The fix is done in node manager instead of ray syncer or scheduler. It's not idea because even the local status not changing, it's still going to cost some cpu to update the cluster resource manager. But due to the bad code in resource manager/cluster resource scheduler/cluster task manager/..., it's hard to make it optimal and easy to understand. Given that it's still much better than before and we only update every 3s by default, it should be ok. We'll revisit it once we roll it out by default. Signed-off-by: Weichen Xu <[email protected]>
8 tasks
fishbone
added a commit
that referenced
this pull request
Apr 26, 2023
… on. (#34687) ## Why are these changes needed? The new communication protocol will only deliver the message when necessary. But some part of ray assumes that even no new message generated, it'll still get the delivery and thus it ends up incorrect resource number. For example, in GCS's view - GCS's view has Node: {CPU: 1} - Then GCS tries to schedule a task => Node: {CPU: 0} - Then GCS got a snapshot from that node, and that node has PG scheduled, - Then it becomes {CPU:0, PG:1}, and the previous pg scheduling failed. So, GCS'll add it back and in the end it's {CPU:1, PG:1} which is incorrect. - Later GCS will try to schedule task to this node and this node will reject since it doesn't have any CPU left. This issue happens in both raylet and GCS. In raylet, distributed task scheduling can suffer from this issue. In GCS, placement group can suffer from this issue. In test_placement_group_3.py, it's because the scheduling of a placement group bundle failed and in the same time, it get the snapshot. So in the end it has one cpu in the GCS's view. PG's scheduling algorithm is deterministic, so it'll try to reschedule the bundles infinitely. The raylet issue was fixed in [29905](#29905). This PR move the logic from node manager to cluster resource manager. The logic is not added into ray syncer is because it's more related to application's logical about how to handle the update. Besides, only one module needs to update. The future receiver needs to not assume the eventually delivery of the repeat messages.
ProjectsByJackHe
pushed a commit
to ProjectsByJackHe/ray
that referenced
this pull request
May 4, 2023
… on. (ray-project#34687) ## Why are these changes needed? The new communication protocol will only deliver the message when necessary. But some part of ray assumes that even no new message generated, it'll still get the delivery and thus it ends up incorrect resource number. For example, in GCS's view - GCS's view has Node: {CPU: 1} - Then GCS tries to schedule a task => Node: {CPU: 0} - Then GCS got a snapshot from that node, and that node has PG scheduled, - Then it becomes {CPU:0, PG:1}, and the previous pg scheduling failed. So, GCS'll add it back and in the end it's {CPU:1, PG:1} which is incorrect. - Later GCS will try to schedule task to this node and this node will reject since it doesn't have any CPU left. This issue happens in both raylet and GCS. In raylet, distributed task scheduling can suffer from this issue. In GCS, placement group can suffer from this issue. In test_placement_group_3.py, it's because the scheduling of a placement group bundle failed and in the same time, it get the snapshot. So in the end it has one cpu in the GCS's view. PG's scheduling algorithm is deterministic, so it'll try to reschedule the bundles infinitely. The raylet issue was fixed in [29905](ray-project#29905). This PR move the logic from node manager to cluster resource manager. The logic is not added into ray syncer is because it's more related to application's logical about how to handle the update. Besides, only one module needs to update. The future receiver needs to not assume the eventually delivery of the repeat messages. Signed-off-by: Jack He <[email protected]>
architkulkarni
pushed a commit
to architkulkarni/ray
that referenced
this pull request
May 16, 2023
… on. (ray-project#34687) ## Why are these changes needed? The new communication protocol will only deliver the message when necessary. But some part of ray assumes that even no new message generated, it'll still get the delivery and thus it ends up incorrect resource number. For example, in GCS's view - GCS's view has Node: {CPU: 1} - Then GCS tries to schedule a task => Node: {CPU: 0} - Then GCS got a snapshot from that node, and that node has PG scheduled, - Then it becomes {CPU:0, PG:1}, and the previous pg scheduling failed. So, GCS'll add it back and in the end it's {CPU:1, PG:1} which is incorrect. - Later GCS will try to schedule task to this node and this node will reject since it doesn't have any CPU left. This issue happens in both raylet and GCS. In raylet, distributed task scheduling can suffer from this issue. In GCS, placement group can suffer from this issue. In test_placement_group_3.py, it's because the scheduling of a placement group bundle failed and in the same time, it get the snapshot. So in the end it has one cpu in the GCS's view. PG's scheduling algorithm is deterministic, so it'll try to reschedule the bundles infinitely. The raylet issue was fixed in [29905](ray-project#29905). This PR move the logic from node manager to cluster resource manager. The logic is not added into ray syncer is because it's more related to application's logical about how to handle the update. Besides, only one module needs to update. The future receiver needs to not assume the eventually delivery of the repeat messages.
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.
Why are these changes needed?
In the current protocol of scheduling, it depends on resource refresh to fix some deadlocks. Ray syncer will only send the message if it's updated, so it breaks the previous assumption.
The idea case is to fix the protocol, but it's way more complicated. So instead we fix it by making it the same as before.
Here is more details about how it breaks the current protocol and lead a deadlock.
The fix is done in node manager instead of ray syncer or scheduler. It's not idea because even the local status not changing, it's still going to cost some cpu to update the cluster resource manager. But due to the bad code in resource manager/cluster resource scheduler/cluster task manager/..., it's hard to make it optimal and easy to understand. Given that it's still much better than before and we only update every 3s by default, it should be ok. We'll revisit it once we roll it out by default.
Related issue number
Checks
git commit -s) in this PR.scripts/format.shto lint the changes in this PR.