Conversation
|
Note this is currently failing due to reading in a checkpoint file; I added the unique_pairs variable to the buffers in the neighbor list, as that seemed to be a very import thing to set. However, it is also set up stream (and encoded likely in another location). So I wonder if this is necessary. |
# Conflicts: # modelforge/potential/potential.py
…pful (to avoid reinitializing tensors) actually is problematic. I needed to add a separate forward call that takes the all the "slots" and passes them, creating a new NNPInput within the forward call.
|
The switch from a named tuple to a class for NNPInput actually presents some problems when we go to use the torch script models (i.e., passing input after calling torch.jit.script). Torch script doesn't really handle getting a class as input well. it sees the the NNPInput class as a different type due to being different Python compilation unit (i.e., compiled using modelforge and then compiled by the wrapper class). NNPInput is more of a convenience thing (has validation, sets default shapes, etc.), but for inference we just need to pass tensors directly. |
…re on the same device (since neighborlists are initialized before we know what the target device is).
|
@chrisiacovella , NNPInput is torch scripted right now; we could also set a flag not to jit that class (there is no benefit to it at that point). |
…y for neighborlists. added decorators to make strategy setting routines accessible for neighborlists during inference. xfailed checkpoint testing. will need to regenerate file.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files |
wiederm
left a comment
There was a problem hiding this comment.
Great work!
I'd love to better understand the control flow from input to property with this module, I left a comment.
… load_inference_model_from_checkpoint now accepts an optional argument "only_unique_pairs" to set this when reading a checkpoint file, for any models trained prior to PR choderalab#299 (openmm integration).
Pull Request Summary
This PR revamps the neighbor list (allowing us to change the strategy for a JITTED torchscript potential) and provide a wrapper allowing us to run this with openmm -torch.
Key changes
Notable points that this PR has either accomplished or will accomplish.
Associated Issue(s)
Pull Request Checklist