Change Prefill and Decode filters to be based on a common filter#188
Change Prefill and Decode filters to be based on a common filter#188shmuelk merged 4 commits intollm-d:mainfrom
Conversation
|
I'd be very happy if we can wait with merging this PR few days until the work on #179 is completed. |
elevran
left a comment
There was a problem hiding this comment.
missing case of label not being defined at all. Otherwise, LGTM
|
@elevran is it a valid situation that there are pods which are not marked with 'llm-d.ai/role' label? |
Decode Pods were allowed when no label was defined. The code and comment on the function were inconsistent and the code had |
elevran
left a comment
There was a problem hiding this comment.
approve.
However, note that the filter can be generalized to a cater for the Role based use cases even if it is defined in terms of labels (i.e., not the existing by-label which uses a label-selector).
What you need:
- label name
- allowed values
- what to do when the label is missing
There's no reason to bind the implementation name to "Role". You can create specific instances of the label filter that use the "role" label name just as easily.
I don't want to hold this PR further, but I would prefer it is implemented more generically and not specific to the Role label.
Signed-off-by: Maya Barnea <mayab@il.ibm.com>
… the ByRoleLabel + add related test in scheduler test Signed-off-by: Maya Barnea <mayab@il.ibm.com>
@elevran Agree, current implementation has the label name hard-coded, I'll add it as a parameter and rename to ByLabel |
…rameter). Prefill and decode filters are instances of this filter Signed-off-by: Maya Barnea <mayab@il.ibm.com>
Signed-off-by: Maya Barnea <mayab@il.ibm.com>
| // validValuesApp - list of valid values | ||
| func NewByLabel(name string, labelName string, allowsNoLabel bool, validValuesApp ...string) *ByLabel { |
There was a problem hiding this comment.
| // validValuesApp - list of valid values | |
| func NewByLabel(name string, labelName string, allowsNoLabel bool, validValuesApp ...string) *ByLabel { | |
| // validValues - list of valid values | |
| func NewByLabel(name string, labelName string, allowsNoLabel bool, validValues ...string) *ByLabel { |
There was a problem hiding this comment.
you can change to ByLabelSelector
Also change the doc to use the new name
Signed-off-by: konflux-internal-p02 <170854209+konflux-internal-p02[bot]@users.noreply.github.com> Co-authored-by: konflux-internal-p02[bot] <170854209+konflux-internal-p02[bot]@users.noreply.github.com>
Change Prefill and Decode filters to be based on a common Filter which contains list of valid values in the role label.
These filters cannot be based on ByLabel filter since it uses kubernetes selector which does not support OR between multiple conditions (the logic is: is specific label exists - must have one of the specified values OR the specific label does not defined at all)
Fixes #16
Supersedes #161