Repository navigation
fix(framework): apply runtime numNodes to MPI worker nodes - #4284
sakethalladaaa wants to merge 1 commit into
Conversation
Signed-off-by: sakethalladaaa <sakethalladaaa@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
🎉 Welcome to the Kubeflow Trainer! 🎉 Thanks for opening your first PR! We're happy to have you as part of our community 🚀 Here's what happens next:
Join the community:
Feel free to ask questions in the comments if you need any help or clarification! |
harshrajdebug
left a comment
There was a problem hiding this comment.
I ran this against master and against #4211, which fixes the same issue.
On the shipped runtimes the two give the same result. #4211's TestMPIRuntimePodCounts (deepspeed_distributed and mlx_distributed, 10 cases) and its MPI plugin tests pass on this branch, and TestTrainingRuntimeNewObjectsMPIRuntimeNumNodes from this PR passes on #4211.
They differ when no replicated Job has the trainer.kubeflow.org/trainjob-ancestor-step: trainer label, which the TrainingRuntime webhook does not require. The PodSet counts then come from each Job's parallelism, and since numNodes starts at 1 here, a TrainJob without numNodes gets a single node pod. I took deepspeed_distributed.yaml, removed the ancestor label from both Jobs, set the node Job's parallelism to 4 and created a TrainJob without numNodes:
| node parallelism | |
|---|---|
| master | 4 |
| #4211 | 4 |
| this PR | 1 |
The result is the same with runLauncherAsNode true and false. Leaving the node count unchanged when there is neither a trainer PodSet nor a TrainJob numNodes, as #4211 does by keeping numNodes nil, preserves master's behavior for these runtimes.
cc @robert-bell since both PRs fix #4210.
What this PR does / why we need it:
Fixes MPI runtime node scaling when
mlPolicy.numNodesis set on the runtime andTrainJob.spec.trainer.numNodesis omitted.Previously, the runtime
numNodesvalue was applied to the trainer ancestor PodSet. For built-in MPI runtimes such as DeepSpeed and MLX, the trainer ancestor is thelauncher, which caused the launcher Job to scale while the workernodeJob kept its template count.This change:
numNodesfrom the trainer ancestor PodSet,TrainJob.spec.trainer.numNodesas the higher-priority override,numNodesfallback.Validation:
make testmake generateAssisted-by: ChatGPT
Which issue(s) this PR fixes (optional, in
Fixes #<issue number>, #<issue number>, ...format, will close the issue(s) when PR gets merged):Fixes #4210
Checklist: