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 dsl.ParallelFor over list of Artifacts #10441

Merged

Conversation

KevinGrantLee
Copy link
Contributor

Description of your changes:

This PR adds support over dsl.ParallelFor over tasks that output lists of artifacts.

ex.

@dsl.component
def make_artifacts(...) -> List[Artifact]
    ...

@dsl.pipeline
def my_pipeline:
    make_artifacts_task = make_artifacts()
    with dsl.ParallelFor(items=make_artifacts_task.output) as item:
        print_artifact_name(var_artifact=item)

This PR does not support dsl.ParallelFor over a raw list of Artifacts.

Checklist:

@KevinGrantLee KevinGrantLee marked this pull request as ready for review January 30, 2024 00:41
sdk/RELEASE.md Outdated Show resolved Hide resolved
sdk/python/kfp/compiler/compiler_test.py Outdated Show resolved Hide resolved
sdk/python/kfp/dsl/tasks_group.py Show resolved Hide resolved
sdk/python/kfp/dsl/tasks_group.py Outdated Show resolved Hide resolved
sdk/python/kfp/dsl/pipeline_channel.py Outdated Show resolved Hide resolved
sdk/python/kfp/compiler/pipeline_spec_builder.py Outdated Show resolved Hide resolved
sdk/python/kfp/compiler/pipeline_spec_builder.py Outdated Show resolved Hide resolved
sdk/python/kfp/dsl/for_loop.py Outdated Show resolved Hide resolved
sdk/python/kfp/dsl/for_loop.py Outdated Show resolved Hide resolved
sdk/python/kfp/dsl/for_loop.py Outdated Show resolved Hide resolved
sdk/python/kfp/dsl/pipeline_channel.py Outdated Show resolved Hide resolved
sdk/python/kfp/dsl/tasks_group.py Outdated Show resolved Hide resolved
sdk/python/kfp/compiler/pipeline_spec_builder.py Outdated Show resolved Hide resolved
sdk/python/kfp/compiler/pipeline_spec_builder.py Outdated Show resolved Hide resolved
sdk/python/kfp/dsl/types/type_annotations.py Outdated Show resolved Hide resolved
sdk/python/kfp/dsl/for_loop.py Outdated Show resolved Hide resolved
@google-oss-prow google-oss-prow bot removed the approved label Feb 6, 2024
Copy link

@KevinGrantLee: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
kfp-kubernetes-execution-tests d367372 link false /test kfp-kubernetes-execution-tests

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Copy link
Member

@connor-mccarthy connor-mccarthy left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Thank you, Kevin!

@google-oss-prow google-oss-prow bot added the lgtm label Feb 6, 2024
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: connor-mccarthy

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 b528568 into kubeflow:master Feb 6, 2024
27 of 28 checks passed
@KevinGrantLee KevinGrantLee deleted the parallelfor-list-artifacts branch February 6, 2024 23:04
roytman pushed a commit to roytman/pipelines that referenced this pull request Feb 14, 2024
…0441)

* samples message

* update pr number

* Split LoopArgument into LoopParameterArgument and LoopArtifactArgument

* formatting

* address some comments

* resolve release notes conflict

* flatten loops in pipeline_spec_builder

* update artifact type checking logic

* simplify artifact checking logic

* re-add issubtype_of_artifact

* move name_is_loop_argument to for_loop_test.py

* simplify LoopArtifactArgument is_artifact_list=False logic

* update typeerror

* typo

* typo

* small fix

* formatting

* formatting

* remove issubtype_of_artifact()

* small changes

* assert LoopArtifactArgument channel.is_artifact_list is True

* remove whitespace

* remove newline

* Update single artifact check and error message

* formatting

* add unit test for is_artifact_list==False

* formatting

* update valueerror test.

* typo

* regex formatting

* formatting

Signed-off-by: Alexey Roytman <roytman@il.ibm.com>
stijntratsaertit pushed a commit to stijntratsaertit/kfp that referenced this pull request Feb 16, 2024
…0441)

* samples message

* update pr number

* Split LoopArgument into LoopParameterArgument and LoopArtifactArgument

* formatting

* address some comments

* resolve release notes conflict

* flatten loops in pipeline_spec_builder

* update artifact type checking logic

* simplify artifact checking logic

* re-add issubtype_of_artifact

* move name_is_loop_argument to for_loop_test.py

* simplify LoopArtifactArgument is_artifact_list=False logic

* update typeerror

* typo

* typo

* small fix

* formatting

* formatting

* remove issubtype_of_artifact()

* small changes

* assert LoopArtifactArgument channel.is_artifact_list is True

* remove whitespace

* remove newline

* Update single artifact check and error message

* formatting

* add unit test for is_artifact_list==False

* formatting

* update valueerror test.

* typo

* regex formatting

* formatting
petethegreat pushed a commit to petethegreat/pipelines that referenced this pull request Mar 27, 2024
…0441)

* samples message

* update pr number

* Split LoopArgument into LoopParameterArgument and LoopArtifactArgument

* formatting

* address some comments

* resolve release notes conflict

* flatten loops in pipeline_spec_builder

* update artifact type checking logic

* simplify artifact checking logic

* re-add issubtype_of_artifact

* move name_is_loop_argument to for_loop_test.py

* simplify LoopArtifactArgument is_artifact_list=False logic

* update typeerror

* typo

* typo

* small fix

* formatting

* formatting

* remove issubtype_of_artifact()

* small changes

* assert LoopArtifactArgument channel.is_artifact_list is True

* remove whitespace

* remove newline

* Update single artifact check and error message

* formatting

* add unit test for is_artifact_list==False

* formatting

* update valueerror test.

* typo

* regex formatting

* formatting
petethegreat pushed a commit to petethegreat/pipelines that referenced this pull request Mar 29, 2024
…0441)

* samples message

* update pr number

* Split LoopArgument into LoopParameterArgument and LoopArtifactArgument

* formatting

* address some comments

* resolve release notes conflict

* flatten loops in pipeline_spec_builder

* update artifact type checking logic

* simplify artifact checking logic

* re-add issubtype_of_artifact

* move name_is_loop_argument to for_loop_test.py

* simplify LoopArtifactArgument is_artifact_list=False logic

* update typeerror

* typo

* typo

* small fix

* formatting

* formatting

* remove issubtype_of_artifact()

* small changes

* assert LoopArtifactArgument channel.is_artifact_list is True

* remove whitespace

* remove newline

* Update single artifact check and error message

* formatting

* add unit test for is_artifact_list==False

* formatting

* update valueerror test.

* typo

* regex formatting

* formatting
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.

2 participants