-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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: remove normalize score section in the scheduling framwork #1178
feat: remove normalize score section in the scheduling framwork #1178
Conversation
/remove-kind feature |
@draveness: GitHub didn't allow me to request PR reviews from the following users: liu-cong. Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
ec94458
to
6e5cb9b
Compare
@bsalamat Comments have been addressed, PTAL. |
BTW: do we need to remove the normalize score in this image? |
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.
Thanks Draven
1. The first phase is called "score" which is used to rank nodes that have passed | ||
the filtering phase. The scheduler will call `Score` of each scoring plugin for | ||
each node. There will be a well defined range of integers representing the minimum | ||
and maximum scores. |
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.
@bsalamat we don't enforce this range currently, is this supposed to be enforced before or after the normalize (if exists)?
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.
@bsalamat we don't enforce this range currently, is this supposed to be enforced before or after the normalize (if exists)?
if we refactor InterPodAffinity with the scheduling framework and the score-normalize pattern, we can't enforce this in the "score" phase.
We could reword to "the scoring plugin will return a node to score map after the score and normalize score phases, which will be a well-defined range of integers..."
But it would be a little more complicated for the user to understand.
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.
We can enforce the range at the time we apply the weights.
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.
We can enforce the range at the time we apply the weights.
Yes, we could do that, but the developers are supposed to decide how to enforce the range in this extension point, ex: shrink by the ratio ( 10*(current-min)/(max-min)
), etc.
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.
Yes, they can do that, but the framework should also either error out when the score returned by a plugin is not within the range, or apply a simple default flooring/ceiling logic.
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.
we shouldn't call it by default
+1
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.
If we set the range of scores to [0, 100], we should multiply the framework's score with 0.1 or priority functions' score with 10.
We can also keep the current range [0, 10] which don't need the annoying multiply operation. And I don't think [0, 10] and [0, 100] would make a difference here.
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 don't have a reason to change the range from [0, 10] to [0, 100], unless past experiences indicated that the [0, 10] range is too tight, is that the case @bsalamat?
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.
We have seen many instances that our scoring functions are unpredictable. While extending the range will not address this problem, it can be one step towards making the score functions more differentiating. One can imagine that in a large cluster with thousands of nodes, a [0, 10] range is not differentiating enough. Now that we are transitioning to the framework, we can consider expanding the range.
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.
We have seen many instances that our scoring functions are unpredictable. While extending the range will not address this problem, it can be one step towards making the score functions more differentiating. One can imagine that in a large cluster with thousands of nodes, a [0, 10] range is not differentiating enough. Now that we are transitioning to the framework, we can consider expanding the range.
OK, I'll multiply the original score with 10.
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 to me overall.
Thanks Draven!
6e5cb9b
to
5bfa707
Compare
@draveness can you please add a new commit when making new changes to the PR instead of amending? this is useful for the reviewers to see what changes were made since the last review. |
Sure, I could do this the next time. |
To summaries, what we reached consensus is as below:
Is there anything wrong or missing? If not, I'll update the KEP and related PRs to these changes. |
I would rephrase these two items as:
The reason that I propose this minor change is that right after running
As @ahg-g pointed, the framework will not provide a default implementation. When the output of a score plugin without
That's one option. However, these are our internal functions. We could change them to provide finer grain scores.
|
@bsalamat , It seems that the purpose of Did I miss any thing? |
The difference between Score and NormalizeScore is the interface, the former evaluates one node at a time, the latter evaluates all the nodes (normalization could require a global view). It is a pattern that I assume was observed frequently and warranted an explicit support from the framework. |
725b3ba
to
3cbd7d5
Compare
I've updated the score section and kept the current range. Besides, I created an kubernetes/kubernetes#81281 to discuss the path to expand the range to [0, 100], we could update the KEP after the discussion. |
3cbd7d5
to
e27703a
Compare
@ahg-g comments have been addressed, please take another look |
Thanks, there is still one instance of "NodeScoreMax" |
done |
3a154d3
to
b2c8d03
Compare
/lgtm please squash the commits |
3fd04bc
to
5ff5d20
Compare
Done, friendly ping @bsalamat for final approval. |
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
/approve
Thanks, @draveness!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahg-g, bsalamat, draveness, liu-cong The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/sig scheduling
/priority important-soon
/kind feature
As the discussion on kubernetes/kubernetes#80383, we decided to merge the normalize score extension point into the score.
/assign @bsalamat @ahg-g