Skip to content

Commit

Permalink
Added additional orchestration text
Browse files Browse the repository at this point in the history
  • Loading branch information
gmao-ckung committed May 28, 2024
1 parent 76edba5 commit 084e1a9
Showing 1 changed file with 17 additions and 44 deletions.
61 changes: 17 additions & 44 deletions tutorial/NDSL/03_orchestration_basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,9 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<script src=\"https://spcl.github.io/dace-webclient/dist/sdfv.js\"></script>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"2024-05-28 11:13:12|INFO|rank 0|ndsl.logging:Constant selected: ConstantVersions.GFS\n"
]
}
],
"outputs": [],
"source": [
"import numpy as np\n",
"from gt4py.cartesian.gtscript import (\n",
Expand Down Expand Up @@ -70,7 +50,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -89,12 +69,12 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Now we'll define an object that enables the orchestration and combination of stencils and Python codes. The orchestration occurs with the `orchestrate` call in the initialization step of the object. Within `__call__`, there's a combination of both stencil and regular python codes."
"We'll define an object that enables the orchestration and combination of stencils and Python codes. The orchestration occurs with the `orchestrate` call in the initialization step of the object. Within `__call__`, there's a combination of both stencil and regular python codes."
]
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -124,39 +104,32 @@
" self._local_sum(tmp_field, out_result, 2.0) # GT4Py Stencil"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Next, we'll create a simple driver that defines the domain and halo size, specifies the backend, and uses the boilerplate clode to create a stencil and quantity factory objects. These objects help define the computational domain used for this particular example. After defining quantities (`in_field` and `out_field`) to hold the appropriate values and creating an object `local_sum` for our combined stencil/Python calculation, `local_sum` is called to perform the computation. In the output, we can see DaCe orchestrating the code. "
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2024-05-28 11:28:28|INFO|rank 0|ndsl.logging:[DaCeOrchestration.BuildAndRun] Rank 0 reading/writing cache .gt_cache_FV3_A\n",
"2024-05-28 11:32:07|INFO|rank 0|ndsl.logging:Building DaCe orchestration\n",
"2024-05-28 13:15:48|INFO|rank 0|ndsl.logging:[DaCeOrchestration.BuildAndRun] Rank 0 reading/writing cache .gt_cache_FV3_A\n",
"2024-05-28 13:15:48|INFO|rank 0|ndsl.logging:Building DaCe orchestration\n",
"Inlined 2 SDFGs.\n",
"Fused 4 states.\n",
"Inferred 2 optional arrays.\n",
"SDFG 0: Eliminated 1 arrays: {'out_result_0'}.\n",
"Fused 2 states.\n",
"Inferred 4 optional arrays.\n",
"Inlined 2 SDFGs.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/ckung/Documents/Code/Python_venv/gt4py_jupyter/lib/python3.11/site-packages/dace/sdfg/sdfg.py:2227: UserWarning: SDFG \"LocalSum___call__\" is already loaded by another object, recompiling under a different name.\n",
" warnings.warn('SDFG \"%s\" is already loaded by another object, '\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"2024-05-28 11:32:09|INFO|rank 0|ndsl.logging:[DaCeOrchestration.BuildAndRun] LocalSum___call__:\n",
"Inlined 2 SDFGs.\n",
"2024-05-28 13:15:50|INFO|rank 0|ndsl.logging:[DaCeOrchestration.BuildAndRun] LocalSum___call__:\n",
"StorageType.Default:\n",
" Alloc ref 0.01 mb\n",
" Alloc unref 0.00 mb\n",
Expand Down

0 comments on commit 084e1a9

Please sign in to comment.