Skip to content

Add load based scorer #77

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

Merged
merged 5 commits into from
Apr 29, 2025
Merged

Add load based scorer #77

merged 5 commits into from
Apr 29, 2025

Conversation

mayabar
Copy link
Collaborator

@mayabar mayabar commented Apr 28, 2025

Load-based scorer is based on number of requests in the waiting queue.
It completes the LowQueueFilter, pods with number of waiting requests higher than a threshold is filtered out, pods with number of waiting requests lower than the threshold gets score below 0.5
Ref #66

Copy link
Collaborator

@elevran elevran left a comment

Choose a reason for hiding this comment

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

left some style comments trying to make code more idiomatic (at least based on my experience).
Please decide which, if any, you'd like to accept.

func (s LoadBasedScorer) Score(ctx *types.SchedulingContext, pods []types.Pod) map[types.Pod]float64 {
var scoredPods map[types.Pod]float64 = make(map[types.Pod]float64)

for _, pod := range pods {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
for _, pod := range pods {
for pod := range pods {

// Score 0 will get pod with number of requests in the queue qual to the threshold used in load-based filter (QueueingThresholdLoRA)
// In future pods with additional capacity will get score higher than 0.5
func (s LoadBasedScorer) Score(ctx *types.SchedulingContext, pods []types.Pod) map[types.Pod]float64 {
var scoredPods map[types.Pod]float64 = make(map[types.Pod]float64)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: score would have been a good variable name as well (and shorter):
scorePods[pod] = ... is repetitive, IMHO, and score[pod] = ... is just as readable.

@elevran
Copy link
Collaborator

elevran commented Apr 28, 2025

Issue #66

unclear what issue reference that is intended to do in the commit comment.
Consider using a clearer keyword for linking, such as Fix or Ref.

@mayabar mayabar merged commit 53444a8 into neuralmagic:dev Apr 29, 2025
1 check passed
@mayabar
Copy link
Collaborator Author

mayabar commented Apr 29, 2025

Fix #66

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants