Gang scheduling Unreleased: coming in v1.3

With the scheduler-plugins PodGroup CRD installed, OME creates a PodGroup for each multi-pod OMENative Instance, so a gang-aware scheduler places its leader and workers together or not at all.

Gang scheduling places all the pods of a multi-pod Instance together, or none of them. An OMENative Instance with a leader and workers serves only when all its pods run, and gang scheduling stops some of them from holding GPUs while the rest wait.

When the scheduler-plugins PodGroup CRD is installed, OME creates a PodGroup for each multi-pod Instance of an OMENative engine or decoder, and none for RawDeployment or MultiNode (deprecated) components. A gang-aware scheduler reads the PodGroups: the alpha OME scheduler or the scheduler-plugins Coscheduling plugin. The default Kubernetes scheduler ignores them and places pods one at a time.

Install the PodGroup CRD

No OME chart installs the PodGroup CRD. Install it from scheduler-plugins v0.34.7, the release OME is built against. If you run the OME scheduler, install the CRD version from Use the OME scheduler instead. Then restart the controller, which looks for the CRD only when it starts. This example assumes OME runs in the ome namespace:

Shell
kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/scheduler-plugins/v0.34.7/config/crd/bases/scheduling.x-k8s.io_podgroups.yaml
kubectl rollout restart deployment ome-controller-manager -n ome
Output
customresourcedefinition.apiextensions.k8s.io/podgroups.scheduling.x-k8s.io created
deployment.apps/ome-controller-manager restarted

Bring a gang-aware scheduler

A PodGroup holds a gang together only when the scheduler that places the pods reads it. The pods use the scheduler that the runtime or the InferenceService names, and the default scheduler otherwise. The default scheduler can bind part of an Instance while the rest waits, and the bound pods hold their GPUs with nothing serving. Use one of these:

Scheduler What it does schedulerName
OME scheduler Places each gang in one topology domain, all or nothing. Alpha, and needs Kubernetes 1.35. ome-scheduler
scheduler-plugins Coscheduling Places each gang all or nothing, in your default scheduler or as a second scheduler. Unset in your default scheduler, or scheduler-plugins-scheduler from the scheduler-plugins Helm chart

The OME scheduler also needs a topology key: the component's topologyKey, or its chart's scheduler.plugin.topologyKey for every gang. Without either, the gang's pods stay Pending. Use the OME scheduler installs the scheduler and sets the key.

Set spec.schedulerName in the runtime to use one scheduler for all its components:

YAML
spec:
  schedulerName: ome-scheduler

A schedulerName in an InferenceService component, or in a runtime component config such as engineConfig, overrides it for that component's leader and workers:

YAML
spec:
  engine:
    schedulerName: ome-scheduler

When the pods of a component with PodGroups use the default scheduler, OME records a MaybeNoGangScheduler Warning event on the InferenceService. If you added Coscheduling to your default scheduler, ignore it.

One PodGroup per multi-pod Instance

OME creates an Instance's PodGroup before its pods, and names it <isvc>-<component>-<index>. Its minMember is the Instance's pod count: the leader plus worker.size workers. Its scheduleTimeoutSeconds comes from the gang schedule timeout. When the component sets topologyKey, the PodGroup carries it in the ome.io/topology-key annotation. Once the Instance has pods, the annotation follows them, not the spec. OME labels the Instance's pods with scheduling.x-k8s.io/pod-group, set to the PodGroup's name, which gang-aware schedulers read.

For example, the InferenceService in Serve a multi-node model runs one engine Instance of a leader and one worker, so OME creates the PodGroup qwen3-multi-node-engine-0. Without its owner reference and status, it looks like this:

YAML
apiVersion: scheduling.x-k8s.io/v1alpha1
kind: PodGroup
metadata:
  name: qwen3-multi-node-engine-0
  namespace: qwen3-multi-node
  labels:
    component: engine
    ome.io/inferenceservice: qwen3-multi-node
    ome.io/instance-index: "0"
    ome.io/managed-by: OMENative
spec:
  minMember: 2
  scheduleTimeoutSeconds: 600

