-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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): add runtime resource requests. Fixes #1956 #5447
feat(sdk): add runtime resource requests. Fixes #1956 #5447
Conversation
/assign @hongye-sun |
Maybe you could take a look on this @Ark-kun? Thanks. |
@numerology could you please take a look? Thanks |
@Bobgy do you have the possibility to look at this? Have been hard to get a review on this one :( |
@capri-xiyue do you have the opportunity to look at this? |
This PR looks good to me. But I don't have a lot of experience on the sdk side. |
/retest |
Thanks @capri-xiyue :) |
Thank you for this PR. I've left couple of comments. |
Pushed some changes, will double check the tests as well before it is ready for a new review. |
@NikeNano is this merged to master , which version sdk i can use to get benefit of this approach |
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.
Thanks @NikeNano. Only a couple nitpicks otherwise LGTM.
The test case being added looks awesome.
.set_cpu_limit(resouce_task.outputs['cpu'])\ | ||
.set_cpu_request('200m') | ||
|
||
# Disable cache for KFP v1 mode. |
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.
nit: indentation for the comment is off.
@@ -288,6 +288,24 @@ def _op_to_template(op: BaseOp): | |||
template['volumes'] = [convert_k8s_obj_to_json(volume) for volume in processed_op.volumes] | |||
template['volumes'].sort(key=lambda x: x['name']) | |||
|
|||
# Runtime resource requests | |||
if isinstance(op, dsl.ContainerOp) and ("resources" in op.container.keys()): |
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.
nit: use consistent quotes.
/retest |
The test added in this PR failed. The error was:
|
I'm not sure if you may have access to it. Right above the call stack at the end, there's this
Open that link, you will find a failed test among a list of ParallelFor tasks.
Note that the test is v2 compatible mode in v1. I haven't debugged this, but I think the change you need would probably be in v1 compiler code. |
Will run it locally for debugging. |
After debugging this I found that the issues comes from
,
and
are removed from the generate pipeline compare to not setting I believe this is a design decision so before I run off and change something could you elaborate on what we are trying to accomplish and why we |
In v2, we use a different set of placeholders in command and arguments. For instance: pipelines/sdk/python/kfp/v2/compiler_cli_tests/test_data/two_step_pipeline.json Lines 51 to 56 in cc85ca5
I think the issue is this line: pipelines/sdk/python/kfp/dsl/_component_bridge.py Lines 620 to 621 in 703822c
I'll think about how to fix this properly. |
/lgtm |
[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 |
…ow#5447) * added resource request at runtime * fixed things * Update to use read only parameter insteadt * added test case and better example * Updated again * add the validation * add to the test suit * work in progress * update after feedback * fix the test * clean up * clean up * fix the path * add the test again * clean up * fix tests * feedback fix * comment out and clean up
Signed-off-by: NikeNano niklas.sven.hansson@gmail.com
Description of your changes:
UPDATE: linking don't seem to work, relates to: #1956
Checklist:
Do you want this pull request (PR) cherry-picked into the current release branch?
Learn more about cherry-picking updates into the release branch.