-
Notifications
You must be signed in to change notification settings - Fork 432
Add cq weight to tiebreakers when deciding tournament winner #6846
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for kubernetes-sigs-kueue canceled.
|
cc/ @PBundyra |
I would prefer to consider a more generic solution, as described in #6774 (comment) So, |
This is an orthogonal thing. Here we only focus on what should happen when there is a tie wrt DRS (no matter what resolution/type we use) |
This was discussed here: #6621 and in case of DRS tie, it's a better fallback than CreationTimestamp |
I see, but the change in the DRF may mean that this is almost never reached, because https://github.com/kubernetes-sigs/kueue/pull/6846/files#diff-8716acbdd5bd256fcf6e05caf9b5573b819e7480aca9b6154dc91c8942ae73efR170-R173 would be more picky. It would be good to have a test case which is solved by this, but would not be fixed by increasing DRF resolution itself. |
This code would only be reached if two CQs had different weight yet still DRF (no matter the resoultion) would be the same e.g. So if there are two Workloads submitted at the same time, one coming from CQ1, and one from CQ2, I think it's fair to say that Kueue scheduler should process the one coming from CQ2 first I think this case could be rather common as this is perfectly balanced state of a Cohort. I agree we should have a unit test for that |
sgtm, thanks for clarifying |
95f1617
to
44620a6
Compare
44620a6
to
4043032
Compare
d89a5fa
to
2dc0524
Compare
/retest |
2dc0524
to
7b70438
Compare
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.
Can we simplify it?
152542c
to
b0e4576
Compare
LGTM label has been added. Git tree hash: fd6c4f778bb67178944374d50bb52561387c14ef
|
The release note says "Add cq weight to tiebreakers when deciding FS tournament winner" which is the statement about the code change. The release should focus on the user-facing impact instead. Let me propose, but feel free to adjust if I'm wrong about something: /release-note-edit
/kind bug |
@mimowo: once the present PR merges, I will cherry-pick it on top of 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-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: amy, mimowo 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 |
/release-note-edit
|
/hold |
Ok, I have consulted with @PBundyra that the PR description may not be accurately reflecting the change. I will update the release note according to my current understanding after the consulation. |
So, after consulting I see some disconnect between the issue description and the code. First, the code does not solve the "inifnite preemption loop" and it only affects the comparison function for scheduling, rather than preemption. So, IIUC the more accurate release note would be:
I think we could say this is a small tweak to the API which is underspecified so we can tweak it. However, given the disconnect between description and code I'm not totally sure this change is needed or intended. |
Yeah I think I wrote the description in the earlier phases of understanding this problem and it doesn't reflect the developments upstream. I would still like to get this merged. Assume DWS and priority are equivalent for A, B, D -> value 1 A -> B : A & C admitted, B preempted D -> B : D & C admitted, B preempted E -> B : E & C admitted, B preempted B here is the one that gets preempted/readmitted a lot. So while this isn't about preemption per say, the admission ordering is affecting B's readmission where I would like CQ weight to affect admission ordering. Precision will definitely improve things. But in the case where we have same DRS and priority due to CQ weight differences, I would still like CQ weight to affect admission decisions. WDYT? |
Right, with the new increase in precision hitting the new code on a large cluster will be very rare I think. Sure, you can have "exactly equal DRS" in unit tests as here, but it seems unlikely to be common on large clusters, so I'm a bit concerned about adding extra code which will be seldom exercised. Also, the CQ weight is already part of the DRS computations, so adding this extra oomph to CQ outside of the DRS calculation is ad-hoc. I think we could/should update the CompareDRS after Gabe's PR to say DRS1 < DRS2, when all weight1 > weigth2, given all others is equal. Then all uses of Compare would give the oomph consistently. Still, even with the checked moved to CompareDRS I'm not totally sure this new code would make any practical changes on a large non-unit-test setup. Maybe it makes sense to test the cluster after Gabe's PR to assess the need for the extra checks, which increase code complexity, and are a bit ad-hoc (IMO). |
+1. The original goal of this PR was to prevent cycles, right? I would also favor to keep logic simpler if the main problem is solved |
OTOH, @PBundyra made a good case for it here: #6846 (comment). I don't feel so strongly either way. |
Looking at cluster weights in one sample large cluster: As an example, here's 2 CQ weights:
While this is a bit of defensive programming, it doesn't seem like --too-- much complexity.
No doing this in CompareDRS is probably not the right place. Then cq weight would precede workload priority in the ordering for admission candidate selection in the tournament. The logic for admission and preemption seem to work differently.
|
I don't fully get how this would prevent cycles from happening
This description is not clear to me. However given the example I provided earlier, and the one Amy has just provided I support this change regardless of whether it prevents cycles or not. I don't perceive it as too much complexity, just a small nice improvement to the FS scheduling logic |
What type of PR is this?
/kind cleanupWhat this PR does / why we need it:
Related: #6621
Adds CQ weight to determine winner for fairsharing tournament if drs values are the same.
TLDR; for a workload that we're seeing cycling it probably has the same drs value as its preemptor. The cycling workload is also able to consistently preempt a workload that never shows up in a tournament (ie is never an admission candidate).
Here's a preemption cycle we're encountering...
Lets call the preemption cycling workload
w-cycle
workload that preempts
w-cycle
isw-preemptor
workload that
w-cycle
preempts isw-target
. -> w-target has a very low weight CQ. It never shows up as an admission candidate in any tournament.Here's the cyclical preemption we're getting:
w-cycle
preemptsw-target
w-cycle
admittedw-target
preemptedw-preemptor
preemptsw-cycle
-> both have drs values 1w-cycle
preemptedw-preemptor
andw-target
admittedWhich issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?