List the InferenceService's PodGroups:

Shell
kubectl get podgroups -n qwen3-multi-node -l ome.io/inferenceservice=qwen3-multi-node \
  -o custom-columns=NAME:.metadata.name,MIN-MEMBER:.spec.minMember,TIMEOUT:.spec.scheduleTimeoutSeconds
Output
NAME                        MIN-MEMBER   TIMEOUT
qwen3-multi-node-engine-0   2            600

List the Instance's pods by their PodGroup label:

Shell
kubectl get pods -n qwen3-multi-node -l scheduling.x-k8s.io/pod-group=qwen3-multi-node-engine-0 -o name
Output
pod/qwen3-multi-node-engine-0-leader-0
pod/qwen3-multi-node-engine-0-worker-0

The topology annotation follows the Instance's pods

While an Instance's pods exist, its PodGroup's ome.io/topology-key annotation describes those pods, not the newest spec. A pod's affinity is immutable: each worker carries a required affinity that keeps it in its leader's domain under the key the pods were created with. The annotation is the gang's contract with the scheduler, and the OME scheduler releases a gang's domain to pick again when it changes, which its metrics count as a topology_replan. Retargeting a live gang's annotation would have the scheduler place replacement pods by the new key while the gang's other pods stay pinned to the old one: a split gang.

So a topologyKey edit never retargets a live gang. OME records a new revision, and the new key lands as the rollout replaces each Instance's pods:

  • Under SurgeThenDrain, the default, the replacement gang is a new Instance with its own PodGroup, which carries the new key from creation. The old Instance's PodGroup keeps the old key until the Instance drains, and is deleted with it.
  • Under a strategy that recreates the pods, the Instance's PodGroup advances to the new key once its pods are gone, before OME creates the replacements.
  • A repair stays put: OME refills a lost pod of a live gang with the key the gang runs, so the new pod can land with its peers.

OME proves a live gang's key from the worker-to-leader affinity it generated on the gang's pods, and otherwise keeps the annotation the PodGroup already carries. Affinity you wrote yourself never sets the annotation, since it can express an unrelated relationship. When the component sets topologyKey but neither source proves the key of a gang that still has pods, say because the annotation was removed by hand while only the leader runs, OME fails the component's reconcile rather than guess, with an error in the controller's log that says cannot prove active topology. It reconciles again when the annotation is restored, or the gang's pods are gone.

A gang without a co-location rule warns GangSplitRisk

A gang-aware scheduler places a gang all or nothing, but all-or-nothing alone doesn't keep its pods in one topology domain. The gang stays together only when something pins it:

  • The component's topologyKey. OME injects a required podAffinity into each worker that keeps it in its leader's domain under that key.
  • A required worker podAffinity you wrote yourself. OME checks only that a required term exists, not what it pins.
  • A provisioned TPU slice: the node selector OME gives each pod confines it to the Slice's nodes.

When OME creates a worker pod of a multi-pod Instance with none of these — no required podAffinity at all — it records a GangSplitRisk Warning event on the InferenceService, with or without the PodGroup CRD. Read the event's message:

Shell
kubectl get events -n qwen3-multi-node --field-selector reason=GangSplitRisk \
  -o jsonpath='{range .items[*]}{.message}{"\n"}{end}'
Output
OMENative component=engine is a multi-node gang but its worker pods have no co-location podAffinity: the gang may be scheduled across separate network/NVLink/TPU topology domains, breaking the tightly-coupled collectives a multi-node runtime needs (NCCL/RCCL/NIXL all-reduce, multi-host TPU sessions). Set engine.topologyKey to the node label that identifies the required topology domain, or declare a worker podAffinity.

The warning is advisory — it never blocks the create — and the gang isn't necessarily split: the pods can still land in one domain when it has room, but nothing holds them there. To clear it, do what the message says: set the component's topologyKey to the node label that identifies the required topology domain, such as nvidia.com/gpu.clique, or declare a required worker podAffinity. On a live gang, a topologyKey edit lands as the rollout replaces the Instance's pods, because a pod's affinity is immutable.

