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

fix: support MxNet single host training when update mxJob status #1644

Merged
merged 1 commit into from
Aug 10, 2022
Merged

fix: support MxNet single host training when update mxJob status #1644

merged 1 commit into from
Aug 10, 2022

Conversation

PeterChg
Copy link
Contributor

@PeterChg PeterChg commented Aug 3, 2022

What this PR does / why we need it:

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

Checklist:

  • Docs included if any changes are user facing

@PeterChg
Copy link
Contributor Author

PeterChg commented Aug 3, 2022

/assign @terrytangyuan

@coveralls
Copy link

coveralls commented Aug 3, 2022

Pull Request Test Coverage Report for Build 2829463174

  • 0 of 17 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-5.4%) to 34.55%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/controller.v1/mxnet/mxjob_controller.go 0 17 0.0%
Totals Coverage Status
Change from base Build 2811044752: -5.4%
Covered Lines: 1164
Relevant Lines: 3369

💛 - Coveralls

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.

Why is the additional check necessary?

@PeterChg
Copy link
Contributor Author

PeterChg commented Aug 4, 2022

Why is the additional check necessary?

In order to support MxNet single host training, In this scenario, You only need to create one worker node.
Without the additional check, MxJob state management will be problematic.

@PeterChg
Copy link
Contributor Author

PeterChg commented Aug 8, 2022

/retest

@@ -336,6 +336,9 @@ func (r *MXJobReconciler) UpdateJobStatus(job interface{}, replicas map[commonv1
}
}

//check whether mxnet Single Host training
singleTraining := r.onlyHasReplicaTypeWorker(replicas)
Copy link
Member

Choose a reason for hiding this comment

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

singleHost

Copy link
Member

Choose a reason for hiding this comment

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

Please update your comment to a complete sentence

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -465,3 +468,18 @@ func (r *MXJobReconciler) onOwnerCreateFunc() func(event.CreateEvent) bool {
return true
}
}

func (r *MXJobReconciler) onlyHasReplicaTypeWorker(replicas map[commonv1.ReplicaType]*commonv1.ReplicaSpec) bool {
var workerNum, scheNum, srvNum int32 = 0, 0, 0
Copy link
Member

Choose a reason for hiding this comment

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

svrNum

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -465,3 +468,18 @@ func (r *MXJobReconciler) onOwnerCreateFunc() func(event.CreateEvent) bool {
return true
}
}

func (r *MXJobReconciler) onlyHasReplicaTypeWorker(replicas map[commonv1.ReplicaType]*commonv1.ReplicaSpec) bool {
Copy link
Member

Choose a reason for hiding this comment

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

isSingleWorker

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

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.

Thanks!

/lgtm
/approve

@google-oss-prow google-oss-prow bot added the lgtm label Aug 10, 2022
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: PeterChg, terrytangyuan

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

@google-oss-prow google-oss-prow bot merged commit be8c77b into kubeflow:master Aug 10, 2022
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.

3 participants