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

feat(sdk): support dynamic machine type parameters in pipeline task setters #11097

Merged
merged 55 commits into from
Sep 20, 2024

Conversation

KevinGrantLee
Copy link
Contributor

@KevinGrantLee KevinGrantLee commented Aug 13, 2024

Description of your changes:

Enables dynamic values for cpu_limit, cpu_request, memory_limit, memory_request, accelerator_type, accelerator_limit.

Enables pipelines like

@dsl.component
def cpu_limit() -> str:
    return '4000m'

@dsl.component
def sum_numbers(a: int, b:int) -> int:
    return a + b


@dsl.pipeline
def pipeline(
):
    sum_numbers_task = sum_numbers(a=1, b=2)
    sum_numbers_task.set_cpu_limit(cpu_limit().output)

Checklist:

@KevinGrantLee KevinGrantLee changed the title feat(components): support dynamic machine fields for pipeline task containers feat(components): support dynamic machine type parameters in pipeline task setters Aug 13, 2024
@KevinGrantLee KevinGrantLee requested review from chensun and removed request for zijianjoy and gregsheremeta August 13, 2024 17:42
@KevinGrantLee KevinGrantLee marked this pull request as draft August 13, 2024 18:06
@KevinGrantLee KevinGrantLee removed the request for review from chensun August 13, 2024 18:06
@KevinGrantLee
Copy link
Contributor Author

KevinGrantLee commented Aug 13, 2024

Tests succeed locally, but fail here. Need to release new kfp-pipeline-spec to pass tests. Also wait for backend changes to roll to prod.

@gregsheremeta
Copy link
Contributor

Nice! Is there an open issue for this by any chance? I see it's related to your previous work on this.

@KevinGrantLee
Copy link
Contributor Author

Marking this as draft so we don't accidentally merge it before backend changes are ready. But code is ready to be reviewed.

Hi Mark, I don't believe we have an open issue for this.

@convect-bot
Copy link

Tests succeed locally, but fail here. Need to release new kfp-pipeline-spec to pass tests. Also wait for backend changes to roll to prod.

So given your current sdk modification, can the generate pipeline yaml be run successfully with the current kfp server( version=2.2.0)? or need to adjust the kfp server in order to run the pipeline?

This feasture is needed in our project, since it seems that v2 remove the original support for handle pipeline parameters for setup resource limit.

Thanks a lot!

@KevinGrantLee
Copy link
Contributor Author

Backend changes are rolled out. Still need to wait for kfp-pipeline-spec release.

@KevinGrantLee
Copy link
Contributor Author

Hi @convect-bot , yes this sdk change will be able to be run with the current kfp server version. However, you will need to install the next version of kfp-pipeline-spec https://pypi.org/project/kfp-pipeline-spec/ once it is released.

@KevinGrantLee KevinGrantLee marked this pull request as ready for review September 12, 2024 00:26
Copy link
Member

@chensun chensun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Thank you, @KevinGrantLee !

Copy link

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit 94b1a0d into master Sep 20, 2024
26 checks passed
@google-oss-prow google-oss-prow bot deleted the task-setters branch September 20, 2024 16:26
@gregsheremeta
Copy link
Contributor

merging master into your branch resulted in your PR having 33 contributors 😂

94b1a0d

weird eh?

@chensun have you seen that before? How do we avoid that kind of thing?

chensun pushed a commit to chensun/pipelines that referenced this pull request Sep 20, 2024
…etters (kubeflow#11097)

* temp title: change title

Signed-off-by: KevinGrantLee <[email protected]>
@chensun
Copy link
Member

chensun commented Sep 20, 2024

merging master into your branch resulted in your PR having 33 contributors 😂

94b1a0d

weird eh?

@chensun have you seen that before? How do we avoid that kind of thing?

Fixed that (kind of, now I'm the additional co-author as I had to rewrite and reorder the commits).

I definitely saw this in the past as well. I think rebase after pull can definitely avoid this, although there might be more work for the authors in some cases. Maybe PR reviewers can ask author to rebase if we think avoiding this is necessary?

@HumairAK
Copy link
Collaborator

Yeah I think it's good form to just have the author rebase and keep the commits clean in the PR (reviewers and approvers should keep the author honest here)
The approver could squash/rebase/clean up, but then they will end up being co-author. Better to just have the author do it if feasible and non urgent.

@gregsheremeta
Copy link
Contributor

+1 to asking author to rebase

zed546213 pushed a commit to zed546213/pipelines that referenced this pull request Sep 23, 2024
…etters (kubeflow#11097)

* temp title: change title

Signed-off-by: KevinGrantLee <[email protected]>
Signed-off-by: zed546213 <[email protected]>
VaniHaripriya pushed a commit to VaniHaripriya/data-science-pipelines that referenced this pull request Oct 1, 2024
…etters (kubeflow#11097)

* temp title: change title

Signed-off-by: KevinGrantLee <[email protected]>
@HumairAK HumairAK modified the milestones: KFP 2.4.0, KFP SDK 2.10 Oct 8, 2024
boarder7395 pushed a commit to boarder7395/pipelines that referenced this pull request Oct 17, 2024
…etters (kubeflow#11097)

* temp title: change title

Signed-off-by: KevinGrantLee <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.