GangSplitRisk is a standing warning about the Instance as built: OME announces it once per incarnation, not once per reconcile or per worker, and records a marker on the Instance's row, which kubectl ome instance status shows under announced as GangSplitRisk@#1. A restart, or an update that recreates the pods, starts the next incarnation, so an Instance whose workers are still unconstrained warns again — and a marker can outlive its incarnation, so an old one doesn't mean the warning still applies.

Bound the gang schedule timeout

A gang-aware scheduler holds a gang's placed pods until the whole gang fits, for up to the PodGroup's scheduleTimeoutSeconds. At the timeout, it frees their resources for other pods and tries the gang again later.

OME sets scheduleTimeoutSeconds to the component's ready timeout, instanceReadyTimeout, clamped between the min and max of the controller's gangScheduleTimeout setting. The ome-resources chart sets both:

YAML
ome:
  controller:
    lifecycle:
      instanceReadyTimeout: 30m
      gangScheduleTimeout:
        min: 60s
        max: 600s

With these values, the 30-minute ready timeout becomes 600 seconds, as in the PodGroup above.

Ready timeout gangScheduleTimeout scheduleTimeoutSeconds
Between min and max Set The ready timeout
Above max Set max
Below min, or unset Set min
Set Unset The ready timeout: 1800 in the kustomize install
Unset Unset Unset: the scheduler's default applies

The scheduler's default is defaultPermitTimeoutSeconds for the OME scheduler, 600 in its chart, or permitWaitingTimeSeconds for Coscheduling. gangScheduleTimeout needs both min and max, positive, with min no larger than max. OME treats an invalid one as unset.

Change the cluster defaults shows how to change these settings. OME updates existing PodGroups to the new timeout in place, unlike the topology annotation, which a live gang's pods hold.

A gang pod left Pending is re-queued

The controller's lifecycle.schedulingRetry setting bounds how OME asks the scheduler again for a pod of a multi-pod Instance that stays Pending with no node while its attempt — its operation — is open. Once the pod has waited after for a node, OME patches a small record onto it: the internal.ome.io/scheduling-retry annotation, whose value, such as {"count":1}, counts the writes. The patch changes nothing the scheduler reads as a placement input. That's the point: the write puts a pod the scheduler's queue has lost track of back into its active queue, and leaves a pod the queue still holds where it is, so a write to a pod the scheduler is already working on costs nothing.

The ome-resources chart sets the retry by default:

YAML
ome:
  controller:
    lifecycle:
      schedulingRetry:
        after: 5m
        maxAttempts: 2

Three rules bound the writes:

  • The wait runs from the scheduler's last word. The clock starts at the pod's creation, or at the scheduler's last PodScheduled ruling when that's later, so a pod the scheduler just ruled on gets the whole wait again from the ruling.
  • Each write waits longer. The k-th write comes once the pod has waited k times after: with the chart's values, the first after 5 minutes of waiting, the second after 10.
  • maxAttempts caps the writes per pod. The count is the annotation's, so a pod OME rebuilds starts over. Past the cap, the pod waits on the scheduler's own queue and the attempt's limits.

The write ends nothing: the attempt keeps its deadline, and a pod the scheduler has refused keeps its Unschedulable hold, so the readiness deadlines still bound the wait. OME writes only a pod still waiting for the scheduler — Pending, with no node, not held by a scheduling gate and not terminating — of a multi-pod Instance, a surge replacement gang included. It leaves a single-pod Instance, a teardown and a paused attempt alone, and writes nothing in the pass where unschedulableGracePeriod, or a full domain's shorter window, ends the attempt.

Each write records a SchedulingRequestedAgain event on the InferenceService that names the pod, how long it waited and which write of the cap this was:

Shell
kubectl get events -n qwen3-multi-node --field-selector reason=SchedulingRequestedAgain \
  -o jsonpath='{range .items[*]}{.message}{"\n"}{end}'
Output
OMENative component=engine instance=0 pod qwen3-multi-node-engine-0-worker-0 has waited 5m12s for a node; the pod was written so the scheduler looks at it again (1 of 2)

