Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrating physics-ml potentials #27

Merged
merged 46 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
519518b
Remove unused implementation parameter in YAML files and potential fa…
wiederm Apr 5, 2024
96c4360
Refactor potential initialization code
wiederm Apr 5, 2024
5c19102
Refactor test functions to use PotentialFactory
wiederm Apr 5, 2024
ed44991
Refactor test functions to use parameterized inputs
wiederm Apr 5, 2024
05564e2
allow multiple potentials
wiederm Apr 5, 2024
be7cb9f
Fix potential typo and update physicsml-model configuration
wiederm Apr 5, 2024
9ca7bfb
tests are passing locally
wiederm Apr 18, 2024
14243fe
add pretrained mace
wiederm Apr 18, 2024
7a0be53
adopt names
wiederm Apr 18, 2024
f61c9a3
refactor
wiederm Apr 18, 2024
4578183
Refactor potential initialization code and update YAML files
wiederm Apr 18, 2024
2c16fa8
update yaml
wiederm Apr 18, 2024
b5fef8b
update name
wiederm Apr 18, 2024
d2843e5
update path
wiederm Apr 18, 2024
b358591
update dicsstring
wiederm Apr 18, 2024
b9161d4
add docs
wiederm Apr 18, 2024
0ee50c6
add type hint
wiederm Apr 18, 2024
005dc80
Update README.md
wiederm May 8, 2024
4414b19
Update README.md
wiederm May 8, 2024
1342927
Update README.md
wiederm May 8, 2024
14dd055
Update setup.py
wiederm May 8, 2024
3828716
Update setup.py
wiederm May 8, 2024
28ed4e1
Update setup.py
wiederm May 8, 2024
9b4d21e
Update setup.py
wiederm May 8, 2024
57cf85d
Update setup.py
wiederm May 8, 2024
ef503e2
Removed eval and added device in yaml and setup.
adambaskerville May 9, 2024
8a0ba42
bugfix
wiederm May 10, 2024
9be57ec
Update README.md
wiederm May 10, 2024
4a767ba
expression to float
wiederm May 10, 2024
f9e7c0a
Merge branch 'physics-ml' of github.com:Exscientia/StableNetGuardOwl …
wiederm May 10, 2024
91903ad
expression to float
wiederm May 10, 2024
2715061
cast precision to str
wiederm May 10, 2024
5bb6149
expression to float
wiederm May 10, 2024
697db10
fix passing of platform proerties
wiederm May 10, 2024
5af2775
better visualization
wiederm May 10, 2024
64f3e26
Fixed multiplication error
adambaskerville May 13, 2024
460d06c
Fixed output file name bug
adambaskerville May 17, 2024
76739c5
Added experimental water rdf to output
adambaskerville May 17, 2024
5ecadc1
Fixed DOF test
adambaskerville May 30, 2024
0f9259a
First round of fixing tests
adambaskerville May 30, 2024
6c17923
Removed stability tests output data and more test fixing
adambaskerville May 30, 2024
cb90a8b
Removed generic .dcd and .pdb from gitignore
adambaskerville May 31, 2024
45e5d36
Second round of fixing tests
adambaskerville May 31, 2024
391d761
Third round of fixing tests.
adambaskerville May 31, 2024
59558a1
Added maximum bond length user option for DOF scan
adambaskerville May 31, 2024
74ba110
Removed exs physicsml and fixed typo
adambaskerville May 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@

StableNetGuardOwl provides a robust suite for conducting stability tests on Neural Network Potentials (NNPs) used in molecular simulations. These tests are critical in validating NNPs for research and industrial applications, ensuring accuracy and reliability.


## Installation

Since openMM and PhysML use different package managers, obtaining a conda|mamba environment with the correct packages is not trivial.
The following (note the order of the installation of the packages, this is critical for a working environment) has worked in the past:
```bash
mamba create --name owl python=3.11
mamba activate owl
pip install "physicsml[openmm]"
mamba install openmm-ml pytorch-gpu -c conda-forge
mamba install openmmtools loguru typer
wiederm marked this conversation as resolved.
Show resolved Hide resolved
```
## Features

