openmm / openmm-torch

OpenMM plugin to define forces with neural networks
185 stars 24 forks source link

Can compute parameter derivatives #143

Closed peastman closed 6 months ago

peastman commented 6 months ago

Implements #141.

RaulPPelaez commented 6 months ago

We really need to fix the CI...

RaulPPelaez commented 6 months ago

There should also be a Python side test. Take this one if you'd like: https://github.com/openmm/openmm-torch/blob/4c9b5e509d15ce52db7600f7538fbe66538c1c2a/python/tests/TestParameterDerivatives.py

BTW, this is still a problem. I do not think OpenMM-Torch can do anything about it, but perhaps there is a way to detect it and provide a useful message?

peastman commented 6 months ago

Thanks for the comments. It turned out that what I had written didn't work with CUDA graphs. I restructured it to handle the input tensors in a different way and made the test case run both with and without graphs. Can you see if it looks better now?

peastman commented 6 months ago

Is this ok to merge? Getting CI working is its own major project. I'm working on that in another PR.