v1alpha1

package
v2.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2026 License: Apache-2.0 Imports: 12 Imported by: 5

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the trainer.kubeflow.org v1alpha1 API group +kubebuilder:object:generate=true +groupName=trainer.kubeflow.org

Index

Constants

View Source
const (
	// TrainingRuntimeKind is the Kind name for the TrainingRuntime.
	TrainingRuntimeKind string = "TrainingRuntime"
	// ClusterTrainingRuntimeKind is the Kind name for the ClusterTrainingRuntime.
	ClusterTrainingRuntimeKind string = "ClusterTrainingRuntime"
)
View Source
const (
	// TrainJobSuspended means that TrainJob is suspended.
	TrainJobSuspended string = "Suspended"

	// TrainJobComplete means that the TrainJob has completed its execution.
	TrainJobComplete string = "Complete"

	// TrainJobFailed means that the actual jobs have failed its execution.
	TrainJobFailed string = "Failed"
)
View Source
const (
	// TrainJobSuspendedReason is the "Suspended" condition reason
	// when the TrainJob is suspended.
	TrainJobSuspendedReason string = "Suspended"

	// TrainJobResumedReason is the "Suspended" condition reason
	// when the TrainJob suspension is changed from True to False.
	TrainJobResumedReason string = "Resumed"

	// TrainJobRuntimeNotSupportedReason is the "Failed" condition reason
	// when the referenced TrainingRuntime is not supported.
	TrainJobRuntimeNotSupportedReason string = "TrainingRuntimeNotSupported"

	// TrainJobDeadlineExceededReason is the "Failed" condition reason
	// when the TrainJob exceeds its ActiveDeadlineSeconds.
	// Matches the Kubernetes Job behavior.
	TrainJobDeadlineExceededReason string = "DeadlineExceeded"
)
View Source
const (
	// TrainJobKind is the Kind name for the TrainJob.
	TrainJobKind string = "TrainJob"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "trainer.kubeflow.org", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)

	// SchemeGroupVersion is alias to GroupVersion for client-go libraries.
	SchemeGroupVersion = GroupVersion

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func RegisterDefaults

func RegisterDefaults(scheme *runtime.Scheme) error

RegisterDefaults adds defaulters functions to the given scheme. Public to allow building arbitrary schemes. All generated defaulters are covering - they call all nested defaulters.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group-qualified GroupResource.

func SetObjectDefaults_ClusterTrainingRuntime

func SetObjectDefaults_ClusterTrainingRuntime(in *ClusterTrainingRuntime)

func SetObjectDefaults_ClusterTrainingRuntimeList

func SetObjectDefaults_ClusterTrainingRuntimeList(in *ClusterTrainingRuntimeList)

func SetObjectDefaults_TrainJob

func SetObjectDefaults_TrainJob(in *TrainJob)

func SetObjectDefaults_TrainJobList

func SetObjectDefaults_TrainJobList(in *TrainJobList)

func SetObjectDefaults_TrainingRuntime

func SetObjectDefaults_TrainingRuntime(in *TrainingRuntime)

func SetObjectDefaults_TrainingRuntimeList

func SetObjectDefaults_TrainingRuntimeList(in *TrainingRuntimeList)

Types

type ClusterTrainingRuntime

type ClusterTrainingRuntime struct {
	metav1.TypeMeta `json:",inline"`

	// metadata of the ClusterTrainingRuntime.
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// spec of the ClusterTrainingRuntime.
	// +optional
	Spec TrainingRuntimeSpec `json:"spec,omitzero"`
}

ClusterTrainingRuntime represents a training runtime which can be referenced as part of `runtimeRef` API in TrainJob. This resource is a cluster-scoped and can be referenced by TrainJob that created in *any* namespace.

func (*ClusterTrainingRuntime) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTrainingRuntime.

func (*ClusterTrainingRuntime) DeepCopyInto

func (in *ClusterTrainingRuntime) DeepCopyInto(out *ClusterTrainingRuntime)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterTrainingRuntime) DeepCopyObject

func (in *ClusterTrainingRuntime) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClusterTrainingRuntimeList

type ClusterTrainingRuntimeList struct {
	metav1.TypeMeta `json:",inline"`

	// Standard list metadata.
	metav1.ListMeta `json:"metadata,omitempty"`

	// List of ClusterTrainingRuntimes.
	Items []ClusterTrainingRuntime `json:"items"`
}

ClusterTrainingRuntimeList is a collection of cluster training runtimes.

func (*ClusterTrainingRuntimeList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTrainingRuntimeList.

func (*ClusterTrainingRuntimeList) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ClusterTrainingRuntimeList) DeepCopyObject

