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

test(runtime): add UT for torch runtime valid function. #2560

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

IRONICBo
Copy link
Contributor

@IRONICBo IRONICBo commented Mar 22, 2025

What this PR does / why we need it:

Add specific UT for torch runtime Valid function.

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

Checklist:

  • Docs included if any changes are user facing

PTAL, @tenzen-y

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 assign tenzen-y for approval. 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

@coveralls
Copy link

coveralls commented Mar 22, 2025

Pull Request Test Coverage Report for Build 14072356914

Details

  • 4 of 4 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.0%) to 65.938%

Totals Coverage Status
Change from base Build 14050291148: 1.0%
Covered Lines: 1719
Relevant Lines: 2607

💛 - Coveralls

@IRONICBo IRONICBo changed the title test: add UT for torch runtime valid function. test(runtime): add UT for torch runtime valid function. Mar 22, 2025
Copy link
Member

@tenzen-y tenzen-y left a comment

Choose a reason for hiding this comment

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

Mostly, LGTM

@IRONICBo IRONICBo force-pushed the bo/test/add-ut-for-torch-runtime-valid branch 4 times, most recently from 080c566 to 3bde232 Compare March 25, 2025 08:39
@IRONICBo IRONICBo force-pushed the bo/test/add-ut-for-torch-runtime-valid branch 2 times, most recently from 00e6740 to 5a38dda Compare March 25, 2025 09:49
Comment on lines 1021 to 1025
// For no numProcPerNode UT scenario
var numProcPerNodePtr *intstr.IntOrString
if numProcPerNode != "" {
numProcPerNodePtr = ptr.To(intstr.FromString(numProcPerNode))
}
Copy link
Member

Choose a reason for hiding this comment

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

Instead of these hacking, we could use numProcPerNode as a pointer like

func (m *MLPolicySourceWrapper) TorchPolicy(numProcPerNode *intstr.IntOrString, elasticPolicy *trainer.TorchElasticPolicy) *MLPolicySourceWrapper {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I have removed it and replaced them like TorchPolicy(ptr.To(intstr.FromString("auto")), nil).

@IRONICBo IRONICBo force-pushed the bo/test/add-ut-for-torch-runtime-valid branch from 5a38dda to 56d9144 Compare March 25, 2025 23:54
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.

Implement UTs for Plugin CustomValidations
3 participants