-
Notifications
You must be signed in to change notification settings - Fork 459
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
[GSoC] Add unit tests for tune
API
#2423
[GSoC] Add unit tests for tune
API
#2423
Conversation
Signed-off-by: helenxie-bit <helenxiehz@gmail.com>
/area gsoc |
Ref: #2339 |
Signed-off-by: helenxie-bit <helenxiehz@gmail.com>
tune
APItune
API
Signed-off-by: helenxie-bit <helenxiehz@gmail.com>
Signed-off-by: helenxie-bit <helenxiehz@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for doing this @helenxie-bit!
Signed-off-by: helenxie-bit <helenxiehz@gmail.com>
Signed-off-by: helenxie-bit <helenxiehz@gmail.com>
Signed-off-by: helenxie-bit <helenxiehz@gmail.com>
Signed-off-by: helenxie-bit <helenxiehz@gmail.com>
Signed-off-by: helenxie-bit <helenxiehz@gmail.com>
Signed-off-by: helenxie-bit <helenxiehz@gmail.com>
tune
APItune
API
Signed-off-by: helenxie-bit <helenxiehz@gmail.com>
@andreyvelich The unit test for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for doing this @helenxie-bit!
/assign @tenzen-y @johnugeorge @deepanker13 @droctothorpe @Electronic-Waste
Signed-off-by: helenxie-bit <helenxiehz@gmail.com>
Signed-off-by: helenxie-bit <helenxiehz@gmail.com>
@Electronic-Waste Thank you so much for your suggestions! I have incorporated your advice into the UTs. |
…ing[huggingface' into dependencies Signed-off-by: helenxie-bit <helenxiehz@gmail.com>
Signed-off-by: helenxie-bit <helenxiehz@gmail.com>
@andreyvelich I’ve added the
Additionally, I have added verification for the experiment object in two valid flow cases in the following section: katib/sdk/python/v1beta1/kubeflow/katib/api/katib_client_test.py Lines 587 to 639 in b24b44f
Please review when you have time. Thanks! |
@andreyvelich Please review this PR when you have time 👀. I'll adjust the e2e tests for the tune API after this PR is merged, as it fixes some small bugs in the tune API. |
Since @mahdikhashan is currently working on the notebook with instructions for this API, and this PR also includes some bug fixes for the API, @andreyvelich, would it be better to separate the bug fixes into a standalone PR to make the review process more convenient? Please let me know your thoughts. |
Sure, please create separate PR for the bug fixes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically LGTM! I left a few comments concerned with objective_metric_name
for you.
Thanks for your great contribution! @helenxie-bit
if test_name == "valid flow with custom objective tuning": | ||
# Verify input_params | ||
args_content = "".join( | ||
experiment.spec.trial_template.trial_spec.spec.template.spec.containers[ | ||
0 | ||
].args | ||
) | ||
assert "'a': '${trialParameters.a}'" in args_content | ||
# Verify trial_params | ||
assert experiment.spec.trial_template.trial_parameters == [ | ||
V1beta1TrialParameterSpec(name="a", reference="a"), | ||
] | ||
# Verify experiment_params | ||
assert experiment.spec.parameters == [ | ||
V1beta1ParameterSpec( | ||
name="a", | ||
parameter_type="int", | ||
feasible_space=V1beta1FeasibleSpace(min="10", max="100"), | ||
), | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better if we also verify the objective_metric_name
parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your suggestions! I will add that.
Signed-off-by: helenxie-bit <helenxiehz@gmail.com>
Signed-off-by: helenxie-bit <helenxiehz@gmail.com>
Signed-off-by: helenxie-bit <helenxiehz@gmail.com>
Signed-off-by: helenxie-bit <helenxiehz@gmail.com>
Signed-off-by: helenxie-bit <helenxiehz@gmail.com>
/rerun-all |
@andreyvelich @Electronic-Waste This PR is ready for review. But I'm not sure why the ci test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for your great contribution! As for the CI error, it occurred occasionally. You could rerun it after a while:)
/lgtm
/rerun-all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this great contribution @helenxie-bit!
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andreyvelich, Electronic-Waste 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 |
* add unit tests for tune api Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * update Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * fix format Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * update unit tests and fix api errors Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * fix format Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * test Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * test Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * update unit tests Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * undo changes to Makefile Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * delete debug code Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * fix format Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * update unit test Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * fix format Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * update the version of training operator Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * adjust 'list_namespaced_persistent_volume_claim' to be called with keyword argument Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * create constant for namespace when check pvc creation error Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * add type check for 'trainer_parameters' Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * fix format Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * update test names Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * fix format Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * add verification for key Experiment information & add 'kubeflow-training[huggingface' into dependencies Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * rerun tests Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * add verification for objective metric name Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * delete unnecessary changes Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * unify objective function Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * unify objective function Signed-off-by: helenxie-bit <helenxiehz@gmail.com> --------- Signed-off-by: helenxie-bit <helenxiehz@gmail.com> Signed-off-by: mahdikhashan <mahdikhashan1@gmail.com>
* add unit tests for tune api Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * update Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * fix format Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * update unit tests and fix api errors Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * fix format Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * test Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * test Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * update unit tests Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * undo changes to Makefile Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * delete debug code Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * fix format Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * update unit test Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * fix format Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * update the version of training operator Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * adjust 'list_namespaced_persistent_volume_claim' to be called with keyword argument Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * create constant for namespace when check pvc creation error Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * add type check for 'trainer_parameters' Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * fix format Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * update test names Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * fix format Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * add verification for key Experiment information & add 'kubeflow-training[huggingface' into dependencies Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * rerun tests Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * add verification for objective metric name Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * delete unnecessary changes Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * unify objective function Signed-off-by: helenxie-bit <helenxiehz@gmail.com> * unify objective function Signed-off-by: helenxie-bit <helenxiehz@gmail.com> --------- Signed-off-by: helenxie-bit <helenxiehz@gmail.com> Signed-off-by: Gary Miguel <garymm@garymm.org>
What this PR does / why we need it:
This PR adds unit tests for
tune
API.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Checklist: