pipelines icon indicating copy to clipboard operation
pipelines copied to clipboard

[bug] Nested pipelines fail to run

Open JosepSampe opened this issue 1 year ago • 10 comments

I'm trying to run the "Pipelines as Components" example from the documentation, but it seems I'm not able to run it successfully. it always compile, but it always produces an error after the subpipeline is executed properly. Looking at the logs of the pod that produces the error, I can see:

driver.DAG(pipelineName=superpipeline, runID=525fd190-491a-42c1-9558-65772a931637, task="square-and-multiply", component="comp-square-and-multiply", dagExecutionID=237, componentSpec) failed: failed to resolve inputs: resolving input parameter a with spec task_output_parameter:{producer_task:"square-and-sum" output_parameter_key:"Output"}: cannot find output parameter key "Output" in producer task "square-and-sum"

Is there a different way to access the output of a "pipeline as component"?

Environment

Using a kind cluster created with: kind create cluster --name kfp

  • How do you deploy Kubeflow Pipelines (KFP)?
export PIPELINE_VERSION=2.0.1
kubectl apply -k "github.com/kubeflow/pipelines/manifests/kustomize/cluster-scoped-resources?ref=$PIPELINE_VERSION"
kubectl wait --for condition=established --timeout=60s crd/applications.app.k8s.io
kubectl apply -k "github.com/kubeflow/pipelines/manifests/kustomize/env/dev?ref=$PIPELINE_VERSION"
  • KFP version: 2.0.1
  • KFP SDK version: kfp 2.2.0 kfp-pipeline-spec 0.2.2 kfp-server-api 2.0.1

Steps to reproduce

from kfp import dsl
from kfp.client import Client

@dsl.component
def square(x: float) -> float:
    return x ** 2

@dsl.component
def add(x: float, y: float) -> float:
    return x + y

@dsl.component
def square_root(x: float) -> float:
    return x ** .5

@dsl.pipeline
def square_and_sum(a: float, b: float) -> float:
    a_sq_task = square(x=a)
    b_sq_task = square(x=b)
    return add(x=a_sq_task.output, y=b_sq_task.output).output

@dsl.pipeline
def pythagorean(a: float = 1.2, b: float = 1.2) -> float:
    sq_and_sum_task = square_and_sum(a=a, b=b)
    return square_root(x=sq_and_sum_task.output).output


if __name__ == "__main__":
    client = Client()

    run = client.create_run_from_pipeline_func(
        pipeline_func=pythagorean,
        experiment_name="pythagorean-2",
        enable_caching=False,
        arguments={
            'a': 3.5,
            'b': 4.5,
        },
        run_name="pythagorean-run-3"
    )

I also tried to explicitly access the output with

return square_root(x=sq_and_sum_task.outputs['Output']).output

but I get the same error

Expected result

Successfull execution

Materials and reference

Labels


Impacted by this bug? Give it a 👍.

JosepSampe avatar Sep 27 '23 15:09 JosepSampe

/assign @chensun

zijianjoy avatar Oct 05 '23 22:10 zijianjoy

I can reproduce this, looks like a backend bug.

chensun avatar Oct 12 '23 22:10 chensun

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Jan 11 '24 07:01 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Mar 26 '24 07:03 github-actions[bot]

This issue has been automatically closed because it has not had recent activity. Please comment "/reopen" to reopen it.

github-actions[bot] avatar Apr 16 '24 07:04 github-actions[bot]

I'm still seeing this issue on kfp 2.7, anyone else? @JosepSampe @chensun

KyleKaminky avatar May 16 '24 17:05 KyleKaminky

/reopen

KyleKaminky avatar May 16 '24 18:05 KyleKaminky

@KyleKaminky: You can't reopen an issue/PR unless you authored it or you are a collaborator.

In response to this:

/reopen

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-sigs/prow repository.

google-oss-prow[bot] avatar May 16 '24 18:05 google-oss-prow[bot]

/reopen

JosepSampe avatar May 16 '24 18:05 JosepSampe

@JosepSampe: Reopened this issue.

In response to this:

/reopen

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-sigs/prow repository.

google-oss-prow[bot] avatar May 16 '24 18:05 google-oss-prow[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Jul 17 '24 07:07 github-actions[bot]

This issue has been automatically closed because it has not had recent activity. Please comment "/reopen" to reopen it.

github-actions[bot] avatar Aug 08 '24 07:08 github-actions[bot]