Skip to content

[slice] Skip TPU warden check for LWS - #1173

Merged
gabesaba merged 2 commits into
AI-Hypercomputer:slice-mainfrom
pajakd:skip_warden_lws
Apr 10, 2026
Merged

gabesaba merged 2 commits into
AI-Hypercomputer:slice-mainfrom
pajakd:skip_warden_lws

Conversation

@pajakd

@pajakd pajakd commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator

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

@gabesaba gabesaba left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

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()
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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(...)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

(the last function name is just to capture functionality, there can probably be a much better name for it :) )

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Refactored. Actually annotateWorkerTemplate and annotateLeaderTemplate could be captured with a single function. PTAL

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nice!

@gabesaba

Copy link
Copy Markdown
Collaborator

lgtm

@gabesaba
gabesaba merged commit 855a198 into AI-Hypercomputer:slice-main Apr 10, 2026
16 of 18 checks passed
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