StableNetGuardOwl supports stability tests for NNPs integrated with `openMM` and those implemented within `openmm-ml` or the Exscientia `physics-ml` package.
Expand Down Expand Up @@ -67,16 +79,15 @@ There is an example `test_config.yaml` file provided in the `scripts` directory
For a stability test using a pure 15 Angstrom waterbox the `config.yaml` file may look like this
```
tests:
- protocol: "waterbox_protocol" # which protocol is performed
- protocol: "waterbox_test" # which protocol is performed
edge_length: 15 # waterbox edge length in Angstrom
ensemble: "NVT" # thermodynamic esamble that is used. Oter options are 'NpT' and 'NVE'.
nnp: "ani2x" # the NNP used
implementation: "nnpops" # the implementation if multiple are available
annealing: false # simulated annealing to slowly reheat the system at the beginning of a simulation
nr_of_simulation_steps: 10_000 # number of simulation steps
temperature: 300 # in Kelvin
```
It defines the potential (nnp and implementation), the number of simulation steps, temperature in Kelvin, and edge length of the waterbox in Angstrom as well as the thermodynamic ensemble (`NVT`). Passing this to the `perform_guardowls.py` script runs the tests
It defines the potential, the number of simulation steps, temperature in Kelvin, and edge length of the waterbox in Angstrom as well as the thermodynamic ensemble (`NVT`). Passing this to the `perform_guardowls.py` script runs the tests

To visualize the results, use the `visualize_results.ipynb` notebook.

Expand Down Expand Up @@ -105,7 +116,6 @@ To perform a DOF scan over a bond in ethanol you need to generate a yaml file co
tests:
- protocol: "perform_DOF_scan"
nnp: "ani2x"
implementation: "torchani"
DOF_definition: { "bond": [0, 2] }
molecule_name: "ethanol"
```
Expand Down
6 changes: 3 additions & 3 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ dependencies:
- python
- pip
- openmm>=8.0
- openmm-ml
- openmm-torch
- openff-toolkit
- openmmtools
Expand All @@ -27,6 +28,7 @@ dependencies:
- pytest-cov
- codecov
- black
- rdkit

# Testing
- pytest
Expand All @@ -35,6 +37,4 @@ dependencies:

# Pip-only installs
- pip:
- nvidia-ml-py3
- nptyping
- git+https://github.com/openmm/openmm-ml.git
- physicsml
7 changes: 1 addition & 6 deletions guardowl/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def __init__( # type: ignore
platform: str,
qml_timing,
reference_timing,
implementation: str = "",
) -> None:
Process.__init__(self)
self.simulation_factory = SimulationFactory()
Expand All @@ -74,7 +73,6 @@ def __init__( # type: ignore
self.nnp = nnp
self.remove_constraints = remove_constraints
self.platform = platform
self.implementation = implementation
self.qml_timing = qml_timing
self.reference_timing = reference_timing

Expand All @@ -97,14 +95,13 @@ def get_timing_for_spe_calculation(
def run(self) -> None:
# this is executed as soon as the process is started

print(f"{self.implementation=} {self.platform=}")
print(f"{self.platform=}")
potential = MLPotential(self.nnp)

system = self.system_factory.initialize_system(
potential,
self.testsystem.topology,
self.remove_constraints,
implementation=self.implementation,
)

psim = self.simulation_factory.create_simulation(
Expand Down Expand Up @@ -164,7 +161,6 @@ def run_benchmark(
testsystems: Generator[TestSystem, None, None],
remove_constraints: bool,
platform: str,
implementation: str = "",
) -> None:
self.reference_timing, self.qml_timing, self.gpu_memory = [], [], []
# start memory logger
Expand All @@ -186,7 +182,6 @@ def run_benchmark(
platform,
qml_timing,
reference_timing,
implementation,
)
simulation_test.start()
log.info("Started simulation")
Expand Down
Loading
Loading