GithubHelp home page GithubHelp logo

Comments (3)

dosubot avatar dosubot commented on May 20, 2024 2

Hey there, @tomtou-bspace! Great to see you back diving into the intricacies of workflow orchestration. Hope you're ready for another round of troubleshooting and insights. Let's get to it!

Based on the information you've provided, it seems like the issue you're encountering is due to the way outputs are being passed between map_task A and map_task B. Here are some suggestions on how you might resolve this issue:

  1. Ensure Task Isolation: Make sure that each sub-task in map_task B is designed to only access its corresponding output from map_task A. This might involve adjusting how outputs are passed between tasks to ensure they are not bundled together in a way that requires downloading all outputs when only one is needed.

  2. Use ArrayNode for Enhanced Mapping Support: The Flyte documentation mentions ArrayNode as an enhancement over regular map tasks, offering wider mapping support and improved subtask execution handling, including cache management and subtask failure handling. By using ArrayNode from the experimental module, you might gain better control over how outputs are managed and accessed, potentially resolving the issue of unnecessary data downloads.

    Here is a sample code snippet:

    from flytekit import task, workflow
    from flytekit.experimental import map_task
    
    @task
    def your_task(a: int) -> int:
        ...
    
    @workflow
    def your_workflow(xs: list[int]) -> list[int]:
        return map_task(your_task)(a=xs)
  3. Review Task Output and Input Handling: Re-examine how outputs from map_task A are structured and how map_task B accesses these outputs. It might be necessary to refactor the tasks to ensure that each sub-task in map_task B explicitly accesses only its corresponding output from map_task A, possibly by indexing or other means of direct reference.

  4. Optimize Data Storage and Access: If the workflow involves storing outputs of map_task A in a shared location (e.g., cloud storage), consider structuring the storage so that each output is stored in a separate, directly accessible file or object. This way, sub-tasks in map_task B can directly access only the data they need without downloading everything.

  5. Leverage Task Metadata and Resource Overrides: Although not directly related to the issue of data downloading, optimizing the execution of map tasks through the use of TaskMetadata for caching and with_overrides for resource allocation (as shown in the provided examples) can contribute to overall workflow efficiency. This might indirectly alleviate the impact of increased runtime due to unnecessary data downloads.

For more information, you can refer to the Flyte documentation on map tasks.

Regarding the structure and type of the output from map_task A and how it is passed to map_task B, the output from a task execution is encapsulated in the TaskExecutionClosure message. The TaskExecutionClosure contains a field named OutputResult, which can be one of three types: OutputUri (string), OutputData (*core.LiteralMap), or Error (*core.ExecutionError). The specific type that is used depends on the outcome of the task execution. If the task execution was successful and produced output data, the OutputData field would be used. If the task execution resulted in an error, the Error field would be used. The OutputUri field is deprecated and not used in new implementations. You can find more details in the FlyteIDL protobuf definitions.

I hope these suggestions help you resolve the issue. If you need further assistance, please provide more details about your implementation, and I'll be glad to help.

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

from flyte.

welcome avatar welcome commented on May 20, 2024

Thank you for opening your first issue here! 🛠

from flyte.

eapolinario avatar eapolinario commented on May 20, 2024

@tomtou-bspace , this is a known limitation of the current implementation of map tasks. Unfortunately, we're not going to revisit this decision in the short / medium term as the team is focused on other projects right now.

from flyte.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.