From ddeb4a85ccb43f3ec05fb6fff53bcf1c5f7c28e4 Mon Sep 17 00:00:00 2001 From: Prashant Jha <46859995+pjflux2001@users.noreply.github.com> Date: Sat, 7 Oct 2023 03:14:43 +0530 Subject: [PATCH] switching to cpu for CI pipelines (#62) CI pipelines won't work with "ti.gpu". Hence, changing to "ti.cpu" (conditionally in case the code is run by the automated CI pipeline). --- .../production/PolyPhy_2D_continuous_data.ipynb | 2 +- .../production/PolyPhy_2D_discrete_data.ipynb | 2 +- .../production/PolyPhy_3D_discrete_data.ipynb | 2 +- experiments/jupyter/production/imgui.ini | 15 --------------- .../jupyter/production/polyphy_2DDiscrete.py | 2 +- .../jupyter/production/polyphy_3DDiscrete.py | 2 +- 6 files changed, 5 insertions(+), 20 deletions(-) delete mode 100644 experiments/jupyter/production/imgui.ini diff --git a/experiments/jupyter/production/PolyPhy_2D_continuous_data.ipynb b/experiments/jupyter/production/PolyPhy_2D_continuous_data.ipynb index 7a45e4c..6f77a02 100644 --- a/experiments/jupyter/production/PolyPhy_2D_continuous_data.ipynb +++ b/experiments/jupyter/production/PolyPhy_2D_continuous_data.ipynb @@ -294,7 +294,7 @@ ], "source": [ "## Initialize Taichi\n", - "ti.init(arch=ti.cpu)\n", + "ti.init(arch=ti.cpu if os.path.exists(\"/tmp/flag\") else ti.gpu)\n", "rng = default_rng()\n", "\n", "## Initialize data and agents\n", diff --git a/experiments/jupyter/production/PolyPhy_2D_discrete_data.ipynb b/experiments/jupyter/production/PolyPhy_2D_discrete_data.ipynb index c1ba0ee..2de9735 100644 --- a/experiments/jupyter/production/PolyPhy_2D_discrete_data.ipynb +++ b/experiments/jupyter/production/PolyPhy_2D_discrete_data.ipynb @@ -151,7 +151,7 @@ ], "source": [ "## Initialize Taichi\n", - "ti.init(arch=ti.cpu)\n", + "ti.init(arch=ti.cpu if os.path.exists(\"/tmp/flag\") else ti.gpu)\n", "rng = default_rng()\n", "\n", "## Initialize data and agents\n", diff --git a/experiments/jupyter/production/PolyPhy_3D_discrete_data.ipynb b/experiments/jupyter/production/PolyPhy_3D_discrete_data.ipynb index 29b4f49..2270023 100644 --- a/experiments/jupyter/production/PolyPhy_3D_discrete_data.ipynb +++ b/experiments/jupyter/production/PolyPhy_3D_discrete_data.ipynb @@ -134,7 +134,7 @@ "outputs": [], "source": [ "## Initialize Taichi\n", - "ti.init(arch=ti.gpu, device_memory_GB=4.0, dynamic_index=True)\n", + "ti.init(arch=ti.cpu if os.path.exists(\"/tmp/flag\") else ti.gpu)\n", "rng = default_rng()\n", "\n", "## Initialize data and agents\n", diff --git a/experiments/jupyter/production/imgui.ini b/experiments/jupyter/production/imgui.ini deleted file mode 100644 index e614382..0000000 --- a/experiments/jupyter/production/imgui.ini +++ /dev/null @@ -1,15 +0,0 @@ -[Window][Debug##Default] -Pos=60,60 -Size=400,400 -Collapsed=0 - -[Window][Main] -Pos=14,9 -Size=327,870 -Collapsed=0 - -[Window][Help] -Pos=358,9 -Size=864,307 -Collapsed=1 - diff --git a/experiments/jupyter/production/polyphy_2DDiscrete.py b/experiments/jupyter/production/polyphy_2DDiscrete.py index c39563b..b5c508f 100644 --- a/experiments/jupyter/production/polyphy_2DDiscrete.py +++ b/experiments/jupyter/production/polyphy_2DDiscrete.py @@ -12,7 +12,7 @@ def __init__(self): self.rng = default_rng() self.ppInputData = PPInputData_2DDiscrete(self.input_file, self.rng) self.ppConfig.register_data(self.ppInputData) - ti.init(arch=ti.gpu) + ti.init(arch=ti.cpu if os.path.exists("/tmp/flag") else ti.gpu) self.kernels = PPKernels() self.ppInternalData = PPInternalData_2DDiscrete(self.rng, self.kernels, self.ppConfig) diff --git a/experiments/jupyter/production/polyphy_3DDiscrete.py b/experiments/jupyter/production/polyphy_3DDiscrete.py index cfcc5ef..29885ba 100644 --- a/experiments/jupyter/production/polyphy_3DDiscrete.py +++ b/experiments/jupyter/production/polyphy_3DDiscrete.py @@ -12,7 +12,7 @@ def __init__(self): self.rng = default_rng() self.ppInputData = PPInputData_3DDiscrete(self.input_file, self.rng) self.ppConfig.register_data(self.ppInputData) - ti.init(arch=ti.gpu, device_memory_GB=4) + ti.init(arch=ti.cpu if os.path.exists("/tmp/flag") else ti.gpu, device_memory_GB=4) self.kernels = PPKernels() self.ppInternalData = PPInternalData_3DDiscrete(self.rng, self.kernels, self.ppConfig)