From 17022c5f71d05e6b0ce296a801a5bcfb3d139bf7 Mon Sep 17 00:00:00 2001 From: Raimondas Galvelis Date: Tue, 25 Oct 2022 12:18:36 +0200 Subject: [PATCH 1/5] Install MambaForge explicitly --- tutorials/openmm-torch-nnpops.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tutorials/openmm-torch-nnpops.ipynb b/tutorials/openmm-torch-nnpops.ipynb index 75554a6c..d48f603e 100644 --- a/tutorials/openmm-torch-nnpops.ipynb +++ b/tutorials/openmm-torch-nnpops.ipynb @@ -39,18 +39,18 @@ "base_uri": "https://localhost:8080/" }, "id": "EcB2lc1s3ZXG", - "outputId": "1ce0bad8-a050-48d5-c18a-9e49fbeb11c2" + "outputId": "ca3b9161-9de2-4fc3-a497-235011951876" }, "outputs": [ { - "name": "stdout", "output_type": "stream", + "name": "stdout", "text": [ "⏬ Downloading https://github.com/jaimergp/miniforge/releases/latest/download/Mambaforge-colab-Linux-x86_64.sh...\n", "📦 Installing...\n", "📌 Adjusting configuration...\n", "🩹 Patching environment...\n", - "⏲ Done in 0:00:34\n", + "⏲ Done in 0:00:18\n", "🔁 Restarting kernel...\n" ] } @@ -58,7 +58,7 @@ "source": [ "!pip install -q condacolab\n", "import condacolab\n", - "condacolab.install_miniconda()" + "condacolab.install_mambaforge()" ] }, { From 3fdfa9d233286aba69673987613635a2cdcb2e10 Mon Sep 17 00:00:00 2001 From: Raimondas Galvelis Date: Tue, 25 Oct 2022 12:21:44 +0200 Subject: [PATCH 2/5] Use OpenMM 8.0beta and friends --- tutorials/openmm-torch-nnpops.ipynb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tutorials/openmm-torch-nnpops.ipynb b/tutorials/openmm-torch-nnpops.ipynb index d48f603e..f1ddda9c 100644 --- a/tutorials/openmm-torch-nnpops.ipynb +++ b/tutorials/openmm-torch-nnpops.ipynb @@ -82,11 +82,17 @@ }, "outputs": [], "source": [ - "# NOTE: PyTorch pinned because https://github.com/conda-forge/openmm-torch-feedstock/issues/20\n", - "!mamba install -q -c conda-forge \\\n", - " openmm-torch nnpops torchani openmmtools \\\n", - " pytorch=1.11 \\\n", - " &> /dev/null # Comment this line to see a log\"" + "# Note: at the moment only the beta releases work correctly.\n", + "!mamba install -q \\\n", + " -c conda-forge/label/openmm_rc \\\n", + " -c conda-forge/label/openmm-torch_rc \\\n", + " -c conda-forge \\\n", + " openmm==8.0.0beta \\\n", + " openmm-torch==1.0beta \\\n", + " nnpops==0.2 \\\n", + " torchani==2.2.2 \\\n", + " openmmtools \\\n", + " &> /dev/null # Comment this line to see a log" ] }, { From 04281cdd90a7f40660c36771d3bd87e314b30edb Mon Sep 17 00:00:00 2001 From: Raimondas Galvelis Date: Tue, 25 Oct 2022 13:47:02 +0200 Subject: [PATCH 3/5] Remove circumvent for #61 --- tutorials/openmm-torch-nnpops.ipynb | 30 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tutorials/openmm-torch-nnpops.ipynb b/tutorials/openmm-torch-nnpops.ipynb index f1ddda9c..4944ba29 100644 --- a/tutorials/openmm-torch-nnpops.ipynb +++ b/tutorials/openmm-torch-nnpops.ipynb @@ -328,7 +328,7 @@ "# Create a simulation and set the initial positions and velocities\n", "simulation = Simulation(ala2.topology, ala2.system, integrator)\n", "simulation.context.setPositions(ala2.positions)\n", - "# simulation.context.setVelocitiesToTemperature(temperature) # This does not work (https://github.com/openmm/openmm-torch/issues/61)\n", + "#simulation.context.setVelocitiesToTemperature(temperature)\n", "\n", "# Configure a reporter to print to the console every 0.1 ps (100 steps)\n", "reporter = StateDataReporter(file=sys.stdout, reportInterval=100, step=True, time=True, potentialEnergy=True, temperature=True)\n", @@ -352,12 +352,12 @@ "base_uri": "https://localhost:8080/" }, "id": "JN9v2rz3KbTz", - "outputId": "15367844-1caa-40c1-bb5b-f94f7b51eb1b" + "outputId": "7ef59ac1-520a-4076-a1c5-fc2ec7df5136" }, "outputs": [ { - "name": "stdout", "output_type": "stream", + "name": "stdout", "text": [ "-1301523.8702643516\n" ] @@ -396,24 +396,24 @@ "base_uri": "https://localhost:8080/" }, "id": "da0v6qJHBtUb", - "outputId": "e477991e-93b0-4e72-de4f-d7a8b05052de" + "outputId": "bc7426d5-42dc-455a-d20d-733e51ea644f" }, "outputs": [ { - "name": "stdout", "output_type": "stream", + "name": "stdout", "text": [ "#\"Step\",\"Time (ps)\",\"Potential Energy (kJ/mole)\",\"Temperature (K)\"\n", - "100,0.10000000000000007,-1301527.998092823,62.28599411217165\n", - "200,0.20000000000000015,-1301519.2141580286,68.6151680329106\n", - "300,0.3000000000000002,-1301513.905558333,103.32518127627559\n", - "400,0.4000000000000003,-1301517.7584694924,118.20611762387\n", - "500,0.5000000000000003,-1301514.9794064017,165.4939713543869\n", - "600,0.6000000000000004,-1301507.6431399288,148.54034468306415\n", - "700,0.7000000000000005,-1301511.109281123,157.43310789810866\n", - "800,0.8000000000000006,-1301498.8263809385,157.8375886414082\n", - "900,0.9000000000000007,-1301511.3014532926,199.2036328097003\n", - "1000,1.0000000000000007,-1301485.2554342675,148.26160451888617\n" + "100,0.10000000000000007,-1301523.916390367,92.40824830382874\n", + "200,0.20000000000000015,-1301518.7990238892,119.2893445291452\n", + "300,0.3000000000000002,-1301513.695350461,152.9633322198495\n", + "400,0.4000000000000003,-1301508.793747321,161.74950978774066\n", + "500,0.5000000000000003,-1301504.6699876415,164.00853843792856\n", + "600,0.6000000000000004,-1301498.9500878605,159.56241762805863\n", + "700,0.7000000000000005,-1301508.518243164,197.16748430772566\n", + "800,0.8000000000000006,-1301501.4794679733,217.2560582437653\n", + "900,0.9000000000000007,-1301479.1362451615,189.695421119118\n", + "1000,1.0000000000000007,-1301481.766797349,256.3789993541881\n" ] } ], From 11b8d1a7a786ecb0e4cd1b4195f9091141c2d148 Mon Sep 17 00:00:00 2001 From: Raimondas Galvelis Date: Tue, 25 Oct 2022 14:42:52 +0200 Subject: [PATCH 4/5] Clean up --- tutorials/openmm-torch-nnpops.ipynb | 32 ++++------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/tutorials/openmm-torch-nnpops.ipynb b/tutorials/openmm-torch-nnpops.ipynb index 4944ba29..eaf4cc2f 100644 --- a/tutorials/openmm-torch-nnpops.ipynb +++ b/tutorials/openmm-torch-nnpops.ipynb @@ -43,8 +43,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "⏬ Downloading https://github.com/jaimergp/miniforge/releases/latest/download/Mambaforge-colab-Linux-x86_64.sh...\n", "📦 Installing...\n", @@ -116,15 +116,7 @@ "id": "zNng_d4mGKve", "outputId": "218e0775-766b-4597-9d48-96e3d65df374" }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Warning: importing 'simtk.openmm' is deprecated. Import 'openmm' instead.\n" - ] - } - ], + "outputs": [], "source": [ "import openmmtools\n", "\n", @@ -165,14 +157,6 @@ "outputId": "4181fcb6-db72-47e7-edb5-2a4bb0252de7" }, "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/usr/local/lib/python3.7/site-packages/torchani/__init__.py:55: UserWarning: Dependency not satisfied, torchani.ase will not be available\n", - " warnings.warn(\"Dependency not satisfied, torchani.ase will not be available\")\n" - ] - }, { "name": "stdout", "output_type": "stream", @@ -180,14 +164,6 @@ "/usr/local/lib/python3.7/site-packages/torchani/resources/\n", "Downloading ANI model parameters ...\n" ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/usr/local/lib/python3.7/site-packages/torch/functional.py:1069: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at /home/conda/feedstock_root/build_artifacts/pytorch-recipe_1640851336451/work/aten/src/ATen/native/TensorShape.cpp:2156.)\n", - " return _VF.cartesian_prod(tensors) # type: ignore[attr-defined]\n" - ] } ], "source": [ @@ -356,8 +332,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "-1301523.8702643516\n" ] @@ -400,8 +376,8 @@ }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "#\"Step\",\"Time (ps)\",\"Potential Energy (kJ/mole)\",\"Temperature (K)\"\n", "100,0.10000000000000007,-1301523.916390367,92.40824830382874\n", From 63ac66bd46851d1d00316f7e1d787da393cba956 Mon Sep 17 00:00:00 2001 From: Raimondas Galvelis Date: Wed, 26 Oct 2022 16:48:33 +0200 Subject: [PATCH 5/5] Fix typo --- tutorials/openmm-torch-nnpops.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/openmm-torch-nnpops.ipynb b/tutorials/openmm-torch-nnpops.ipynb index eaf4cc2f..981bce5d 100644 --- a/tutorials/openmm-torch-nnpops.ipynb +++ b/tutorials/openmm-torch-nnpops.ipynb @@ -304,7 +304,7 @@ "# Create a simulation and set the initial positions and velocities\n", "simulation = Simulation(ala2.topology, ala2.system, integrator)\n", "simulation.context.setPositions(ala2.positions)\n", - "#simulation.context.setVelocitiesToTemperature(temperature)\n", + "simulation.context.setVelocitiesToTemperature(temperature)\n", "\n", "# Configure a reporter to print to the console every 0.1 ps (100 steps)\n", "reporter = StateDataReporter(file=sys.stdout, reportInterval=100, step=True, time=True, potentialEnergy=True, temperature=True)\n",