-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[Enable gcs actor scheduler 1/n] Raylet and GCS schedulers share cluster_task_manager #23829
[Enable gcs actor scheduler 1/n] Raylet and GCS schedulers share cluster_task_manager #23829
Conversation
@iycheng @scv119 Do you have any comments? |
@Chong-Li thanks, the PR looks very good. I'll take a detailed review soon. Meanwhile the test failure looks related to this PR. |
@@ -115,7 +107,7 @@ scheduling::NodeID ClusterResourceScheduler::GetBestSchedulableNode( | |||
bool *is_infeasible) { | |||
// The zero cpu actor is a special case that must be handled the same way by all | |||
// scheduling policies. | |||
if (actor_creation && resource_request.IsEmpty()) { |
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.
cc @jjyao for this change.
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.
I feel we can decouple this change from this PR, seems unrelated?
Sure, I'm going to handle this together with the issue mentioned above (fixing exclude_local_node
parameter).
false); | ||
cluster_resource_manager.AddNodeAvailableResources( | ||
scheduling::NodeID(actor->GetNodeID().Binary()), acquired_resources); | ||
cluster_task_manager_->ScheduleAndDispatchTasks(); |
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.
should we call normal_task_resources_changed_callback_
here? also should we create a helper function if this block is same as HandleWorkerLeaseRejectedReply
?
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.
should we call
normal_task_resources_changed_callback_
here?
The actor's resources have nothing to do with normal_task_resources, so we don't need to call the callback.
also should we create a helper function if this block is same as
HandleWorkerLeaseRejectedReply
?
Sure, just did.
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.
LGTM!
let's wait for @jjyao's review as well! |
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.
Looks good! A few more comments.
@@ -115,7 +107,7 @@ scheduling::NodeID ClusterResourceScheduler::GetBestSchedulableNode( | |||
bool *is_infeasible) { | |||
// The zero cpu actor is a special case that must be handled the same way by all | |||
// scheduling policies. | |||
if (actor_creation && resource_request.IsEmpty()) { |
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.
I feel we can decouple this change from this PR, seems unrelated?
Sure, I'm going to handle this together with the issue mentioned above (fixing exclude_local_node
parameter).
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.
Could we run release tests to make sure everything is ok?
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.
Really excited!
grant_or_reject for raylet based actor scheduling is implemented as part of #23829, so spread scheduling now works for actors just like tasks.
Why are these changes needed?
As discussed in #23460, the long-term plan to enable gcs scheduler is as follows:
Remove RayletBasedActorScheduler and GcsBasedActorScheduler. Instead, handling different actor requests (willing to be scheduled at raylet or gcs) in GcsActorScheduler.
GcsActorScheduler calls ClusterTaskManager, and then ClusterTaskManager calls ClusterResourceScheduler to select node. Besides, because ClusterTaskManager maintains the infeasible and ready queues, the pending queue in GcsActorManager should be removed. After this change, the GcsActorScheduler only manages the lifecycle of leasing (send/cancel lease and push creation task), while the queueing and scheduling (this PR is actually doing the same thing in a quicker way) are handled by ClusterTaskManager. If the leftover responsibility of GcsActorScheduler is simple enough, we may even remove it and reimplement the functions in GcsActorManager.
At raylets, the lease requests (that have already been handled by gcs' ClusterTaskManager) can skip the ClusterTaskManager and directly go to the LocalTaskManager.
Turn on the gcs scheduling feature flag and resolve any leftover failures.
This PR unifies
RayletBasedActorScheduler
andGcsBasedActorScheduler
intoGcsActorScheduler
, which relies onClusterTaskManager
for queueing and scheduling.The key function is
GcsActorScheduler::Schedule()
, in which we decide whether scheduling at GCS, or forwarding the request to a remote Raylet (owner node in most cases) for scheduling.Related issue number
#23460
Checks
scripts/format.sh
to lint the changes in this PR.