Skip to content
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

KEP-2170: Implement MPI Plugin for Kubeflow Trainer #2394

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

andreyvelich
Copy link
Member

@andreyvelich andreyvelich commented Jan 21, 2025

Fixes: #2290, #2217

This is initial implementation of MPI Plugin for Kubeflow Trainer.
I am using the similar approach to generate SSH keys and ConfigMap as in MPI-Operator.

This PR will only add support for OpenMPI.

List of items for the followup PRs:

/cc @kubeflow/wg-training-leads @Electronic-Waste @astefanutti @tenzen-y @deepanker13 @seanlaii @saileshd1402 @kannon92 @kuizhiqing @shravan-achar @akshaychitneni @helenxie-bit @franciscojavierarceo @alculquicondor @roteme-runai @mchmarny @mlsorensen

Copy link

@andreyvelich: GitHub didn't allow me to request PR reviews from the following users: seanlaii, roteme-runai, astefanutti, shravan-achar, kannon92, mlsorensen, saileshd1402, akshaychitneni, mchmarny.

Note that only kubeflow members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

Fixes: #2290, #2217

This is initial implementation of MPI Plugin for Kubeflow Trainer.
I am using the similar approach to generate SSH keys and ConfigMap as in MPI-Operator.

This PR will only add support for OpenMPI.

TODO list:

/cc @kubeflow/wg-training-leads @Electronic-Waste @astefanutti @tenzen-y @deepanker13 @seanlaii @saileshd1402 @kannon92 @kuizhiqing @shravan-achar @akshaychitneni @helenxie-bit @franciscojavierarceo @alculquicondor @roteme-runai @mchmarny @mlsorensen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Member

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

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

Is there anything we can reuse from kubeflow/mpi-operator?

@andreyvelich
Copy link
Member Author

Is there anything we can reuse from kubeflow/mpi-operator?

Yes, we are going to use the base images from mpi-operator to start OpenSSH server on the Trainer Nodes: https://github.com/kubeflow/mpi-operator/blob/master/build/base/Dockerfile.

I don't want to re-use the Go assets from the mpi-operator, since our Go module will get additional dependencies in that case.

Copy link

[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 ask for approval from andreyvelich. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

Signed-off-by: Andrey Velichkevich <[email protected]>
Signed-off-by: Andrey Velichkevich <[email protected]>
@andreyvelich andreyvelich changed the title [WIP] KEP-2170: Implement MPI Plugin for Kubeflow Trainer KEP-2170: Implement MPI Plugin for Kubeflow Trainer Feb 12, 2025
@andreyvelich
Copy link
Member Author

We discussed with @tenzen-y that we implement remaining items for MPI plugin in the followup PRs.

Signed-off-by: Andrey Velichkevich <[email protected]>
Copy link
Member

@Electronic-Waste Electronic-Waste left a comment

Choose a reason for hiding this comment

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

Basically LGTM. Just some small questions for you @andreyvelich

@@ -528,11 +530,12 @@ func TestWatchExtensionPlugins(t *testing.T) {
registry fwkplugins.Registry
wantPlugins []framework.WatchExtensionPlugin
}{
"coscheding and jobset are performed": {
"coscheding, jobset, and mpi are performed": {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"coscheding, jobset, and mpi are performed": {
"coscheduling, jobset, and mpi are performed": {

A small typo error.

type ComponentBuilderPlugin interface {
Plugin
Build(ctx context.Context, runtimeJobTemplate client.Object, info *runtime.Info, trainJob *trainer.TrainJob) (client.Object, error)
Build(ctx context.Context, runtimeJobTemplate client.Object, info *runtime.Info, trainJob *trainer.TrainJob) ([]client.Object, error)
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need to change it to slice type?

// Update envs for Info object.
// TODO (andreyvelich): Add validation to check that TrainJob doesn't have MPI envs.
// TODO (andreyvelich): We should validate that envs from different plugins don't conflict with each other.
// Ref: https://github.com/kubeflow/training-operator/pull/2308#discussion_r1823229940
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Ref: https://github.com/kubeflow/training-operator/pull/2308#discussion_r1823229940
// Ref: https://github.com/kubeflow/trainer/pull/2308#discussion_r1823229940

Comment on lines 215 to 217
// Update values from the Info object.
// Update the env variables.
if info.Trainer.Env != nil {
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 combine these two comments into one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KEP-2170: Implement Job Pipeline Framework plugins
3 participants