Skip to content

feat(api): implement MPI node groups (KEP-4064) - #4296

Draft
matbun wants to merge 1 commit into
kubeflow:masterfrom
matbun:kep-4064-impl
Draft

matbun wants to merge 1 commit into
kubeflow:masterfrom
matbun:kep-4064-impl

Conversation

@matbun

@matbun matbun commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Reference implementation of KEP-4064 (#4145), opened as a draft so the KEP discussion can look at working code, and so we can deploy and test it on our clusters at CERN. An MPI runtime declares mlPolicy.mpi.launcher and mlPolicy.mpi.nodeGroups, and a TrainJob sets the size, slots, image, command, args, env and resources of each group with spec.trainer.launcher and spec.trainer.nodeGroups. Runtimes without the new fields keep today's behaviour.

Groups with numNodes: 0 are removed from the JobSet together with the dependsOn, successPolicy and failurePolicy entries that reference them, every group gets its own hostfile lines and slots, with the GPU fallback applied per group, and the launcher is found by jobName, so these runtimes reject the trainjob-ancestor-step label. Where the code differs from the KEP, for example launcher being a struct and containerName a string as the Kube API Linter requires, I will update the KEP.

Tested with unit tests in the touched packages and with webhook and controller integration tests on envtest 1.37, which also run the new CEL rules.

Which issue(s) this PR fixes (optional, in Fixes #<issue number>, #<issue number>, ... format, will close the issue(s) when PR gets merged):
Part of #4064

Checklist:

  • Docs included if any changes are user facing

Let one MPI TrainJob run several node groups, each a replicatedJob with its own Pod template, number of nodes and slots, so a single job can mix CPU only, NVIDIA and AMD nodes. The runtime declares mlPolicy.mpi.launcher and mlPolicy.mpi.nodeGroups by name, and the TrainJob tunes them with spec.trainer.launcher and spec.trainer.nodeGroups, which share one schema and apply only to the MPI container of each group.

Groups with numNodes 0 are removed from the JobSet with the references to them, every group gets its own hostfile lines and slots, and the launcher is found by jobName instead of the trainjob-ancestor-step label. Runtimes without the new fields keep their behaviour.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Matteo Bunino <48362942+matbun@users.noreply.github.com>
@google-oss-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign jeffwan for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow
google-oss-prow Bot requested a review from robert-bell October 22, 2026 19:16

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant