diff --git a/pkg/controller.v1/pytorch/pod.go b/pkg/controller.v1/pytorch/pod.go index 1d2edc4d4..33a10e94a 100644 --- a/pkg/controller.v1/pytorch/pod.go +++ b/pkg/controller.v1/pytorch/pod.go @@ -222,6 +222,12 @@ func (pc *PyTorchController) createNewPod(job *pyv1.PyTorchJob, rtype pyv1.PyTor } else { podTemplate.Spec.SchedulerName = gangSchedulerName } + + if podTemplate.Annotations == nil { + podTemplate.Annotations = map[string]string{} + } + // we create the podGroup with the same name as the pyTorch job + podTemplate.Annotations["scheduling.k8s.io/group-name"] = job.Name } err = pc.PodControl.CreatePodsWithControllerRef(job.Namespace, podTemplate, job, controllerRef)