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

[BUG] Map_task should support launch plans, but get type errors #6236

Closed
2 tasks done
pimdh opened this issue Feb 10, 2025 · 3 comments
Closed
2 tasks done

[BUG] Map_task should support launch plans, but get type errors #6236

pimdh opened this issue Feb 10, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@pimdh
Copy link

pimdh commented Feb 10, 2025

Describe the bug

The API suggests that map_task supports a launchplan. However, if I try the following, I get typing errors:

from flytekit import LaunchPlan, map_task, task, workflow


@task
def my_task(x: int) -> int:
    return x * 2


@workflow
def my_wf(x: int) -> int:
    return my_task(x)


my_lp = LaunchPlan.create("my_lp", my_wf)


@workflow
def map_wf(nums: list[int]) -> list[int]:
    return map_task(my_lp)(x=nums)

Upon registration, I get the following errors:

        Details: failed to compile workflow for [resource_type:WORKFLOW project:"scratch" domain:"main" name:"flyte_playground.map_launchplan.map_wf" version:"767711eb9510a25f9b7512cd"] with err: Collected Errors: 2
        Error 0: Code: MismatchingTypes, Node Id: end-node, Description: The output variable 'my_lp.o0' has type [simple:INTEGER], but it's assigned to the input variable 'o0' which has type type [collection_type:{simple:INTEGER}].
        Error 1: Code: MismatchingTypes, Node Id: n0, Description: The output variable 'nums' has type [collection_type:{simple:INTEGER}], but it's assigned to the input variable 'my_lp.x' which has type type [simple:INTEGER].

May be related to #5684

Expected behavior

Should be registered fine.

Additional context to reproduce

Flytekit 1.14.6

Screenshots

No response

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@pimdh pimdh added bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers labels Feb 10, 2025
@eapolinario eapolinario self-assigned this Feb 13, 2025
@kumare3
Copy link
Contributor

kumare3 commented Feb 18, 2025

This is not a bug, This is not a supported feature in flyte. This is available in Union today - https://docs.union.ai/byoc/user-guide/core-concepts/launch-plans/mapping-over-launch-plans#mapping-over-launch-plans

Reason is, the fundamental way, launchplans are mapped over needs a large state storage system, which does not fit default array_nodes storage system. Union has a different engine, which can store data efficiently and in higher resolution, does surpassing these limits. Its a large lift to support in oss and we do not currently plan to support - but we will definitely visit this in a few months, as we upstream some of our learnings from Union.

@pimdh
Copy link
Author

pimdh commented Feb 18, 2025

Thanks for the reply!
Maybe the type hints/docstrings of map_task can be updated to reflect that launchplans are not supported?
https://docs.flyte.org/en/latest/api/flytekit/generated/flytekit.map_task.html#flytekit.map_task
Thanks again!

@eapolinario eapolinario removed the untriaged This issues has not yet been looked at by the Maintainers label Feb 20, 2025
@eapolinario
Copy link
Contributor

Coalescing the discussions about this topic in #5684.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

3 participants