From 6e08e32d96dfbf104983131d93ffc1a53a172632 Mon Sep 17 00:00:00 2001 From: zachary62 Date: Tue, 28 Jan 2025 16:53:49 +0000 Subject: [PATCH] warn parallel --- docs/parallel.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/parallel.md b/docs/parallel.md index 3decb35..067b0fe 100644 --- a/docs/parallel.md +++ b/docs/parallel.md @@ -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. +> Because of Python’s GIL, parallel nodes and flows can’t 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 Like **AsyncBatchNode**, but run `exec_async()` in **parallel**: @@ -45,10 +48,6 @@ parallel_flow = SummarizeMultipleFiles(start=sub_flow) await parallel_flow.run_async(shared) ``` -> Because of Python’s GIL, parallel nodes and flows can’t 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