You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm attempting to test MD runs with the AMBER protein force fields and a solvated system as a basis for some future free energy experiments. For very small systems I've generally had good luck getting things working but when I try to test a larger solvated system (# atoms = 37266), I'm having trouble with neighbor list generation causing an out of memory error.
DMFF Version
0.2.1
JAX Version
jaxlib[cuda11_cudnn805]==0.3.15
OpenMM Version
7.7.0
How did you download the software?
pip
Input Files, Running Commands, Error Log, etc.
Input file:
import sys
import time
import jax
import jax.numpy as jnp
import numpy as np
import openmm.app as app
import openmm.unit as unit
from dmff import Hamiltonian, NeighborList
from jax_md import space, smap, energy, minimize, quantity, simulate, quantity
from jax.config import config
config.update("jax_enable_x64", True)
prmtop = app.AmberPrmtopFile('../RAMP1_ion.prmtop')
inpcrd = app.AmberInpcrdFile('../RAMP1_ion.inpcrd')
ff = Hamiltonian("amber14/protein.ff14SB.xml", "amber14/tip3p.xml")
def hhbond(bond):
if bond[0].residue.name == 'HOH':
if bond[0].element._symbol == 'H' and bond[1].element._symbol == 'H':
return True
return False
#remove extra H-H bonds found in AMBER format
prmtop.topology._bonds = [bond for bond in prmtop.topology._bonds if not hhbond(bond)]
potentials = ff.createPotential(prmtop.topology, nonbondedMethod=app.PME, nonbondedCutoff=8*unit.angstrom, prm=prmtop)
params = ff.getParameters()
positions = jnp.array(inpcrd.getPositions(asNumpy=True).value_in_unit(unit.nanometer))
positions = positions - jnp.min(positions, axis=0)
#positions range from 0 to ~9.6 in any given direction
box = jnp.array([
[10.0, 0.0, 0.0],
[0.0, 10.0, 0.0],
[0.0, 0.0, 10.0]
])
#8 angstrom cutoff
nbList = NeighborList(box, .8, potentials.meta["cov_map"])
nbList.allocate(positions)
Running the above snippet of Python code with the input files below causes this issue. From the above error, it looks like some of the buffers allocated are essentially n^2 in one dimension. I don't understand the neighbor/cell list generation code in JAX MD well enough to figure out why this is happening but my understanding is that a cell neighbor list should avoid these issues with an appropriately set cutoff.
Further Information, Files, and Links
The 2 files are the protein system building examples from the AMBER tutorials of the RAMP1 protein solvated in a water box. RAMP1_ion.zip
The text was updated successfully, but these errors were encountered:
Try to use NeighborListFreud, instead of NeighborList. The latter one relies on the neighbor list module of jax-md, which is slow and memory consuming. On the other hand, the Freud neighbor list runs on CPU, which does not have the memory issue for large systems, and, surprisingly, often runs faster.
Nevertheless, the performances of both modules are unsatisfactory. We are working on more efficient implementations of neighbor list. And hopefully can get it done in next few months.
It seems like this does the trick. Comparing with some larger systems at reasonable cutoffs (8-10 Angstrom), the results scale somewhat better with NeighborListFreud although still run into bottlenecks on especially large systems from the benchmark suites of other packages. In regards to my other issue, it looks like there were also some issues with box vector input format that would cause the generation of some large n^2 arrays. This behavior seems to no longer be an issue in the development branch mentioned in that issue though.
Bug summary
I'm attempting to test MD runs with the AMBER protein force fields and a solvated system as a basis for some future free energy experiments. For very small systems I've generally had good luck getting things working but when I try to test a larger solvated system (# atoms = 37266), I'm having trouble with neighbor list generation causing an out of memory error.
DMFF Version
0.2.1
JAX Version
jaxlib[cuda11_cudnn805]==0.3.15
OpenMM Version
7.7.0
How did you download the software?
pip
Input Files, Running Commands, Error Log, etc.
Input file:
Error log:
Steps to Reproduce
Running the above snippet of Python code with the input files below causes this issue. From the above error, it looks like some of the buffers allocated are essentially n^2 in one dimension. I don't understand the neighbor/cell list generation code in JAX MD well enough to figure out why this is happening but my understanding is that a cell neighbor list should avoid these issues with an appropriately set cutoff.
Further Information, Files, and Links
The 2 files are the protein system building examples from the AMBER tutorials of the RAMP1 protein solvated in a water box.
RAMP1_ion.zip
The text was updated successfully, but these errors were encountered: