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

yaml to python sdk submission example needed #2006

Closed
dandawg opened this issue Nov 10, 2022 · 5 comments
Closed

yaml to python sdk submission example needed #2006

dandawg opened this issue Nov 10, 2022 · 5 comments

Comments

@dandawg
Copy link

dandawg commented Nov 10, 2022

/kind feature

Describe the solution you'd like
There is a need for an example that submits an Experiment YAML via the Katib SDK. I have written an example, and I plan to submit it as a PR.

My reasoning is this:

The Katib SDK exposes the power of Python programming to Katib users; however, the code structure is significantly more complex than in the case of direct YAML submission using kubectl.

In contrast, direct Katib Experiment submission via YAML offers an easy-to-read (and to maintain) structure, but it is very basic, and it lacks advantages that the SDK route provides.

There is a way to submit a YAML file by converting it to a Python dictionary and then passing it to the Katib SDK, so an example is in order.

Anything else you would like to add:
In the long run, it would be nice to have this functionality in the SDK (that is, load a YAML file, then update chosen parameters, all in an object that can be passed to create_experiment). For now, this example can help users engage easier with the SDK, especially in the case where they already have experiments defined in YAML, but want to submit via the SDK.


Love this feature? Give it a 👍 We prioritize the features with the most 👍

@dandawg
Copy link
Author

dandawg commented Nov 10, 2022

I just submitted PR #2008 to address this issue.

@johnugeorge
Copy link
Member

@dandawg Does this https://github.com/kubeflow/katib/blob/master/examples/v1beta1/sdk/tune-train-from-func.ipynb help you? It takes python function as the argument

@dandawg
Copy link
Author

dandawg commented Nov 11, 2022

That is a great example @johnugeorge ! And I'm super excited about that new tune function. I think it works great for many cases, especially where model training is not too complex, and it can fit in a python function.

I think there is still a need for the yaml route, and the example I submitted shows how to convert a yaml experiment to python, so that it can be submitted via the sdk. I was wondering if this was the right subfolder for the example though.

Longer term, it might be cool to have functions in the sdk like:
load_experiment_from_yaml # creates an experiment object
V1beta1ExperimentSpec.to_yaml(<file_path>)
create_experiment(<yaml-file>,...) # passing yaml file instead of experiment spec python object

This would mimic the create_run_from_pipeline_package function in kfp.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions
Copy link

This issue has been automatically closed because it has not had recent activity. Please comment "/reopen" to reopen it.

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

Successfully merging a pull request may close this issue.

2 participants