Skip to content

Store the TrainingRuntime numNodes as runtime.Info.PodSet.Count #2539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 18, 2025

Conversation

tenzen-y
Copy link
Member

@tenzen-y tenzen-y commented Mar 18, 2025

What this PR does / why we need it:
I replaced the runtime.Info.RuntimePolicy.MLPolicy with runtime.Info.RuntimePolicy.MLPolicySource so that we can store all rJob numNodes to runtime.Info.TemplateSpec.PodSet.Count.

Previously, we stored the non-Trainer numNodes to runtime.Info.TemplateSpec.PodSet.Count and stored the Trainer numNodes to runtime.Info.RuntimePolicy.MLPolicy.NumNodes, which introduce internal data structure fragmentation.

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: #2495

Checklist:

  • Docs included if any changes are user facing

@tenzen-y
Copy link
Member Author

/assign @kubeflow/wg-training-leads @astefanutti

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
@tenzen-y tenzen-y force-pushed the use-count-as-podset branch from 1556321 to bcbe608 Compare March 18, 2025 14:44
Copy link
Member

@andreyvelich andreyvelich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for updating this @tenzen-y!

if trainJob.Spec.Trainer != nil && trainJob.Spec.Trainer.NumNodes != nil {
numNodes = trainJob.Spec.Trainer.NumNodes
info.FindPodSetByName(constants.JobTrainerNode).Count = trainJob.Spec.Trainer.NumNodes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we are going to switch to the model with trainjob-ancestor-step label, how are we going to find the appropriate PodSet ?
I guess, we still have to add ReplicatedJob name to the PodSet Pod name, but for MPI, we should assign count=NumNodes-1 for Node ReplicatedJob, right ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can just add Ancestor field to PodSet.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally, PodSet.Name represnts rJob name.

@@ -50,7 +49,7 @@ type Info struct {
}

type RuntimePolicy struct {
MLPolicy *trainer.MLPolicy
MLPolicySource *trainer.MLPolicySource
PodGroupPolicy *trainer.PodGroupPolicy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we rename it for PodGroupPolicySource for consistency ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, you're right

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, I think this PodGroupPolicy should be fine since this MLPolicySource introduction is the reason for dropping numNodes.

So, currently, I think this PodGroupPolicy should be fine, IMO

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see

Copy link
Member

@andreyvelich andreyvelich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @tenzen-y!
Feel free to unhold
/lgtm
/approve
/hold

Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andreyvelich

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

The pull request process is described here

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

@tenzen-y
Copy link
Member Author

Thank you @tenzen-y! Feel free to unhold /lgtm /approve /hold

Thank you.
/hold cancel

@google-oss-prow google-oss-prow bot merged commit 356aebe into kubeflow:master Mar 18, 2025
15 checks passed
@tenzen-y tenzen-y deleted the use-count-as-podset branch March 18, 2025 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants