You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/proposals/0845-scheduler-architecture-proposal/README.md
+34-18Lines changed: 34 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,18 +9,27 @@ The Scheduling Subsystem is a framework used to implement scheduling algorithms.
9
9
10
10
## Design Principles
11
11
- The scheduler framework should act as an independent library, there should be no dependency on EPP packages defined outside of the scheduler
12
-
- The *framework* should be agnostic to web protocols(such as HTTP), endpoint types (such as model servers), and K8s concepts.
12
+
- The *framework* should be agnostic to endpoint types (such as model servers), and K8s concepts.
13
13
- Opinions should be held by the plugins, not the framework
14
14
- The entry & exit points should be defined by the framework, acting as the API surface of the system
15
15
- Multiple scheduling 'profiles' should be able to be ran for a single request.
16
16
- They can be conditionally dependent on previous runs, or in parallel
17
-
- Plugin state is managed by the plugin itself
17
+
- State management
18
+
- State per request: This is managed by what we are calling CycleState and its lifecycle is tied to the request.
19
+
Cycle state is created internally by the Scheduler per request and its pointer is passed as argument.
20
+
- State managed by the plugin struct itself: The lifecycle of this state is tied to the plugin, and since plugins will be instantiated once,
21
+
it is a state that plugins can use across requests (like prefix-cache index).
22
+
- State managed by the data layer: each endpoint will be associated with state (currently metrics) that a data layer plugin can add to it.
23
+
A data layer plugin could be one that scrapes v1/models from the endpoint for example.
18
24
19
25
## Definitions
20
26
-**Scheduling Framework** - The system created to allow for a pluggable scheduling algorithm.
21
-
-**Scheduling Profile** - A named, specific set of Filter(s), Scorer(s), & Picker used to select endpoints.
22
-
-**Scheduler** - An extensible implementation of a scheduling algorithm. Including logic to select Scheduling Profiles, the Scheduling Profiles themselves, & logic to interpret the result.
23
-
-**Scheduling Cycle** - A single run of a Scheduler through the Scheduling Framework.
27
+
-**Scheduler Profile** - A named, specific set of Filter(s), Scorer(s), & Picker used to select endpoints.
28
+
-**Scheduler Profile Run** - a one time run of the Scheduler Profile filters, scorers and picker given a request.
29
+
-**Scheduler** - An extensible implementation of a scheduling algorithm. Including logic to select Scheduler Profiles iteratively,
30
+
the Scheduler Profiles themselves, & logic to interpret the result.
31
+
-**Scheduling Cycle** - A single run of a Scheduler through the Scheduling Framework. a scheduling cycle includes one or
32
+
more Scheduler Profile runs (at least one).
24
33
-**Plugin** - Implementation of framework-defined interface(s) to add or extend logic across the framework.
25
34
26
35
## Proposal
@@ -33,23 +42,32 @@ The Scheduling System can loosely be defined into 3 sections:
33
42
- A *configuration API* to define the Scheduler, Profile(s), & the plugins used within those profiles
34
43
35
44
A sketch of the System, with extension points is here:
Describing the interface extension points & flow is the simplest way to convey the intent of what the framework should enable:
39
48
40
-
### PreSchedule
49
+
### ProfileHandler
41
50
42
-
PreSchedule is the entry point into the scheduling cycle (called by the framework). PreSchedule, selects profiles conditionally based on:
51
+
ProfileHandler is a schedler plugin with two extension points - ProfilePick, and ProcessProfilesResults.
52
+
Below is a detailed explanation about these extension points.
53
+
Only a single ProfileHandler plugin may be defined per scheduler.
54
+
55
+
### ProfilePick
56
+
57
+
ProfilePick is the entry point into the scheduling cycle (called by the framework).
58
+
it selects profiles conditionally based on:
43
59
44
60
- Request data
45
-
- Results
61
+
- Results of previously executed SchedulerProfiles
46
62
- Cycle State
47
63
48
-
PreSchedule will be continuously called so long as profiles are returned; multiple profiles may be returned in a single call. Only a single PreSchedule function may be defined per scheduler.
64
+
ProfilePick will be continuously called so long as profiles are returned; multiple profiles may be returned in a single call.
65
+
ProfilePick extension point will be configured as part of a ProfileHandler plugin.
66
+
Since there is only a single ProfileHandler plugin, that means there is only a single ProfilePick function.
49
67
50
-
### Profile Cycle
68
+
### Scheduler Profile Run
51
69
52
-
The profile cycle consists of 3 defined functions`Filter`, `Score`, & `Pick`
70
+
The SchedulerProfile run consists of 3 defined phases`Filter`, `Score`, & `Pick`
53
71
54
72
*Profile Constraints*
55
73
- A profile can have any number of `Filter` plugins registered (including zero)
@@ -61,17 +79,15 @@ The profile cycle consists of 3 defined functions `Filter`, `Score`, & `Pick`
61
79
Filter runs before any scoring, and remove endpoints that are not fit for selection. The framework will return an error to the client if the endpoints are filtered to zero.
62
80
63
81
#### Score
64
-
Score applies a score to each remaining endpoint provided. Scorers SHOULD keep their score values in a normalized range: [0-1]. Any weighting should be added at the SchedulingProfile configuration level.
82
+
Score applies a score to each remaining endpoint provided. Scorers SHOULD keep their score values in a normalized range: [0-1]. Any weighting should be added at the SchedulerProfile configuration level.
65
83
66
84
#### Pick
67
85
Picker selects the endpoint(s) from the provided list of scored endpoints. Picker MUST return, one endpoint at minimum.
68
86
69
87
70
-
### PostSchedule
71
-
PostSchedule receives the output of the result(s) of the scheduling cycle(s) and makes sense of the data to be consumed by the calling system.
72
-
73
-
### PostResponse
74
-
PostResponse is a special case extension that can optionally be implemented by a plugin that needs to augment its state based on response or request data. This should only be implemented for plugins that need to update state outside of the scheduling cycle. PostResponse is ran at the time of processing a response.
88
+
### ProcessProfilesResults
89
+
ProcessProfilesResults receives the output of the result(s) of the scheduler profile(s) and makes sense of the data to be consumed by the calling system.
90
+
Since there is only a single ProfileHandler plugin, that means there is only a single ProcessProfilesResults function.
0 commit comments