Skip to content

Commit

Permalink
Merge pull request #58 from deehrlic/taichi1.6
Browse files Browse the repository at this point in the history
Pushing production notebooks to use taichi 1.6
  • Loading branch information
OskarElek authored Sep 25, 2023
2 parents 626ce76 + 16478fe commit 2789ed5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
],
"source": [
"## Initialize Taichi\n",
"ti.init(arch=ti.cpu,dynamic_index=True)\n",
"ti.init(arch=ti.cpu)\n",
"rng = default_rng()\n",
"\n",
"## Initialize data and agents\n",
Expand Down Expand Up @@ -366,6 +366,7 @@
"outputs": [],
"source": [
"## Define all GPU functions and kernels for data and agent processing\n",
" \n",
"@ti.kernel\n",
"def zero_field(f: ti.template()):\n",
" for cell in ti.grouped(f):\n",
Expand Down Expand Up @@ -843,7 +844,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
"version": "3.10.11"
},
"vscode": {
"interpreter": {
Expand Down
5 changes: 3 additions & 2 deletions experiments/jupyter/production/PolyPhy_2D_discrete_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
],
"source": [
"## Initialize Taichi\n",
"ti.init(arch=ti.cpu,dynamic_index=True)\n",
"ti.init(arch=ti.cpu)\n",
"rng = default_rng()\n",
"\n",
"## Initialize data and agents\n",
Expand Down Expand Up @@ -254,6 +254,7 @@
"outputs": [],
"source": [
"## Define all GPU functions and kernels for data and agent processing\n",
"\n",
"@ti.kernel\n",
"def zero_field(f: ti.template()):\n",
" for cell in ti.grouped(f):\n",
Expand Down Expand Up @@ -775,7 +776,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
"version": "3.10.11"
},
"vscode": {
"interpreter": {
Expand Down
35 changes: 13 additions & 22 deletions experiments/jupyter/production/PolyPhy_3D_discrete_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -143,23 +143,14 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/tmp/ipykernel_2009645/2477269779.py:9: DeprecationWarning: Please use `gaussian_filter` from the `scipy.ndimage` namespace, the `scipy.ndimage.filters` namespace is deprecated.\n",
" from scipy.ndimage.filters import gaussian_filter\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"[Taichi] version 1.0.3, llvm 10.0.0, commit fae94a21, linux, python 3.10.6\n",
"[I 06/04/23 20:38:21.796 2009645] [shell.py:_shell_pop_print@33] Graphical python shell detected, using wrapped sys.stdout\n"
"[Taichi] version 1.6.0, llvm 15.0.1, commit f1c6fbbd, win, python 3.10.11\n"
]
}
],
Expand All @@ -172,7 +163,7 @@
"from datetime import datetime\n",
"import matplotlib.pyplot as plt\n",
"import scipy\n",
"from scipy.ndimage.filters import gaussian_filter\n",
"from scipy.ndimage import gaussian_filter\n",
"import taichi as ti\n",
"import taichi.math as timath\n",
"\n",
Expand Down Expand Up @@ -219,7 +210,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -252,7 +243,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand All @@ -267,16 +258,16 @@
"Deposit grid resolution: (282, 512, 289)\n",
"Vis resolution: (1280, 720)\n",
"Data sample: [-316.2591 -97.13328 181.08551 7.398269]\n",
"Agent sample: [-246.43066 -417.49243 101.54407 0.99647886 0.5095961\n",
" 1. ]\n",
"Agent sample: [-205.04921 -201.78012 270.19302 1.411067 3.2580667\n",
" 1. ]\n",
"Number of agents: 1000000\n",
"Number of data points: 324901\n"
]
}
],
"source": [
"## Initialize Taichi\n",
"ti.init(arch=ti.cpu, device_memory_GB=4.0, dynamic_index=True)\n",
"ti.init(arch=ti.cpu, device_memory_GB=4.0)\n",
"rng = default_rng()\n",
"\n",
"## Initialize data and agents\n",
Expand Down Expand Up @@ -346,7 +337,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -377,7 +368,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -599,7 +590,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -613,7 +604,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -861,7 +852,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
"version": "3.10.11"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pytest==7.1.2
scipy
setuptools==65.5.1
sphinx
taichi==1.0.3
taichi==1.6.0
toml
tox
yapf
Expand Down

0 comments on commit 2789ed5

Please sign in to comment.