Documentation
¶
Overview ¶
Package platform provides model-independent, CSP/GPU-architecture-only overrides for WorkloadRun resources. Override definitions live in YAML templates (overrides/workloadrun.yaml) that reference the same _lib/ fragments used by catalog entries, ensuring a single source of truth for CSP/GPU-specific networking, NCCL configuration, and DRA setup.
Index ¶
- func BaseNCCLEnvVars(enableMNNVL bool) []corev1.EnvVar
- func BuildExecRuntime(cfg RuntimeConfig) burninv1alpha1.DependencySpec
- func BuildMPIRuntime(cfg RuntimeConfig) burninv1alpha1.DependencySpec
- func BuildTorchRuntime(cfg RuntimeConfig) burninv1alpha1.DependencySpec
- func MergeEnvVars(base, user []corev1.EnvVar) []corev1.EnvVar
- type OverrideConfig
- type RuntimeConfig
- type WorkloadRunOverride
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BaseNCCLEnvVars ¶
BaseNCCLEnvVars returns model-independent NCCL environment variables that are safe to auto-inject for any workload. These are common across all training models and NCCL tests.
Platform-specific NCCL vars (FastRak, IB settings) are injected via overrides, not here.
func BuildExecRuntime ¶
func BuildExecRuntime(cfg RuntimeConfig) burninv1alpha1.DependencySpec
BuildExecRuntime creates a TrainingRuntime dependency for arbitrary command execution. Uses a simple single-replicatedJob layout with torch mlPolicy.
func BuildMPIRuntime ¶
func BuildMPIRuntime(cfg RuntimeConfig) burninv1alpha1.DependencySpec
BuildMPIRuntime creates TrainingRuntime dependencies for MPI-based workloads. Generates: - A runtime with MPI mlPolicy and launcher+node replicatedJobs - Worker nodes with sshd, IPC_LOCK, readiness probe - Launcher with mpirun and SSH key setup
func BuildTorchRuntime ¶
func BuildTorchRuntime(cfg RuntimeConfig) burninv1alpha1.DependencySpec
BuildTorchRuntime creates a TrainingRuntime dependency for PyTorch distributed training. Generates a runtime with torch mlPolicy and a single "node" replicatedJob.
Types ¶
type OverrideConfig ¶
type OverrideConfig struct {
EntryName string
NodesPerJob int32
GpusPerNode int32
MlnxPerNode int32
EnableMNNVL bool
FrameworkType string
}
OverrideConfig holds template data for rendering platform overrides. Field names match the catalog template data shape so _lib/ fragments can be rendered directly without mapping.
type RuntimeConfig ¶
type RuntimeConfig struct {
// EntryName is the WorkloadRun name (used as prefix for resource names).
// Matches catalog template variable .EntryName.
EntryName string
// Image is the container image.
Image string
// NodesPerJob is the number of nodes.
NodesPerJob int32
// GpusPerNode is the number of GPUs per node.
GpusPerNode int32
// Env is the merged env vars (base NCCL + user).
Env []corev1.EnvVar
// Volumes are additional volumes.
Volumes []corev1.Volume
// VolumeMounts are additional volume mounts.
VolumeMounts []corev1.VolumeMount
// InitContainers are user-provided init containers.
InitContainers []corev1.Container
// Resources overrides GPU/memory/CPU resources.
Resources *corev1.ResourceRequirements
// ImagePullSecrets for container pull.
ImagePullSecrets []corev1.LocalObjectReference
}
RuntimeConfig holds all parameters needed to build a TrainingRuntime dependency.
type WorkloadRunOverride ¶
type WorkloadRunOverride struct {
burninv1alpha1.OverrideSpec
// PreCommand contains shell lines prepended to the trainer command.
// Applied by the WorkloadRun controller; baked into trainer.command/args.
PreCommand []string
// MPIArgs contains mpirun arguments prepended to the MPI launcher command.
// Applied by the WorkloadRun controller; baked into trainer.args.
MPIArgs []string
}
WorkloadRunOverride extends OverrideSpec with fields that are consumed by the WorkloadRun controller at build time and never stored in the Kubernetes API. Keeping them out of OverrideSpec avoids CRD schema changes.
func BuildOverrides ¶
func BuildOverrides(cfg OverrideConfig) []WorkloadRunOverride
BuildOverrides renders the platform override templates and returns the resulting WorkloadRunOverride list.