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

Support pipeline parameter definition by interacting with dsl.Pipeline #1942

Closed
numerology opened this issue Aug 23, 2019 · 11 comments
Closed

Comments

@numerology
Copy link

Currently the only way to define pipeline params in KFP dsl is through the signature of the pipeline function. A more systematic and dynamic way is needed to support use cases where the set of pipeline parameters are passed from external.

Example:
TFX's KFP dag runner

@numerology numerology self-assigned this Aug 23, 2019
@numerology numerology changed the title Support pipeline parameter definition through Compiler.compile() method. Support pipeline parameter definition interacting with dsl.Pipeline Sep 5, 2019
@numerology numerology changed the title Support pipeline parameter definition interacting with dsl.Pipeline Support pipeline parameter definition by interacting with dsl.Pipeline Sep 6, 2019
@merlintang
Copy link

do you mean that we can run a pipeline by passing the parameter into pipeline? for example, we load a pipeline file, then run the pipeline with new parameters? I have done this before, I can send a pr for this.

@numerology
Copy link
Author

do you mean that we can run a pipeline by passing the parameter into pipeline? for example, we load a pipeline file, then run the pipeline with new parameters? I have done this before, I can send a pr for this.

Actually a bit of different. Currently through the signature of the pipeline function, we can define pipeline parameters. However, pipeline function signature is immutable in itself. If we further need to specify the pipeline parameter (not only their runtime values) in a more programmatical way, some alternatives are needed.

@merlintang
Copy link

I see, you mean that user can add more parameters to the pipeline ?

@numerology
Copy link
Author

numerology commented Sep 10, 2019 via email

@Ark-kun
Copy link
Contributor

Ark-kun commented Sep 10, 2019

dsl.Pipeline is a context class that's supposed to be compiler-internal. We were planning to take it private.
Did you mean the dsl.pipeline decorator?

@numerology
Copy link
Author

dsl.Pipeline is a context class that's supposed to be compiler-internal. We were planning to take it private.
Did you mean the dsl.pipeline decorator?

That would be ideal if we can support that without interacting with dsl.Pipeline. However I couldn't think of an easy way to that.
If we can introduce a field to specify pipeline parameter in the decorator, still we need to think carefully how we are going to use that in each component.

@numerology
Copy link
Author

dsl.Pipeline is a context class that's supposed to be compiler-internal. We were planning to take it private.
Did you mean the dsl.pipeline decorator?

Let me give another look. I think we have some publc APIs that can be used currently. Maybe I don't need to directly manipulate dsl.Pipeline

@gaoning777
Copy link
Contributor

Are we planning to take dsl.Pipeline private? If so, why?
Exposing a Pipeline class similar to the TFX Pipeline is not a bad idea to me. Strongly typed, support dynamic parameters, dynamic pipeline configurations(

class PipelineConf():
).
Of course, having a simple interface and having the SDK generate the dsl.Pipeline is great for new users. However, exposing the full control of the Pipeline can unblock advanced users for custom scenarios.

@numerology
Copy link
Author

Are we planning to take dsl.Pipeline private? If so, why?
Exposing a Pipeline class similar to the TFX Pipeline is not a bad idea to me. Strongly typed, support dynamic parameters, dynamic pipeline configurations(

class PipelineConf():

).
Of course, having a simple interface and having the SDK generate the dsl.Pipeline is great for new users. However, exposing the full control of the Pipeline can unblock advanced users for custom scenarios.

I'm good with either private or public dsl.Pipeline. However I feel like we need a way to do something like (tentatively, did not carefully think it through)
author_pipeline(
pipeline_func, # where ContainerOp is initialized, perhaps with PipelineParam in its args.
pipeline_name,
pipeline_description,
pipeline_params)

@merlintang
Copy link

thanks @num

@numerology
Copy link
Author

Added an API in #2082, which allows users to generate the workflow spec of the pipeline in a programmable way.

Marked as fixed for now.

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

No branches or pull requests

4 participants