Skip to content

Commit 9b88eab

Browse files
ko3n1gclaude
andcommitted
feat: add KubeflowExecutor for Kubeflow Training Operator on Kubernetes
Introduces KubeflowExecutor and a matching TorchX scheduler so users can deploy distributed training jobs to any Kubernetes cluster running the Kubeflow Training Operator via run.run() / run.Experiment. Supports both PyTorchJob (Training Operator v1) and TrainJob (Training Operator v2, torch-distributed runtime) via the job_kind parameter. Core features: - KubeflowExecutor builds and submits PyTorchJob/TrainJob CRDs via the Kubernetes API (local kubeconfig with in-cluster fallback) - TorchX scheduler persists job state and maps KubeflowJobState → AppState - Workdir sync: package() copies job_dir to a PVC via a throw-away Alpine data-mover pod using kubectl cp (tar-based, no internet required) - pull_results() syncs the PVC back to localhost after the job completes; auto-resolves job_dir from persisted scheduler state when the executor was not assign()ed directly (typical after run.run()) - Template-based launch.sh (kubeflow.sh.j2) hides torchrun details - workdir_local_path merges local scripts into job_dir before PVC sync - cancel(wait=True) polls until both CR and pods are fully terminated - Data-mover pod inherits tolerations/affinity/imagePullSecrets so it can be scheduled alongside the training workload - TrainJob podTemplateOverrides use container name "node" (matching the ClusterTrainingRuntime) so volumeMounts merge correctly Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: oliver könig <okoenig@nvidia.com>
1 parent b725412 commit 9b88eab

12 files changed

Lines changed: 2193 additions & 115 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,4 @@ _version.py
183183

184184
# NeMo Run
185185
.nemo_run/
186+
local/

nemo_run/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from nemo_run.core.execution.base import Executor, ExecutorMacros, import_executor
2525
from nemo_run.core.execution.dgxcloud import DGXCloudExecutor
2626
from nemo_run.core.execution.docker import DockerExecutor
27+
from nemo_run.core.execution.kubeflow import KubeflowExecutor
2728
from nemo_run.core.execution.launcher import FaultTolerance, SlurmRay, SlurmTemplate, Torchrun
2829
from nemo_run.core.execution.lepton import LeptonExecutor
2930
from nemo_run.core.execution.local import LocalExecutor
@@ -66,6 +67,7 @@
6667
"Packager",
6768
"Partial",
6869
"Plugin",
70+
"KubeflowExecutor",
6971
"run",
7072
"Script",
7173
"SkypilotExecutor",

nemo_run/core/execution/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from nemo_run.core.execution.dgxcloud import DGXCloudExecutor
1717
from nemo_run.core.execution.lepton import LeptonExecutor
1818
from nemo_run.core.execution.local import LocalExecutor
19+
from nemo_run.core.execution.kubeflow import KubeflowExecutor
1920
from nemo_run.core.execution.skypilot import SkypilotExecutor
2021
from nemo_run.core.execution.slurm import SlurmExecutor
2122

@@ -25,4 +26,5 @@
2526
"SkypilotExecutor",
2627
"DGXCloudExecutor",
2728
"LeptonExecutor",
29+
"KubeflowExecutor",
2830
]

0 commit comments

Comments
 (0)