Skip to content

Commit

Permalink
Update parallel notebook.ipynb (#434)
Browse files Browse the repository at this point in the history
To get language consistency.
  • Loading branch information
skrawcz authored Nov 21, 2024
1 parent bb74ac9 commit e8f758a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions examples/parallelism/notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@
"id": "7a4c338b-90dc-4866-9cc9-5c9af38f9537",
"metadata": {},
"source": [
"# Parallelism (& Recursion)\n",
"# Parallelism (& hierarchy)\n",
"\n",
"Burr is all about thinking and modeling things as a \"graph\" or \"flowchart\". This just so happens to be a great way to model agents. This modeling also lends itself well to modeling \"recursion\" and \"parallelism\", which are key in building more complex interactions and agent systems.\n",
"Burr is all about thinking and modeling things as a \"graph\" or \"flowchart\". This just so happens to be a great way to model agents. This modeling also lends itself well to modeling \"hierarchy/recursion\" and \"parallelism\", which are key in building more complex interactions and agent systems.\n",
"\n",
"In this notebook we're going to go over how to run parallel \"actions\", which could be as simple as a single \"action\", or even \"whole burr sub-applications themselves\" (a.k.a. \"sub-agents\"). For full documentation on Parallelism see [this page](https://burr.dagworks.io/concepts/parallelism/); if you're familliar with the [`map-reduce`](https://en.wikipedia.org/wiki/MapReduce) pattern, then you'll feel right at home here.\n",
"\n",
"We will start simple and show how to write a simple Burr application that compares different LLMs for the same prompt & context. We'll then extend what we parallelize to be a whole burr sub-application/agent. \n",
"\n",
"To start:\n",
"1. we will not use Burr's parallelism or recursion constructs to help build your mental model.\n",
"2. we will then show Burr's [\"recursion\" capabilities](https://burr.dagworks.io/concepts/recursion/).\n",
"2. we will then show Burr's [\"recursion/hierarchy\" capabilities](https://burr.dagworks.io/concepts/recursion/).\n",
"3. we will then show how Burr's parallelism constructs simplify things.\n",
"4. we will then show how Burr's parallelism constructs enable you to more easily model more complex behavior.\n",
"\n",
Expand Down Expand Up @@ -170,7 +170,7 @@
"2. `run_llms` -- runs the different LLM models in parallel (not defined below)\n",
"3. `join_outputs` -- writes a map of LLM -> result\n",
"\n",
"We will first define actions (1) and (3), then redefine (2) according to whether we're using recursion or parallelism."
"We will first define actions (1) and (3), then redefine (2) according to whether we're using recursion/hierarchy or parallelism."
]
},
{
Expand Down Expand Up @@ -401,11 +401,11 @@
"id": "becfab1b-f89d-49a0-b1af-2f01359bfefa",
"metadata": {},
"source": [
"# Approach #2 -- using Burr within Burr, i.e. recursion\n",
"# Approach #2 -- using Burr within Burr, i.e. recursion/hierarchy\n",
"\n",
"Burr allows you to create Burr applications within Burr applications and wire through tracking to the UI so you can visualize sub-applications. For this, we will be representing the LLM calls with different models as their own (single-node) application. While this is built for more complex sub-application shapes, and is a bit of overkill for our toy example, it still works quite well with the simplicity of a single action (node) application. My point here is that you could add more actions to the application very easily and do more complex operations than what we're doing here. The Burr sub-applications can be used independently elsewhere.\n",
"Burr allows you to create Burr applications within Burr applications and wire through tracking to the UI so you can visualize sub-applications. For this, we will be representing the LLM calls with different models as their own (single-node) application. While this is built for more complex sub-application shapes, and is a bit of overkill for our toy example, it still works quite well with the simplicity of a single action (node) application. My point here is that you could add more actions to the application very easily and do more complex operations and model hierarchy than what we're doing here. The Burr sub-applications/graphs can be used independently elsewhere.\n",
"\n",
"For more on the code constructs in this section see Burr's [recursive tracking capabilities](https://burr.dagworks.io/concepts/recursion/)."
"For more on the code constructs in this section see Burr's [recursive/hierarchy tracking capabilities](https://burr.dagworks.io/concepts/recursion/)."
]
},
{
Expand Down

0 comments on commit e8f758a

Please sign in to comment.