Skip to content
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(scheduler): add partial scheduling based on min replicas #6221

Merged
merged 20 commits into from
Jan 28, 2025

Conversation

sakoush
Copy link
Member

@sakoush sakoush commented Jan 23, 2025

What this PR does / why we need it:
This PR introduces the ability to do partial scheduling for a given model if:

  • The number of replicas for all candidate servers is less than the desired replica of the model
  • The min replicas of the model is less than the available replicas of the server to load the model onto

In this case we load the model on as many replicas as possible assuming it meets min replicas requirement; we mark the model as Available / Ready (instead of the ScheduleFailed) . We also make sure that when there is more capacity available we retry scheduling to make sure so that the model can potentially make use of this extra capacity.

We also favour servers that have the models loaded to minimise ping-ping behaviour.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

@sakoush sakoush added the v2 label Jan 23, 2025
@sakoush sakoush marked this pull request as ready for review January 24, 2025 09:44
@sakoush sakoush requested a review from lc525 as a code owner January 24, 2025 09:44
@sakoush sakoush requested review from driev and removed request for lc525 January 24, 2025 09:54
scheduler/pkg/scheduler/scheduler.go Outdated Show resolved Hide resolved
// also send an update if the model is not yet at desired replicas, if we have partial scheduling

if replicaStateUpdated || modelVersion.state.State == ScheduleFailed || model.IsDeleted() || modelVersion.state.State == ModelProgressing ||
(modelVersion.state.State == ModelAvailable && len(modelVersion.GetAssignment()) < modelVersion.DesiredReplicas()) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oof.. this statement is becoming unwieldy (if it wasn't already). I wonder if it's worth having an explicit task to figure out how to refactor it.

Copy link
Member Author

@sakoush sakoush Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we should fix it, it keeps growing. I will add a todo in the code.

@sakoush sakoush force-pushed the INFRA-1188/partial_scheduling branch from 065a56e to 6170cdf Compare January 28, 2025 09:43
@sakoush sakoush merged commit c078211 into SeldonIO:v2 Jan 28, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants