Repository navigation
[slice] Skip TPU warden check for LWS - #1173
Merged
Merged
Conversation
gabesaba
reviewed
Apr 10, 2026
Comment on lines
81
to
93
| lws.Spec.LeaderWorkerTemplate.WorkerTemplate.Annotations[core.TPUSkipWardenAnnotation] = "true" | ||
| if lws.Spec.LeaderWorkerTemplate.LeaderTemplate != nil { | ||
| if lws.Spec.LeaderWorkerTemplate.LeaderTemplate.Annotations == nil { | ||
| lws.Spec.LeaderWorkerTemplate.LeaderTemplate.Annotations = make(map[string]string) | ||
| } | ||
| // if the leader is defined, annotate both templates with the same group name | ||
| lws.Spec.LeaderWorkerTemplate.WorkerTemplate.Annotations[podsetGroupName] = podsetGroupValue | ||
| lws.Spec.LeaderWorkerTemplate.LeaderTemplate.Annotations[podsetGroupName] = podsetGroupValue | ||
| lws.Spec.LeaderWorkerTemplate.LeaderTemplate.Annotations[core.TPUSkipWardenAnnotation] = "true" | ||
|
|
||
| annotatePodTemplateSpecWithSliceHealth(lws.Spec.LeaderWorkerTemplate.LeaderTemplate, parsed, r.DefaultSliceHealthValues) | ||
| if lws.Spec.LeaderWorkerTemplate.LeaderTemplate.Annotations == nil { | ||
| lws.Spec.LeaderWorkerTemplate.LeaderTemplate.Annotations = make(map[string]string) | ||
| } | ||
| lws.Spec.LeaderWorkerTemplate.LeaderTemplate.Annotations[kueue.PodSetRequiredTopologyAnnotation] = parsed.RequiredSliceLevel() | ||
| } |
Collaborator
There was a problem hiding this comment.
I'm happy to leave this as a follow-up, but what do you think about breaking code into functions, perhaps the following?
annotateWorkerTemplate(...)
annotateLeaderTemplate(...)
conditionallySetGroupName(...)
Collaborator
There was a problem hiding this comment.
(the last function name is just to capture functionality, there can probably be a much better name for it :) )
Collaborator
Author
There was a problem hiding this comment.
Refactored. Actually annotateWorkerTemplate and annotateLeaderTemplate could be captured with a single function. PTAL
Collaborator
|
lgtm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In LWS there is no suspend so (gated) pods are created immediately, before Kueue admits the workload so before the slice is created.
If these pods don’t have the cloud.google.com/gke-tpu-topology node selector, they get rejected by the GKE warden and if they do have, they cannot get scheduled (because since the slice is not there yet, the nodes don’t have the topology labels).
This PR adds an Annotation to skip the GKE warden TPU webhook check to allow these pods to be created.
Issue
Testing