You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kueue.x-k8s.io/pod-index-offset carries a documented contract. From site/data/labels_and_annotations.yaml:
This annotation is set by the Kueue webhook and used by the TAS topology ungater to correctly map Pod indexes to topology assignments.
note: This annotation is not added when kueue.x-k8s.io/podset-group-name is specified, as offset management is delegated to the PodSet Group mechanism in that case.
Nothing enforces either half of that on MPIJob.
The webhook only writes it, and only on CREATE. The mutating webhook is registered verbs=create (pkg/controller/jobs/mpijob/mpijob_webhook.go), while the validating webhook takes verbs=create;update. validateTopologyRequest never looks at the annotation, so no path checks the value or the conditions under which it may appear.
The ungater adds it to whatever the group already computed. In pkg/controller/tas/topology_ungater.go, rankOffsets[psa.Name] is filled from the PodSet group layout, and the annotation is then applied on top:
Three shapes follow. The first two are admission-reachable and I checked them against the webhook directly; a podset-group-name needs a topology annotation beside it to pass validation, which a real TAS job carries anyway.
A grouped MPIJob with pod-index-offset: "invalid" is accepted. The defaulting returns without touching it because the job is grouped, and validation does not look at it. The ungater then fails to parse it on every reconcile and the Pods stay gated until someone edits the object.
A grouped MPIJob whose Worker carries a numeric offset is accepted, and the ungater applies both the group-derived offset and the annotation.
Passing this through MpiJobWebhook.ValidateCreate with TopologyAwareScheduling enabled returns no error. Replacing invalid with "5" on the Worker is likewise accepted.
Anything else we need to know?:
The same annotation is written by the LeaderWorkerSet webhook (pkg/controller/jobs/leaderworkerset/leaderworkerset_webhook.go), and LWS has its own history with rank ordering in #8661. Whatever shape the enforcement takes is probably worth deciding for both rather than as an MPIJob-local check.
Not blocking #14421, which fixes a different defect in the same branch: that one decided on the size of mpiReplicaSpecs and dereferenced an absent Launcher. This is about the annotation's contract once the branch has run, or once someone edits the object afterwards.
Environment:
Kueue version (use git describe --tags --dirty --always): observed on main
What happened:
kueue.x-k8s.io/pod-index-offsetcarries a documented contract. Fromsite/data/labels_and_annotations.yaml:Nothing enforces either half of that on MPIJob.
The webhook only writes it, and only on CREATE. The mutating webhook is registered
verbs=create(pkg/controller/jobs/mpijob/mpijob_webhook.go), while the validating webhook takesverbs=create;update.validateTopologyRequestnever looks at the annotation, so no path checks the value or the conditions under which it may appear.The ungater adds it to whatever the group already computed. In
pkg/controller/tas/topology_ungater.go,rankOffsets[psa.Name]is filled from the PodSet group layout, and the annotation is then applied on top:A non-integer value is a hard stop rather than a fallback, which #8677 made deliberate:
Three shapes follow. The first two are admission-reachable and I checked them against the webhook directly; a
podset-group-nameneeds a topology annotation beside it to pass validation, which a real TAS job carries anyway.pod-index-offset: "invalid"is accepted. The defaulting returns without touching it because the job is grouped, and validation does not look at it. The ungater then fails to parse it on every reconcile and the Pods stay gated until someone edits the object."1"it wrote on CREATE can be removed or changed afterwards. Validation does not object, and Worker Pods created after that are read as starting at index 0 again, which is the rank-ordering failure TAS: TopologyUngater can not recognize rank-based ordering for MPIJob with runLauncherAsWorker #8471 describes and TAS: Fix a bug that MPIJob with runLauncherAsWorker Pod indexes are not correctly evaluated. #8618 added the offset for.What you expected to happen:
runLauncherAsWorker: trueand both replica specs present carriespod-index-offset: "1"on the Worker.podset-group-nameis set, as the note says.How to reproduce it (as minimally and precisely as possible):
Passing this through
MpiJobWebhook.ValidateCreatewithTopologyAwareSchedulingenabled returns no error. Replacinginvalidwith"5"on the Worker is likewise accepted.Anything else we need to know?:
The same annotation is written by the LeaderWorkerSet webhook (
pkg/controller/jobs/leaderworkerset/leaderworkerset_webhook.go), and LWS has its own history with rank ordering in #8661. Whatever shape the enforcement takes is probably worth deciding for both rather than as an MPIJob-local check.Not blocking #14421, which fixes a different defect in the same branch: that one decided on the size of
mpiReplicaSpecsand dereferenced an absent Launcher. This is about the annotation's contract once the branch has run, or once someone edits the object afterwards.Environment:
git describe --tags --dirty --always): observed onmain