warn parallel

This commit is contained in:
zachary62 2025-01-28 16:53:49 +00:00
parent 1d2e3c5090
commit 6e08e32d96
1 changed files with 3 additions and 4 deletions

View File

@ -9,6 +9,9 @@ nav_order: 6
**Parallel** Nodes and Flows let you run multiple **Async** Nodes and Flows **concurrently**—for example, summarizing multiple texts at once. This can improve performance by overlapping I/O and compute. **Parallel** Nodes and Flows let you run multiple **Async** Nodes and Flows **concurrently**—for example, summarizing multiple texts at once. This can improve performance by overlapping I/O and compute.
> Because of Pythons GIL, parallel nodes and flows cant truly parallelize CPU-bound tasks (e.g., heavy numerical computations). However, they excel at overlapping I/O-bound work—like LLM calls, database queries, API requests, or file I/O.
{: .warning }
## AsyncParallelBatchNode ## AsyncParallelBatchNode
Like **AsyncBatchNode**, but run `exec_async()` in **parallel**: Like **AsyncBatchNode**, but run `exec_async()` in **parallel**:
@ -45,10 +48,6 @@ parallel_flow = SummarizeMultipleFiles(start=sub_flow)
await parallel_flow.run_async(shared) await parallel_flow.run_async(shared)
``` ```
> Because of Pythons GIL, parallel nodes and flows cant truly parallelize CPU-bound tasks (e.g., heavy numerical computations).
>
> However, they excel at overlapping I/O-bound work—like LLM calls, database queries, API requests, or file I/O.
{: .warning }
## Best Practices ## Best Practices