-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat(sdk): Allow disabling default caching via a CLI flag and env var #11222
feat(sdk): Allow disabling default caching via a CLI flag and env var #11222
Conversation
c305fa5
to
b4b38ae
Compare
…a compiler CLI flag and env var Co-authored-by: Greg Sheremeta <[email protected]> Signed-off-by: ddalvi <[email protected]>
fa7a432
to
626e1c1
Compare
/hold |
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.
Wrote my thoughts on this PR as a general feedback without explicit approval.
d85943b
to
ad89b3e
Compare
Signed-off-by: ddalvi <[email protected]>
ad89b3e
to
69f35d8
Compare
/lgtm Despite having a different opinion about how this can be implemented, I support this PR |
/unhold |
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
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chensun 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 |
…kubeflow#11222) * feat(sdk): Allow setting a default of execution caching disabled via a compiler CLI flag and env var Co-authored-by: Greg Sheremeta <[email protected]> Signed-off-by: ddalvi <[email protected]> * Add tests for disabling default caching var and flag Signed-off-by: ddalvi <[email protected]> --------- Signed-off-by: ddalvi <[email protected]> Co-authored-by: Greg Sheremeta <[email protected]>
Description of your changes:
Allow setting a default of execution caching disabled via a compiler CLI flag and env var.
Resolves #11092
Key Changes:
CLI Update (kfp dsl compile):
A new flag
--disable-execution-caching-by-default
is added. When set, this flag disables caching for all pipeline tasks by default. Behavior specified in pipeline code still takes precedence.A corresponding Environment Variable
KFP_DISABLE_EXECUTION_CACHING_BY_DEFAULT
is added as well.Details:
By default, tasks default to caching enabled if the pipeline code doesn't specify a desired behavior via set_caching_options. For example:
In this example, task 1 won't try to use the cache, but task 2 will, even though the author didn't specify anything about task 2. The resulting pipeline spec will look like this:
This PR enhances the DSL compiler to allow the user to override that default behavior via a command line flag. This change is done:
in an additive way, using an optional feature flag
in a way that doesn't alter the DSL or pipeline spec interfaces
In a way that doesn't change the default behavior for those who prefer the default of caching enabled
After this change, this command will continue to result in the default behavior:
Whereas this command will cause tasks to default to caching disabled if no desired caching behavior is specified in code:
For example, this pipeline compiled with
--disable-execution-caching-by-default
would then result in both tasks having caching disabled:
even though nothing was specified about task_2 in the code.
Usage
CLI flag for dsl compile.
A new flag
--disable-execution-caching-by-default
is added. When set, this flag disables caching for all pipeline tasks by default.Example:
Environment Variable
KFP_DISABLE_EXECUTION_CACHING_BY_DEFAULT
.You can also set the default caching behavior by using the environment variable. When set to true, 1, or other truthy values, it will disable execution caching by default for all pipelines. When set to false or when absent, the default of caching enabled remains.
Example:
This environment variable also works for
Compiler().compile()
.Given the following pipeline file my_pipeline.py:
Executing this
will result in task_2 having caching disabled.
This PR is made in collaboration with @gregsheremeta. Thank you, Greg for your contributions!
Checklist: