Commit 9b88eab
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
- nemo_run
- core/execution
- templates
- run
- torchx_backend/schedulers
- test
- core/execution
- run/torchx_backend/schedulers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| 29 | + | |
28 | 30 | | |
0 commit comments