[Python] Flyte won't run in parallel

Discussão em 'Python' iniciado por Stack, Abril 9, 2025.

  1. Stack

    Stack Membro Participativo

    I'm new to flyte, trying to do quite simple things at the moment.

    So I'm trying to to run multiple independant tasks in parallel, which, if I understand the documentation, is exactly the purpose of map_task.

    However, so far I've been unable to make flyte actually run them in parallel.

    Any help would be greatly appreciated.

    Thanks in advance.

    from flytekit import map_task, task, workflow

    @task
    def do_something(value: str) -> str:
    print(f"launched: {value}", flush=True)
    time.sleep(60) # fakes long process time
    return f"{value}-processed"


    @workflow
    def do_multiple_things() -> list[str]:
    values = ["foo", "bar", "baz"]
    return map_task(do_something)(value=values)

    Continue reading...

Compartilhe esta Página