[Clustered] Option to wait out a Kueue eviction instead of ending the attempt
Since #8136, a JobSet that Kueue suspends after it started fails the attempt: the JobSet is deleted, Preempted and DeactivatedDueToMaximumExecutionTimeExceeded use one of the task's retries, and every other reason is a system retry.
Kueue's own model is to suspend the workload, requeue it and resume the same JobSet once it is readmitted. For long multi-node training on a shared cluster, preemption by higher-priority work is routine and expected, not a failure of the task. Today a task needs retries sized to the number of preemptions it might see, and once those are spent, an ordinary preemption fails it. Depending on the cluster load, a low priority task could be preempted many times.
Proposal: a plugin setting (e.g. plugins.clustered.kueue.onEviction: retry | requeue, default retry to keep today's behaviour). With requeue, a suspended-after-start JobSet is left in place and reported as waiting for re-admission, carrying Kueue's eviction reason. It ends the attempt only on reasons that waiting won't resolve, i.e. the Deactivated* family, which includes Kueue's own requeue limit for PodsReady timeouts.
Open questions where we'd like your view:
- Phase. Phases can't move backwards within an attempt, so the task would stay at Running with a reason like "evicted by kueue (Preempted); waiting for re-admission". Is that acceptable? It matches the Flyte 1 behavior during preemption of PytorchJob.
max_runtimekeeps counting while the gang waits. Is that fine for an opt-in limit, or should waiting time be excluded?- Should
DeactivatedDueToMaximumExecutionTimeExceededkeep ending the attempt underrequeue? We think yes.
We're happy to implement this once the direction is agreed.
Context: we run multi-node pre-training with Kueue preemption on Flyte 1 PyTorchJobs, where #6295 and #7241 give this behaviour today, and are considering moving to clustered tasks on v2.
It seems likely that Flyte currently treats Kueue-evicted JobSets as failures, consuming a retry or triggering a system retry, and does not natively support waiting out a Kueue eviction within the same attempt. The current behavior is that preemptions (e.g., Kueue suspending a JobSet after start) use up the task's retry budget, which can be problematic for long-running, low-priority jobs that expect frequent preemptions. There is no mention in the data sources of a plugin setting like plugins.clustered.kueue.onEviction to control this behavior, nor of an option to keep the JobSet in place and wait for re-admission while reporting the phase as "Running" with an eviction reason. The proposal you describe is not present in the referenced documentation or code.
If you would like more detail on how Flyte currently handles Kueue preemptions, phase transitions, or timeouts in clustered tasks, or want to discuss possible workarounds, please let me know.
Sources:
This is an AI-generated response and your feedback is appreciated! Please leave a 👍 if this is helpful and 👎 if it is not.
Mention @herald to ask follow-up questions. See runllm.com for more!