Both fields are required when the block is present, each above zero, and OME treats the block as unset otherwise. The binary has no built-in values: remove the block, as Change the cluster defaults describes, and no pod is ever written — such a pod is left to the scheduler's own queue and the attempt's deadline.

A gang held to a full domain can fail sooner

Placed members pin their gang. When some of an Instance's pods run in one topology domain and the scheduler reports that the domain can't take the rest — for example, one of its nodes stopped reporting — freeing capacity in another domain doesn't help: each worker's affinity keeps it in its leader's domain. Only removing the placed members frees the gang. Ending the attempt does exactly that, and the rebuilt gang can land in a domain that fits.

By default, such a member still waits out the controller's unschedulableGracePeriod, 15 minutes with the chart, like any other unschedulable pod. The lifecycle.gangDomainFullGracePeriod cluster setting, which the chart leaves unset, ends the attempt sooner. Set it with the other readiness deadlines, with a unit — OME treats a value it can't parse, or one that isn't above zero, as unset:

YAML
ome:
  controller:
    lifecycle:
      unschedulableGracePeriod: 15m
      gangDomainFullGracePeriod: 5m

Three rules bound the shorter window:

  • Only the scheduler's own reports trigger it. OME matches the message against the OME scheduler's reports that placed members hold the gang where it can't complete: the pinned domain and adopted domain scheduling events, and the split-gang report already has members in multiple topology domains. The phrases are fixed in OME's code, the same on every cluster. Another scheduler's messages don't match them, so under Coscheduling such a hold waits on unschedulableGracePeriod.
  • Terminating pods push it out. While any pod of the attempt is still terminating, only unschedulableGracePeriod applies: a member on its way out may be what fills the domain, and its room frees as it goes.
  • The clock doesn't start over. Both windows run from the same start: the attempt's placement wait, when it began before the unplaceable pod's own PodScheduled transition. A member OME rebuilds after a node loss keeps the attempt's clock, so its first refusal can end the attempt.

When both settings are set, the shorter applies, and gangDomainFullGracePeriod also works with unschedulableGracePeriod unset. Past the window, OME fails the Instance as the cluster's problem, never the revision's: the failure reason is Unschedulable, with the scheduler's message. When a limit runs out says what OME does next for each operation.

What you see

What you see What it means
The component's GangSchedulingUnavailable condition is True, with the reason PodGroupCRDNotInstalled The CRD is missing, or was when the controller started. The default scheduler may place part of an Instance, and the OME scheduler keeps its pods Pending. Install the CRD.
A SchedulingRequestedAgain event on the InferenceService A pod of a multi-pod Instance waited past lifecycle.schedulingRetry.after for a node, so OME wrote it so the scheduler looks at it again. Nothing failed, and the attempt keeps running.
An InstanceFailed Warning event with the scheduler's message A pod stayed unschedulable longer than the controller's unschedulableGracePeriod, 15 minutes with the chart — or longer than gangDomainFullGracePeriod, when the gang was held to a full domain.
An InstanceFailed Warning event that names PodGroupOwnershipConflict Another owner controls a PodGroup with the Instance's PodGroup name. OME fails the Instance and creates none of its pods.
A PodGroupReset Warning event on the InferenceService A pod of a running gang failed, so the scheduler-plugins controller marked the PodGroup Failed. OME replaced it without failing the Instance. The Instance's restart policy decides what happens next.
A GangSplitRisk Warning event on the InferenceService A multi-pod Instance's worker pods carry no required podAffinity, so nothing keeps the gang in one topology domain. The create went ahead: set the component's topologyKey, or declare a worker affinity.

The condition is on the component's InferenceReplica, and in the InferenceService's status.components.<component>.lifecycle.conditions. When it's False, its reason is GangSchedulingAvailable. Read its reason for the engine, here without the CRD:

Shell
kubectl get inferenceservice qwen3-multi-node -n qwen3-multi-node \
  -o jsonpath='{.status.components.engine.lifecycle.conditions[?(@.type=="GangSchedulingUnavailable")].reason}'
Output
PodGroupCRDNotInstalled

Next steps