func (in *ClusterTrainingRuntimeList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ContainerPatch added in v2.2.0

type ContainerPatch struct {
	// name for the container. Runtime must have this container.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	// +required
	Name string `json:"name,omitempty"`

	// env is the list of environment variables to set in the container.
	// These values will be merged with the Runtime's environments.
	// These values can't be set for container with the name: `node`, `dataset-initializer`, or
	// `model-initializer`. For those containers the envs can only be set via Trainer or Initializer APIs.
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=128
	// +optional
	Env []corev1.EnvVar `json:"env,omitempty"`

	// volumeMounts are the volumes to mount into the container's filesystem.
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=128
	// +optional
	VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`

	// securityContext patches the container's security context.
	// More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
	// +optional
	SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty"`
}

ContainerPatch represents parameters that can be patched using PodSpecPatch.

func (*ContainerPatch) DeepCopy added in v2.2.0

func (in *ContainerPatch) DeepCopy() *ContainerPatch

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerPatch.

func (*ContainerPatch) DeepCopyInto added in v2.2.0

func (in *ContainerPatch) DeepCopyInto(out *ContainerPatch)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CoschedulingPodGroupPolicySource

type CoschedulingPodGroupPolicySource struct {
	// scheduleTimeoutSeconds is the maximum duration to schedule PodGroup for gang-scheduling.
	// If the scheduling timeout is equal to 0, the default value is used.
	// Defaults to 60 seconds.
	// +kubebuilder:default=60
	// +optional
	ScheduleTimeoutSeconds *int32 `json:"scheduleTimeoutSeconds,omitempty"`
}

CoschedulingPodGroupPolicySource represents configuration for coscheduling plugin. The number of min members in the PodGroupSpec is always equal to the number of nodes.

func (*CoschedulingPodGroupPolicySource) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CoschedulingPodGroupPolicySource.

func (*CoschedulingPodGroupPolicySource) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DatasetInitializer

type DatasetInitializer struct {
	// storageUri is the URI for the dataset provider.
	// If set, it may be empty, or it must be a valid URI format
	// (e.g., s3://bucket/path, gs://bucket/path).
	// +kubebuilder:validation:XValidation:rule="self == ” || self.matches('^[A-Za-z][A-Za-z0-9+.-]*://.+$')",message="storageUri may be empty, or it must be a valid URI (scheme://...)"
	// +kubebuilder:validation:MaxLength=2048
	// +optional
	StorageUri *string `json:"storageUri,omitempty"`

	// env is the list of environment variables to set in the dataset initializer container.
	// These values will be merged with the TrainingRuntime's dataset initializer environments.
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=128
	// +optional
	Env []corev1.EnvVar `json:"env,omitempty"`

	// secretRef is the reference to the secret with credentials to download dataset.
	// Secret must be created in the TrainJob's namespace.
	// +optional
	SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"`
}

DatasetInitializer represents the desired configuration to initialize and pre-process dataset. The DatasetInitializer spec will override the runtime Job template which contains this label: `trainer.kubeflow.org/trainjob-ancestor-step: dataset-initializer`

func (*DatasetInitializer) DeepCopy

func (in *DatasetInitializer) DeepCopy() *DatasetInitializer

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatasetInitializer.

func (*DatasetInitializer) DeepCopyInto

func (in *DatasetInitializer) DeepCopyInto(out *DatasetInitializer)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EnvInjection added in v2.3.0

type EnvInjection struct {
	// targets defines which replicated job containers receive PET_* env injection.
	// The item limit keeps runtime validation bounded while allowing common
	// multi-job runtimes to target their auxiliary containers.
	// +listType=map
	// +listMapKey=jobName
	// +kubebuilder:validation:MaxItems=16
	// +optional
	Targets []EnvInjectionTarget `json:"targets,omitempty"`
}

EnvInjection specifies which containers in which jobs receive framework env injection. Defined as a standalone type so it can be embedded by other MLPolicySource variants in the future.

func (*EnvInjection) DeepCopy added in v2.3.0

func (in *EnvInjection) DeepCopy() *EnvInjection

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvInjection.

func (*EnvInjection) DeepCopyInto added in v2.3.0

func (in *EnvInjection) DeepCopyInto(out *EnvInjection)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EnvInjectionTarget added in v2.3.0

type EnvInjectionTarget struct {
	// jobName is the name of the target replicated job (e.g. "node").
	// Using "jobName" rather than "replicatedJobName" keeps the API
	// future-proof for other CRD types (LWS, Grove, Slurm, etc.).
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	// +required
	JobName string `json:"jobName,omitempty"`

	// containerNames lists the container names within the target job
	// that should receive PET_* envs.
	// The item limit keeps admission checks small while covering typical
	// preflight and sidecar use cases.
	// +listType=set
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:MaxItems=8
	// +kubebuilder:validation:items:MaxLength=63
	// +kubebuilder:validation:XValidation:rule="!self.exists(c, c == 'node')", message="containerNames must not include the main node container because PET_* envs are always injected into it"
	// +required
	ContainerNames []string `json:"containerNames,omitempty"`
}

EnvInjectionTarget specifies a replicated job and the containers within it that should receive PET_* env injection.

func (*EnvInjectionTarget) DeepCopy added in v2.3.0

func (in *EnvInjectionTarget) DeepCopy() *EnvInjectionTarget

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvInjectionTarget.

func (*EnvInjectionTarget) DeepCopyInto added in v2.3.0

func (in *EnvInjectionTarget) DeepCopyInto(out *EnvInjectionTarget)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FluxMLPolicySource added in v2.2.0

type FluxMLPolicySource struct {
	// numProcPerNode is the number of processes per node.
	// +kubebuilder:default=1
	// +kubebuilder:validation:XValidation:rule="self >= 1",message="NumProcPerNode in fluxPolicy must be >= 1"
	// +optional
	NumProcPerNode *int32 `json:"numProcPerNode,omitempty"`
}

FluxMLPolicySource represents a Flux HPC runtime configuration.

func (*FluxMLPolicySource) DeepCopy added in v2.2.0

func (in *FluxMLPolicySource) DeepCopy() *FluxMLPolicySource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FluxMLPolicySource.

func (*FluxMLPolicySource) DeepCopyInto added in v2.2.0

func (in *FluxMLPolicySource) DeepCopyInto(out *FluxMLPolicySource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Initializer

type Initializer struct {
	// dataset defines the configuration for the dataset initialization and pre-processing.
	// +optional
	Dataset *DatasetInitializer `json:"dataset,omitempty"`

	// model defines the configuration for the pre-trained model initialization
	// +optional
	Model *ModelInitializer `json:"model,omitempty"`
}

Initializer represents the desired configuration for the dataset and model initialization. It is used to initialize the assets (dataset and pre-trained model) and pre-process data.

func (*Initializer) DeepCopy

func (in *Initializer) DeepCopy() *Initializer

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Initializer.

func (*Initializer) DeepCopyInto

func (in *Initializer) DeepCopyInto(out *Initializer)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JAXMLPolicySource added in v2.2.0

type JAXMLPolicySource struct{}

JAXMLPolicySource represents a jax runtime configuration.

func (*JAXMLPolicySource) DeepCopy added in v2.2.0

func (in *JAXMLPolicySource) DeepCopy() *JAXMLPolicySource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JAXMLPolicySource.

func (*JAXMLPolicySource) DeepCopyInto added in v2.2.0

func (in *JAXMLPolicySource) DeepCopyInto(out *JAXMLPolicySource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JobSetSpecPatch added in v2.2.0

type JobSetSpecPatch struct {
	// replicatedJobs defines per-job patches, keyed by job name.
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=100
	// +optional
	ReplicatedJobs []ReplicatedJobPatch `json:"replicatedJobs,omitempty"`
}

JobSetSpecPatch defines allowed patches for the JobSet spec.

func (*JobSetSpecPatch) DeepCopy added in v2.2.0

func (in *JobSetSpecPatch) DeepCopy() *JobSetSpecPatch

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobSetSpecPatch.

func (*JobSetSpecPatch) DeepCopyInto added in v2.2.0

func (in *JobSetSpecPatch) DeepCopyInto(out *JobSetSpecPatch)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JobSetTemplatePatch added in v2.2.0

type JobSetTemplatePatch struct {
	// metadata patches the JobSet object metadata.
	// Only labels and annotations are allowed.
	// +optional
	Metadata *metav1.ObjectMeta `json:"metadata,omitempty"`

	// spec patches the JobSet spec with restricted fields.
	// +optional
	Spec *JobSetSpecPatch `json:"spec,omitempty"`
}

JobSetTemplatePatch defines patches for the JobSet template. It mirrors JobSetTemplateSpec but only exposes metadata and restricted spec fields.

func (*JobSetTemplatePatch) DeepCopy added in v2.2.0

func (in *JobSetTemplatePatch) DeepCopy() *JobSetTemplatePatch

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobSetTemplatePatch.

func (*JobSetTemplatePatch) DeepCopyInto added in v2.2.0

func (in *JobSetTemplatePatch) DeepCopyInto(out *JobSetTemplatePatch)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JobSetTemplateSpec

type JobSetTemplateSpec struct {
	// metadata for custom JobSet's labels and annotations.
	// JobSet name and namespace is equal to the TrainJob's name and namespace.
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// spec of the desired JobSet which will be created from TrainJob.
	// +optional
	Spec jobsetv1alpha2.JobSetSpec `json:"spec,omitempty"`
}

JobSetTemplateSpec represents a template of the desired JobSet. +kubebuilder:validation:MinProperties=1

func (*JobSetTemplateSpec) DeepCopy

func (in *JobSetTemplateSpec) DeepCopy() *JobSetTemplateSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobSetTemplateSpec.

func (*JobSetTemplateSpec) DeepCopyInto

func (in *JobSetTemplateSpec) DeepCopyInto(out *JobSetTemplateSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JobSpecPatch added in v2.2.0

type JobSpecPatch struct {
	// template patches the Pod template for this Job.
	// +optional
	Template *PodTemplatePatch `json:"template,omitempty"`
}

JobSpecPatch defines allowed patches for the Job spec.

func (*JobSpecPatch) DeepCopy added in v2.2.0

func (in *JobSpecPatch) DeepCopy() *JobSpecPatch

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobSpecPatch.

func (*JobSpecPatch) DeepCopyInto added in v2.2.0

func (in *JobSpecPatch) DeepCopyInto(out *JobSpecPatch)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JobStatus

type JobStatus struct {
	// name of the child Job.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	// +required
	Name string `json:"name,omitempty"`

	// ready is the number of child Jobs where the number of ready pods and completed pods
	// is greater than or equal to the total expected pod count for the child Job.
	// +kubebuilder:validation:Minimum=0
	// +required
	Ready *int32 `json:"ready,omitempty"`

	// succeeded is the number of successfully completed child Jobs.
	// +kubebuilder:validation:Minimum=0
	// +required
	Succeeded *int32 `json:"succeeded,omitempty"`

	// failed is the number of failed child Jobs.
	// +kubebuilder:validation:Minimum=0
	// +required
	Failed *int32 `json:"failed,omitempty"`

	// active is the number of child Jobs with at least 1 pod in a running or pending state
	// which are not marked for deletion.
	// +kubebuilder:validation:Minimum=0
	// +required
	Active *int32 `json:"active,omitempty"`

	// suspended is the number of child Jobs which are in a suspended state.
	// +kubebuilder:validation:Minimum=0
	// +required
	Suspended *int32 `json:"suspended,omitempty"`
}

func (*JobStatus) DeepCopy

func (in *JobStatus) DeepCopy() *JobStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobStatus.

func (*JobStatus) DeepCopyInto

func (in *JobStatus) DeepCopyInto(out *JobStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JobTemplatePatch added in v2.2.0

type JobTemplatePatch struct {
	// metadata patches the Job template metadata.
	// Only labels and annotations are allowed.
	// +optional
	Metadata *metav1.ObjectMeta `json:"metadata,omitempty"`

	// spec patches the Job spec with restricted fields.
	// +optional
	Spec *JobSpecPatch `json:"spec,omitempty"`
}

JobTemplatePatch defines patches for a Job template within a replicated job.

func (*JobTemplatePatch) DeepCopy added in v2.2.0

func (in *JobTemplatePatch) DeepCopy() *JobTemplatePatch

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobTemplatePatch.

func (*JobTemplatePatch) DeepCopyInto added in v2.2.0

func (in *JobTemplatePatch) DeepCopyInto(out *JobTemplatePatch)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MLPolicy

type MLPolicy struct {
	// numNodes is the number of training nodes.
	// Defaults to 1.
	// +optional
	NumNodes *int32 `json:"numNodes,omitempty"`

	// Configuration for the runtime-specific parameters, such as Torch, Flux, or MPI.
	// Only one of its members may be specified.
	MLPolicySource `json:",inline"`
}

MLPolicy represents configuration for the model training with ML-specific parameters. +kubebuilder:validation:XValidation:rule="[has(self.torch), has(self.mpi), has(self.jax), has(self.xgboost),has(self.flux)].filter(x, x).size() <= 1", message="Only one of the policy can be configured"

func (*MLPolicy) DeepCopy

func (in *MLPolicy) DeepCopy() *MLPolicy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MLPolicy.

func (*MLPolicy) DeepCopyInto

func (in *MLPolicy) DeepCopyInto(out *MLPolicy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MLPolicySource

type MLPolicySource struct {
	// torch defines the configuration for the PyTorch runtime.
	// +optional
	Torch *TorchMLPolicySource `json:"torch,omitempty"`

	// mpi defines the configuration for the MPI Runtime.
	// +optional
	MPI *MPIMLPolicySource `json:"mpi,omitempty"`

	// flux defines the configuration for the Flux runtime.
	// +optional
	Flux *FluxMLPolicySource `json:"flux,omitempty"`

	// jax defines the configuration for the JAX Runtime
	// +optional
	JAX *JAXMLPolicySource `json:"jax,omitempty"`

	// xgboost defines the configuration for the XGBoost Runtime.
	// +optional
	XGBoost *XGBoostMLPolicySource `json:"xgboost,omitempty"`
}

MLPolicySource represents the runtime-specific configuration for various technologies. One of the following specs can be set.

func (*MLPolicySource) DeepCopy

func (in *MLPolicySource) DeepCopy() *MLPolicySource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MLPolicySource.

func (*MLPolicySource) DeepCopyInto

func (in *MLPolicySource) DeepCopyInto(out *MLPolicySource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MPIImplementation

type MPIImplementation string

MPIImplementation represents one of the supported MPI implementations.

const (
	MPIImplementationOpenMPI MPIImplementation = "OpenMPI"
	MPIImplementationIntel   MPIImplementation = "Intel"
	MPIImplementationMPICH   MPIImplementation = "MPICH"
)

type MPIMLPolicySource

type MPIMLPolicySource struct {
	// numProcPerNode is the number of processes per node.
	// This value is equal to the number of slots for each node in the hostfile.
	// Defaults to 1.
	// +kubebuilder:default=1
	// +optional
	NumProcPerNode *int32 `json:"numProcPerNode,omitempty"`

	// mpiImplementation is the name of the MPI implementation to create the appropriate hostfile.
	// Defaults to OpenMPI.
	// +kubebuilder:default=OpenMPI
	// +kubebuilder:validation:Enum=OpenMPI;""
	// +optional
	MPIImplementation *MPIImplementation `json:"mpiImplementation,omitempty"`

	// sshAuthMountPath is the directory where SSH keys are mounted.
	// Defaults to /root/.ssh.
	// +kubebuilder:default=/root/.ssh
	// +kubebuilder:validation:MaxLength=4096
	// +optional
	SSHAuthMountPath *string `json:"sshAuthMountPath,omitempty"`

	// runLauncherAsNode defines whether to run training process on the launcher Job.
	// Defaults to false.
	// +kubebuilder:default=false
	// +optional
	RunLauncherAsNode *bool `json:"runLauncherAsNode,omitempty"`
}

MPIMLPolicySource represents a MPI runtime configuration.

func (*MPIMLPolicySource) DeepCopy

func (in *MPIMLPolicySource) DeepCopy() *MPIMLPolicySource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MPIMLPolicySource.

func (*MPIMLPolicySource) DeepCopyInto

func (in *MPIMLPolicySource) DeepCopyInto(out *MPIMLPolicySource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Metric added in v2.2.0

type Metric struct {
	// name is a user-defined label for the metric, e.g. "loss", "eval_accuracy".
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=64
	// +required
	Name string `json:"name,omitempty"`

	// value of the metric. Values must be serialized as a string.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=64
	// +required
	Value string `json:"value,omitempty"`
}

func (*Metric) DeepCopy added in v2.2.0

func (in *Metric) DeepCopy() *Metric

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Metric.

func (*Metric) DeepCopyInto added in v2.2.0

func (in *Metric) DeepCopyInto(out *Metric)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ModelInitializer

type ModelInitializer struct {
	// storageUri is the URI for the model provider.
	// If set, it may be empty, or it must be a valid URI format
	// (e.g., s3://bucket/path, gs://bucket/path).
	// +kubebuilder:validation:XValidation:rule="self == ” || self.matches('^[A-Za-z][A-Za-z0-9+.-]*://.+$')",message="storageUri may be empty, or it must be a valid URI (scheme://...)"
	// +kubebuilder:validation:MaxLength=2048
	// +optional
	StorageUri *string `json:"storageUri,omitempty"`

	// env is the list of environment variables to set in the model initializer container.
	// These values will be merged with the TrainingRuntime's model initializer environments.
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=128
	// +optional
	Env []corev1.EnvVar `json:"env,omitempty"`

	// secretRef is the reference to the secret with credentials to download model.
	// Secret must be created in the TrainJob's namespace.
	// +optional
	SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty"`
}

ModelInitializer represents the desired configuration to initialize pre-trained model. The ModelInitializer spec will override the runtime Job template which contains this label: `trainer.kubeflow.org/trainjob-ancestor-step: dataset-initializer`

func (*ModelInitializer) DeepCopy

func (in *ModelInitializer) DeepCopy() *ModelInitializer

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ModelInitializer.

func (*ModelInitializer) DeepCopyInto

func (in *ModelInitializer) DeepCopyInto(out *ModelInitializer)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PodGroupPolicy

type PodGroupPolicy struct {
	// Configuration for gang-scheduling using various plugins.
	PodGroupPolicySource `json:",inline"`
}

PodGroupPolicy represents a PodGroup configuration for gang-scheduling.

func (*PodGroupPolicy) DeepCopy

func (in *PodGroupPolicy) DeepCopy() *PodGroupPolicy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupPolicy.

func (*PodGroupPolicy) DeepCopyInto

func (in *PodGroupPolicy) DeepCopyInto(out *PodGroupPolicy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PodGroupPolicySource

type PodGroupPolicySource struct {
	// coscheduling plugin from the Kubernetes scheduler-plugins for gang-scheduling.
	// +optional
	Coscheduling *CoschedulingPodGroupPolicySource `json:"coscheduling,omitempty"`

	// volcano plugin for gang-scheduling.
	// +optional
	Volcano *VolcanoPodGroupPolicySource `json:"volcano,omitempty"`
}

PodGroupPolicySource represents supported plugins for gang-scheduling. Only one of its members may be specified.

func (*PodGroupPolicySource) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodGroupPolicySource.

func (*PodGroupPolicySource) DeepCopyInto

func (in *PodGroupPolicySource) DeepCopyInto(out *PodGroupPolicySource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PodSpecPatch added in v2.2.0

type PodSpecPatch struct {
	// serviceAccountName patches the service account for the Pods in the target job templates.
	// +kubebuilder:validation:MaxLength=253
	// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="field is immutable"
	// +optional
	ServiceAccountName *string `json:"serviceAccountName,omitempty"`

	// volumes patches the Pod's volumes.
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=128
	// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="field is immutable"
	// +optional
	Volumes []corev1.Volume `json:"volumes,omitempty"`

	// initContainers patches the init containers in the target job templates.
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=64
	// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="field is immutable"
	// +optional
	InitContainers []ContainerPatch `json:"initContainers,omitempty"`

	// containers patches specific containers in the target job templates.
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=64
	// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="field is immutable"
	// +optional
	Containers []ContainerPatch `json:"containers,omitempty"`

	// imagePullSecrets patches the image pull secrets for the Pods in the target job templates.
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=64
	// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="field is immutable"
	// +optional
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

	// securityContext patches the Pod's security context.
	// More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
	// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="field is immutable"
	// +optional
	SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`

	// nodeSelector patches the node selector to place Pods on specific nodes.
	// +optional
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`

	// affinity patches the Pod's scheduling affinity.
	// +optional
	Affinity *corev1.Affinity `json:"affinity,omitempty"`

	// tolerations patches the Pod's tolerations.
	// +listType=atomic
	// +kubebuilder:validation:MaxItems=128
	// +optional
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	// schedulingGates patches the scheduling gates for the Pods in the target job templates.
	// More info: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-scheduling-readiness/
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=16
	// +optional
	SchedulingGates []corev1.PodSchedulingGate `json:"schedulingGates,omitempty"`

	// terminationGracePeriodSeconds patches the termination grace period for Pods
	// in the target job templates.
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="field is immutable"
	// +optional
	TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
}

PodSpecPatch contains the Pod spec fields that managers are permitted to patch.

func (*PodSpecPatch) DeepCopy added in v2.2.0

func (in *PodSpecPatch) DeepCopy() *PodSpecPatch

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSpecPatch.

func (*PodSpecPatch) DeepCopyInto added in v2.2.0

func (in *PodSpecPatch) DeepCopyInto(out *PodSpecPatch)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PodTemplatePatch added in v2.2.0

type PodTemplatePatch struct {
	// metadata patches the Pod template metadata.
	// Only labels and annotations are allowed.
	// +optional
	Metadata *metav1.ObjectMeta `json:"metadata,omitempty"`

	// spec patches the Pod spec with the fields managers are permitted to set.
	// +optional
	Spec *PodSpecPatch `json:"spec,omitempty"`
}

PodTemplatePatch defines patches for a Pod template within a Job.

func (*PodTemplatePatch) DeepCopy added in v2.2.0

func (in *PodTemplatePatch) DeepCopy() *PodTemplatePatch

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodTemplatePatch.

func (*PodTemplatePatch) DeepCopyInto added in v2.2.0

func (in *PodTemplatePatch) DeepCopyInto(out *PodTemplatePatch)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ReplicatedJobPatch added in v2.2.0

type ReplicatedJobPatch struct {
	// name is the name of the replicated job to patch.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	// +required
	Name string `json:"name,omitempty"`

	// template patches the Job template for this replicated job.
	// +optional
	Template *JobTemplatePatch `json:"template,omitempty"`
}

ReplicatedJobPatch defines patches for a specific replicated job within the JobSet.

func (*ReplicatedJobPatch) DeepCopy added in v2.2.0

func (in *ReplicatedJobPatch) DeepCopy() *ReplicatedJobPatch

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicatedJobPatch.

func (*ReplicatedJobPatch) DeepCopyInto added in v2.2.0

func (in *ReplicatedJobPatch) DeepCopyInto(out *ReplicatedJobPatch)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RuntimePatch added in v2.2.0

type RuntimePatch struct {
	// manager indicates who owns this patch entry. It can be set by the user, external
	// controllers, or admission webhooks to track ownership and avoid conflicts.
	// For example, Kueue sets this field to "kueue.x-k8s.io/manager".
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="field is immutable"
	// +required
	Manager string `json:"manager,omitempty"`

	// time is the timestamp of when this patch was last written.
	// Set by the Trainer admission webhook on each create or update. Used for observability only,
	// not used as a list map key.
	// +optional
	Time *metav1.Time `json:"time,omitempty"`

	// trainingRuntimeSpec defines allowed patches for ClusterTrainingRuntime or TrainingRuntime-based jobs.
	// +optional
	TrainingRuntimeSpec *TrainingRuntimeSpecPatch `json:"trainingRuntimeSpec,omitempty"`
}

RuntimePatch represents a custom patch applied to the TrainJob's training runtime template. Patches are keyed by manager to provide clear ownership and avoid conflicts between controllers.

func (*RuntimePatch) DeepCopy added in v2.2.0

func (in *RuntimePatch) DeepCopy() *RuntimePatch

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuntimePatch.

func (*RuntimePatch) DeepCopyInto added in v2.2.0

func (in *RuntimePatch) DeepCopyInto(out *RuntimePatch)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RuntimeRef

type RuntimeRef struct {
	// name of the runtime being referenced.
	// When namespaced-scoped TrainingRuntime is used, the TrainJob must have
	// the same namespace as the deployed runtime.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	// +required
	Name string `json:"name,omitempty"`

	// apiGroup of the runtime being referenced.
	// Defaults to `trainer.kubeflow.org`.
	// +kubebuilder:default="trainer.kubeflow.org"
	// +kubebuilder:validation:MaxLength=253
	// +optional
	APIGroup *string `json:"apiGroup,omitempty"`

	// kind of the runtime being referenced.
	// Defaults to ClusterTrainingRuntime.
	// +kubebuilder:default="ClusterTrainingRuntime"
	// +kubebuilder:validation:MaxLength=253
	// +optional
	Kind *string `json:"kind,omitempty"`
}

RuntimeRef represents the reference to the existing training runtime.

func (*RuntimeRef) DeepCopy

func (in *RuntimeRef) DeepCopy() *RuntimeRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuntimeRef.

func (*RuntimeRef) DeepCopyInto

func (in *RuntimeRef) DeepCopyInto(out *RuntimeRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TorchMLPolicySource

type TorchMLPolicySource struct {
	// envInjection configures which additional containers should receive the
	// PET_* environment variables. By default, the PET_* variables are injected
	// only into the main "node" container. Use this field to also inject them
	// into selected sidecar or init containers. For torchtune, envInjection
	// targets still receive PET_MASTER_ADDR and PET_MASTER_PORT even though the
	// main trainer container uses command-line rendezvous instead.
	// Defaults to empty (main container only).
	// +optional
	EnvInjection *EnvInjection `json:"envInjection,omitempty"`
}

TorchMLPolicySource represents a PyTorch runtime configuration.

func (*TorchMLPolicySource) DeepCopy

func (in *TorchMLPolicySource) DeepCopy() *TorchMLPolicySource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TorchMLPolicySource.

func (*TorchMLPolicySource) DeepCopyInto

func (in *TorchMLPolicySource) DeepCopyInto(out *TorchMLPolicySource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TrainJob

type TrainJob struct {
	metav1.TypeMeta `json:",inline"`

	// metadata of the TrainJob.
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// spec of the TrainJob.
	// +optional
	Spec TrainJobSpec `json:"spec,omitzero"`

	// status of TrainJob.
	// +optional
	Status TrainJobStatus `json:"status,omitzero"`
}

TrainJob represents configuration of a training job.

func (*TrainJob) DeepCopy

func (in *TrainJob) DeepCopy() *TrainJob

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrainJob.

func (*TrainJob) DeepCopyInto

func (in *TrainJob) DeepCopyInto(out *TrainJob)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TrainJob) DeepCopyObject

func (in *TrainJob) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TrainJobList

type TrainJobList struct {
	metav1.TypeMeta `json:",inline"`

	// Standard list metadata.
	metav1.ListMeta `json:"metadata,omitempty"`

	// List of TrainJobs.
	Items []TrainJob `json:"items"`
}

TrainJobList is a collection of training jobs.

func (*TrainJobList) DeepCopy

func (in *TrainJobList) DeepCopy() *TrainJobList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrainJobList.

func (*TrainJobList) DeepCopyInto

func (in *TrainJobList) DeepCopyInto(out *TrainJobList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TrainJobList) DeepCopyObject

func (in *TrainJobList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TrainJobSpec

type TrainJobSpec struct {
	// runtimeRef is the reference to the training runtime.
	// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="field is immutable"
	// +required
	RuntimeRef RuntimeRef `json:"runtimeRef,omitzero"`

	// initializer defines the configuration of the initializer.
	// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="field is immutable"
	// +optional
	Initializer *Initializer `json:"initializer,omitempty"`

	// trainer defines the configuration of the trainer.
	// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="field is immutable"
	// +optional
	Trainer *Trainer `json:"trainer,omitempty"`

	// runtimePatches defines custom patches applied to the TrainJob's Runtime.
	// Patches are keyed by manager to provide clear ownership and avoid conflicts between controllers.
	// +listType=map
	// +listMapKey=manager
	// +kubebuilder:validation:MaxItems=16
	// +optional
	RuntimePatches []RuntimePatch `json:"runtimePatches,omitempty"`

	// suspend defines whether to suspend the running TrainJob.
	// +kubebuilder:default=false
	// +optional
	Suspend *bool `json:"suspend,omitempty"`

	// activeDeadlineSeconds specifies the duration in seconds relative to the TrainJob
	// start time (which resets on resume from suspension) that the TrainJob may be active
	// before the system tries to terminate it. Value must be a positive integer.
	// Once reached, all running Pods are terminated and the TrainJob status becomes
	// Failed with reason: DeadlineExceeded.
	// +optional
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="field is immutable"
	ActiveDeadlineSeconds int64 `json:"activeDeadlineSeconds,omitempty"`

	// managedBy is used to indicate the controller or entity that manages a TrainJob.
	// The value must be either an empty, `trainer.kubeflow.org/trainjob-controller` or
	// `kueue.x-k8s.io/multikueue`. The built-in TrainJob controller reconciles TrainJob which
	// don't have this field at all or the field value is the reserved string
	// `trainer.kubeflow.org/trainjob-controller`, but delegates reconciling TrainJobs
	// with a 'kueue.x-k8s.io/multikueue' to the Kueue. The field is immutable.
	// +kubebuilder:default="trainer.kubeflow.org/trainjob-controller"
	// +kubebuilder:validation:XValidation:rule="self in ['trainer.kubeflow.org/trainjob-controller', 'kueue.x-k8s.io/multikueue']", message="ManagedBy must be trainer.kubeflow.org/trainjob-controller or kueue.x-k8s.io/multikueue if set"
	// +kubebuilder:validation:MaxLength=253
	// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="field is immutable"
	// +optional
	ManagedBy *string `json:"managedBy,omitempty"`
}

TrainJobSpec represents specification of the desired TrainJob.

func (*TrainJobSpec) DeepCopy

func (in *TrainJobSpec) DeepCopy() *TrainJobSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrainJobSpec.

func (*TrainJobSpec) DeepCopyInto

func (in *TrainJobSpec) DeepCopyInto(out *TrainJobSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TrainJobStatus

type TrainJobStatus struct {
	// conditions for the TrainJob.
	// +optional
	// +listType=map
	// +listMapKey=type
	// +kubebuilder:validation:MaxItems=8
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// jobsStatus tracks the child Jobs in TrainJob.
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=100
	// +optional
	JobsStatus []JobStatus `json:"jobsStatus,omitempty"`

	// trainerStatus contains the latest observed runtime status of the
	// Trainer step of the TrainJob. It reflects progress, remaining time,
	// metrics, and the last update timestamp.
	//
	// This field is nil if the TrainJob does not report trainer-level
	// status, or if no status has been observed yet (for example,
	// immediately after the TrainJob is created).
	//
	// This is an alpha feature and requires enabling the TrainJobStatus feature gate.
	// +optional
	TrainerStatus *TrainerStatus `json:"trainerStatus,omitempty"`
}

TrainJobStatus represents the current status of TrainJob. +kubebuilder:validation:MinProperties=1

func (*TrainJobStatus) DeepCopy

func (in *TrainJobStatus) DeepCopy() *TrainJobStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrainJobStatus.

func (*TrainJobStatus) DeepCopyInto

func (in *TrainJobStatus) DeepCopyInto(out *TrainJobStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Trainer

type Trainer struct {
	// image is the container image for the training container.
	// +kubebuilder:validation:MaxLength=500
	// +optional
	Image *string `json:"image,omitempty"`

	// command for the entrypoint of the training container.
	// +listType=atomic
	// +kubebuilder:validation:MaxItems=128
	// +kubebuilder:validation:items:MaxLength=1048576
	// +optional
	Command []string `json:"command,omitempty"`

	// args for the entrypoint for the training container.
	// +listType=atomic
	// +kubebuilder:validation:MaxItems=128
	// +kubebuilder:validation:items:MaxLength=1048576
	// +optional
	Args []string `json:"args,omitempty"`

	// env is the list of environment variables to set in the training container.
	// These values will be merged with the TrainingRuntime's trainer environments.
	// +listType=map
	// +listMapKey=name
	// +kubebuilder:validation:MaxItems=128
	// +optional
	Env []corev1.EnvVar `json:"env,omitempty"`

	// numNodes is the number of training nodes.
	// TODO (andreyvelich): Do we want to support dynamic num of nodes in TrainJob for PyTorch elastic: `--nnodes=1:4` ?
	// +optional
	NumNodes *int32 `json:"numNodes,omitempty"`

	// resourcesPerNode defines the compute resources for each training node.
	// +optional
	ResourcesPerNode *corev1.ResourceRequirements `json:"resourcesPerNode,omitempty"`

	// numProcPerNode is the number of processes/workers/slots on every training node.
	// For the MPI runtime only int value can be set to represent number of slots per node.
	// For the Torch runtime the value defaults to `auto` and can be overridden with an int.
	// +optional
	NumProcPerNode *int32 `json:"numProcPerNode,omitempty"`
}

Trainer represents the desired configuration for the training job. The Trainer spec will override the runtime template which contains this label: `trainer.kubeflow.org/trainjob-ancestor-step: trainer`

func (*Trainer) DeepCopy

func (in *Trainer) DeepCopy() *Trainer

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Trainer.

func (*Trainer) DeepCopyInto

func (in *Trainer) DeepCopyInto(out *Trainer)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TrainerStatus added in v2.2.0

type TrainerStatus struct {

	// progressPercentage gives an estimate of how complete the TrainJob is as a percentage.
	// The value will be between 0 and 100, or empty if unknown.
	//
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=100
	// +optional
	ProgressPercentage *int32 `json:"progressPercentage,omitempty"`

	// estimatedRemainingSeconds gives the estimated remaining training time in seconds
	// before the train job is completed.
	// The value will be empty if it is unknown.
	//
	// +kubebuilder:validation:Minimum=0
	// +optional
	EstimatedRemainingSeconds *int32 `json:"estimatedRemainingSeconds,omitempty"`

	// metrics contains the current metrics for the model.
	//
	// +kubebuilder:validation:MaxItems=256
	// +listType=atomic
	// +optional
	Metrics []Metric `json:"metrics,omitempty"`

	// lastUpdatedTime is the timestamp when the runtime status was observed.
	// +optional
	LastUpdatedTime metav1.Time `json:"lastUpdatedTime,omitempty"`
}

TrainerStatus represents the latest known runtime status of the Trainer step of the TrainJob. +kubebuilder:validation:XValidation:rule="has(self.lastUpdatedTime)",message="lastUpdatedTime is required when trainerStatus is present"

func (*TrainerStatus) DeepCopy added in v2.2.0

func (in *TrainerStatus) DeepCopy() *TrainerStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrainerStatus.

func (*TrainerStatus) DeepCopyInto added in v2.2.0

func (in *TrainerStatus) DeepCopyInto(out *TrainerStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TrainingRuntime

type TrainingRuntime struct {
	metav1.TypeMeta `json:",inline"`

	// metadata of the TrainingRuntime.
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// spec of the TrainingRuntime.
	// +optional
	Spec TrainingRuntimeSpec `json:"spec,omitempty,omitzero"`
}

TrainingRuntime represents a training runtime which can be referenced as part of `runtimeRef` API in TrainJob. This resource is a namespaced-scoped and can be referenced by TrainJob that created in the *same* namespace as the TrainingRuntime.

func (*TrainingRuntime) DeepCopy

func (in *TrainingRuntime) DeepCopy() *TrainingRuntime

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrainingRuntime.

func (*TrainingRuntime) DeepCopyInto

func (in *TrainingRuntime) DeepCopyInto(out *TrainingRuntime)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TrainingRuntime) DeepCopyObject

func (in *TrainingRuntime) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TrainingRuntimeList

type TrainingRuntimeList struct {
	metav1.TypeMeta `json:",inline"`

	// Standard list metadata.
	metav1.ListMeta `json:"metadata,omitempty"`

	// List of TrainingRuntimes.
	Items []TrainingRuntime `json:"items"`
}

TrainingRuntimeList is a collection of training runtimes.

func (*TrainingRuntimeList) DeepCopy

func (in *TrainingRuntimeList) DeepCopy() *TrainingRuntimeList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrainingRuntimeList.

func (*TrainingRuntimeList) DeepCopyInto

func (in *TrainingRuntimeList) DeepCopyInto(out *TrainingRuntimeList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TrainingRuntimeList) DeepCopyObject

func (in *TrainingRuntimeList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TrainingRuntimeSpec

type TrainingRuntimeSpec struct {
	// mlPolicy provides the ML-specific parameters for the model training.
	// +optional
	MLPolicy *MLPolicy `json:"mlPolicy,omitempty"`

	// podGroupPolicy defines the configuration for the PodGroup to enable gang-scheduling via supported plugins.
	// +optional
	PodGroupPolicy *PodGroupPolicy `json:"podGroupPolicy,omitempty"`

	// template for the JobSet which will be used by TrainJob.
	// +optional
	Template JobSetTemplateSpec `json:"template,omitzero"`
}

TrainingRuntimeSpec represents a specification of the desired training runtime. +kubebuilder:validation:MinProperties=1

func (*TrainingRuntimeSpec) DeepCopy

func (in *TrainingRuntimeSpec) DeepCopy() *TrainingRuntimeSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrainingRuntimeSpec.

func (*TrainingRuntimeSpec) DeepCopyInto

func (in *TrainingRuntimeSpec) DeepCopyInto(out *TrainingRuntimeSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TrainingRuntimeSpecPatch added in v2.2.0

type TrainingRuntimeSpecPatch struct {
	// template patches the JobSet template.
	// +optional
	Template *JobSetTemplatePatch `json:"template,omitempty"`
}

TrainingRuntimeSpecPatch mirrors TrainingRuntimeSpec but only exposes the fields managers are permitted to patch.

func (*TrainingRuntimeSpecPatch) DeepCopy added in v2.2.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrainingRuntimeSpecPatch.

func (*TrainingRuntimeSpecPatch) DeepCopyInto added in v2.2.0

func (in *TrainingRuntimeSpecPatch) DeepCopyInto(out *TrainingRuntimeSpecPatch)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type UpdateTrainJobStatusRequest added in v2.2.0

type UpdateTrainJobStatusRequest struct {
	// trainerStatus contains the latest observed runtime status of the
	// Trainer step of the TrainJob. It reflects progress, remaining time,
	// metrics, and the last update timestamp.
	//
	// This field is nil if the TrainJob does not report trainer-level
	// status, or if no status has been observed yet (for example,
	// immediately after the TrainJob is created).
	//
	// This is an alpha feature and requires enabling the TrainJobStatus feature gate.
	// +optional
	TrainerStatus *TrainerStatus `json:"trainerStatus,omitempty"`
}

UpdateTrainJobStatusRequest contains the current runtime status (e.g. progress and metrics) for the different stages of the TrainJob.

func (*UpdateTrainJobStatusRequest) DeepCopy added in v2.2.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateTrainJobStatusRequest.

func (*UpdateTrainJobStatusRequest) DeepCopyInto added in v2.2.0

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type VolcanoPodGroupPolicySource added in v2.1.0

type VolcanoPodGroupPolicySource struct {
	// networkTopology defines the NetworkTopology config, this field works in conjunction with network topology feature and hyperNode CRD.
	// +optional
	NetworkTopology *volcanov1beta1.NetworkTopologySpec `json:"networkTopology,omitempty"`
}

VolcanoPodGroupPolicySource represents configuration for the Volcano gang-scheduler.

func (*VolcanoPodGroupPolicySource) DeepCopy added in v2.1.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolcanoPodGroupPolicySource.

func (*VolcanoPodGroupPolicySource) DeepCopyInto added in v2.1.0

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type XGBoostMLPolicySource added in v2.2.0

type XGBoostMLPolicySource struct{}

XGBoostMLPolicySource represents an XGBoost runtime configuration. The number of workers per node is automatically derived from container GPU resources:

  • GPU training: 1 worker per GPU (from resourcesPerNode)
  • CPU training: 1 worker per node (each worker utilizes all available CPU cores via XGBoost's multi-threaded execution, controlled by the nthread parameter)

DMLC_NUM_WORKER = numNodes × workersPerNode (where workersPerNode = GPU count or 1)

func (*XGBoostMLPolicySource) DeepCopy added in v2.2.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new XGBoostMLPolicySource.

func (*XGBoostMLPolicySource) DeepCopyInto added in v2.2.0

func (in *XGBoostMLPolicySource) DeepCopyInto(out *XGBoostMLPolicySource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL