Repository navigation
fix(runtimes): apply MPI numNodes to the node Job instead of the launcher - #4211
auraCodesKM wants to merge 1 commit into
Conversation
|
[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 |
4e05740 to
e51a888
Compare
…cher The runtime numNodes is stored in the count of the PodSet labeled as the trainer ancestor. In the built-in MPI runtimes this is the launcher, so a runtime with mlPolicy.numNodes greater than 1 created a launcher Job with that many pods, each running mpirun. When the TrainJob did not set numNodes, the node Job also kept a single pod. Use the trainer PodSet count as the default numNodes for the node Job and keep the launcher at one pod. Signed-off-by: Kavin Thakur <kavinpadhle@gmail.com>
e51a888 to
f413d0d
Compare
|
Rebased on master (081bd75) to resolve an import conflict in Local checks on the rebased commit f413d0d:
In the first controller run, the new spec "Should delete the PodGroup when the TrainJob reaches the Failed condition" failed once because the TrainJob webhook did not find the TrainingRuntime yet. It passed in two more full runs and ten focused runs, on this branch and on master. Not tested on a cluster. Could a maintainer approve the workflow runs so CI can run? The PR fixes the pod counts of the built-in deepspeed-distributed and mlx-distributed runtimes when |
What this PR does / why we need it:
The runtime
mlPolicy.numNodesis stored in the count of the PodSet labeled as the trainer ancestor. In the built-indeepspeed-distributedandmlx-distributedruntimes that is the launcher, and the MPI plugin only updates thenodecount when the TrainJob setsnumNodes. With runtimenumNodesgreater than 1, the launcher Job gotnumNodespods and the launcher endpoints were added to the hostfile. Details and a table of results are in #4210.EnforceMLPolicynow:numNodeswhen set, and otherwise the trainer PodSet count (the runtimenumNodes),nodecount from that value,max(numNodes - 1, 1)withrunLauncherAsNodeandnumNodesotherwise, as described indocs/operator-guides/migration.md,For the shipped runtimes with the default
numNodes: 1the generated objects do not change, with or without the TrainJobnumNodes.One behavior change: for a runtime that labels
nodeas the trainer ancestor, withrunLauncherAsNode: trueand runtimenumNodesgreater than 1, a TrainJob withoutnumNodesnow getsnumNodes - 1node pods instead ofnumNodes, so the launcher counts as a node like it does for the TrainJob value.Relationship to #4045 (#3954): that PR changes the lower bound of
max(numNodes - 1, 1)to 0 for an explicitnumNodes: 1. This PR does not change the bound, and the new tests do not depend on it. The two touch the same lines inEnforceMLPolicy, so whichever merges second needs a small rebase. I checked locally that both changes together pass the tests in this PR. With both, a TrainJob withoutnumNodeson the default runtime also runs launcher only.Testing (rebased on master at c53a08e, which includes #4029):
TestMPIRuntimePodCountsinpkg/runtime/corebuilds the objects frommanifests/base/runtimes/deepspeed_distributed.yamlandmlx_distributed.yamland checks the Job parallelism and hostfile entries. On master 6 of the 10 cases fail, for example"launcher": 3instead of 1. All pass with this change.TestEnforceMLPolicyPodSetCountsin the MPI plugin covers runtimes that labelnodeas the trainer ancestor. On master therunLauncherAsNodecase fails withnode=3, want 2.OMPI_MCA_*andPRTE_MCA_*env vars generated for the shipped runtimes are the same as on master.make testpackage list pass (24 packages).ginkgo ./test/integration/..., envtest 1.37.0): controller 51/51, statusserver 5/5, webhooks 83/83.go vetandgofmtreport no issues, golangci-lint v2.14.0 reports 0 issues.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:
Assisted-by: Claude Code