Kyle McChesney
12/13/2024, 4:49 PM.submit()
on every task?Marvin
12/13/2024, 4:49 PM.submit()
for each task, there are a few approaches you might consider, depending on your Prefect version.
For Prefect 3.x, the task runner mechanism can handle how tasks are executed, allowing for running tasks in parallel or distributed environments. You typically use .submit()
to submit tasks to a task runner like Dask or Ray. This lets tasks run in parallel or distributed environments, but you are interested in bypassing this direct submission step. You might consider assembling tasks that share upstream dependencies in a way that naturally exploits concurrency. Check out the Prefect 3.x task runners documentation to explore using task runners more effectively.
For Prefect 2.x, the concept of task runners is similar. You would use .submit()
to execute tasks concurrently or in parallel. However, automatically embedding this behavior into flow configurations isn't straightforward by default. Nonetheless, crafting your flow to use shared dependencies effectively could implicitly ensure tasks run concurrently. Check out more about Prefect 2.x task runners here.
If you're feeling a bit like you've left your towel behind on this one, know that it's a common piece of functionality request and likely to be refined in future prefect evolutions.Nate
12/13/2024, 4:50 PMNate
12/13/2024, 4:50 PMNate
12/13/2024, 4:51 PMNate
12/13/2024, 5:14 PMNate
12/13/2024, 5:14 PMKyle McChesney
12/13/2024, 5:18 PM