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

dsl.graph_component does not honor named arguments, resulting wrong params #3915

Closed
hlu09 opened this issue Jun 4, 2020 · 1 comment · Fixed by #4082
Closed

dsl.graph_component does not honor named arguments, resulting wrong params #3915

hlu09 opened this issue Jun 4, 2020 · 1 comment · Fixed by #4082
Assignees
Labels
area/sdk help wanted The community is welcome to contribute. kind/bug status/triaged Whether the issue has been explicitly triaged

Comments

@hlu09
Copy link
Contributor

hlu09 commented Jun 4, 2020

What steps did you take:

The code below results in correct recursive call, "count" and "limit" gets the correct arguments. However, by switching the order of "count" and "limit", the 2nd call to increment_component has the wrong arguments.

-----------this works-----------------

@dsl.graph_component
def increment_component(count, limit):
    sleep = sleep_op(5)
    increment = increment_op(count).after(sleep)
    with dsl.Condition(increment.output <= limit):
        increment_component(
            count=increment.output,
            limit=limit,
        )

-----------its YAML------------------

      - name: graph-increment-component-1
        template: graph-increment-component-1
        arguments:
          parameters:
          - {name: increment-input-count-count, value: '{{inputs.parameters.increment-input-count-2-count}}'}
          - {name: limit, value: '{{inputs.parameters.limit}}'}

-----------this does NOT works-----------------

@dsl.graph_component
def increment_component(count, limit):
    sleep = sleep_op(5)
    increment = increment_op(count).after(sleep)
    with dsl.Condition(increment.output <= limit):
        increment_component(
            limit = limit,
            count = increment.output,
        )

-----------its YAML------------------

      - name: graph-increment-component-1
        template: graph-increment-component-1
        arguments:
          parameters:
          - {name: increment-input-count-count, value: '{{inputs.parameters.limit}}'}
          - {name: limit, value: '{{inputs.parameters.increment-input-count-2-count}}'}

What did you expect to happen:

KFP compiler should honor named arguments.

Environment:

https://storage.googleapis.com/ml-pipeline/release/0.5.1/kfp.tar.gz

@rmgogogo rmgogogo added kind/bug area/sdk status/triaged Whether the issue has been explicitly triaged help wanted The community is welcome to contribute. labels Jun 5, 2020
@Ark-kun Ark-kun self-assigned this Jun 25, 2020
@Ark-kun
Copy link
Contributor

Ark-kun commented Jun 25, 2020

Thank you for your patience. I somehow missed this issue. (@rmgogogo Please feel free to assign most SDK-related issues to me, especially component-related.)
Investigating...

P.S. JFYI: The @dsl.graph_component feature is related to the create_graph_component_from_pipeline_func function only in the general idea (designating a sub-graph). In the future, there will be more coordination between them, but for now they're pretty separate and have different responsibilities.

Ark-kun added a commit to Ark-kun/pipelines that referenced this issue Jun 25, 2020
Ark-kun added a commit to Ark-kun/pipelines that referenced this issue Jun 28, 2020
pull bot pushed a commit to xiaohanhuang/pipelines that referenced this issue Jun 29, 2020
…graph_component. Fixes kubeflow#3915 (4082)

* SDK - Compiler - Fixed the input argument mapping when using dsl.graph_component

Fixes kubeflow#3915

* Stopped relying on the argument order at all

This can make the compilation less fragile.
k8s-ci-robot pushed a commit that referenced this issue Jun 29, 2020
…graph_component. Fixes #3915 (4082)

* SDK - Compiler - Fixed the input argument mapping when using dsl.graph_component

Fixes #3915

* Stopped relying on the argument order at all

This can make the compilation less fragile.
Jeffwan pushed a commit to Jeffwan/pipelines that referenced this issue Dec 9, 2020
…graph_component. Fixes kubeflow#3915 (4082)

* SDK - Compiler - Fixed the input argument mapping when using dsl.graph_component

Fixes kubeflow#3915

* Stopped relying on the argument order at all

This can make the compilation less fragile.
Jeffwan pushed a commit to Jeffwan/pipelines that referenced this issue Dec 9, 2020
…graph_component. Fixes kubeflow#3915 (4082)

* SDK - Compiler - Fixed the input argument mapping when using dsl.graph_component

Fixes kubeflow#3915

* Stopped relying on the argument order at all

This can make the compilation less fragile.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sdk help wanted The community is welcome to contribute. kind/bug status/triaged Whether the issue has been explicitly triaged
Projects
None yet
3 participants