Add NAGLCharges section - #71
Conversation
j-wags
left a comment
There was a problem hiding this comment.
Overall this is a good start. I think the big fork in the road is whether we specify exactly what's meant for the Model section and charge enumeration behavior, or if we can refer to an external spec/API and not get lost in the details, or if we have the initial version of this spec refer to the behavior of one or more openff-nagl versions and refer folks to the implementation there.
I hadn't had high hopes for the standardization reactions section, but it seems straightforward enough that I'd be OK to go with it pretty much as written.
|
|
||
| This proposal does not include changes or interactions with sections that do not modify partial charges, such as `<vdW>`, `<Constraints>`, `<Bonds>`, `<Angles>`, etc. | ||
|
|
||
| # TODO: Describe where in the charge method hierarchy this exists |
There was a problem hiding this comment.
I'd propose that the charge hierarchy with this change become
- Pre-specified charges (
charge_from_molecules) - Library charges
- GNN charges
- ToolkitAM1BCC charges
- ChargeIncrementModel charges
(Reading over the current spec, I realized ChargeIncrementModel and ToolkitAM1BCC aren't assigned relative priority, I've commented on #68 to that effect since that's a better scope for this information)
| This proposal does not include changes or interactions with sections that do not modify partial charges, such as `<vdW>`, `<Constraints>`, `<Bonds>`, `<Angles>`, etc. | ||
|
|
||
| # TODO: Describe where in the charge method hierarchy this exists | ||
| # TODO: Describe interaction(s) with virtual sites |
There was a problem hiding this comment.
I think this would interact with vsites in the same way as the current charge assignment methods. That is: "assigning base charges which vsites may later modify".
Our longer-term roadmap includes possibly having NAGL assign charges directly to vsites, but all I can think adding of for this is (paraphrasing) "in the future, GNNCharges may also be able to directly assign charges to virtual sites, but we'll need to work on the details of that before it goes into the spec". I recall that adding forward-looking statements into the spec has caused confusion before, so I'd be in favor of leaving this out.
|
To be discussed in the SMIRNOFF committee April 1. |
Co-authored-by: Lily Wang <31115101+lilyminium@users.noreply.github.com> Co-authored-by: Jeff Wagner <jeffrey.wagner+github@openforcefield.org>
Co-authored-by: Jeff Wagner <jeffrey.wagner+github@openforcefield.org>
|
I had a few minor comments other than those discussed synchronously:
|
j-wags
left a comment
There was a problem hiding this comment.
I've completed a first round of edits and next will schedule a meeting with @lilyminium to discuss:
- the sub-elements supported by the bond_features section
- whether it still makes sense to strictly define the data types now that we're not using the
Modelsection - whether
atom_in_ring_of_sizeshould be a single element with multiple ring sizes listed as an attribute
|
Before I open this EP for final review, I'm going to start a PR(s) in the relevant OpenFF repos with an initial implementation of support for the |
|
Alright, I'd like to open this up for a vote! |
There was a problem hiding this comment.
What's the reasoning behind starting the versioning at v0.3 again?
Otherwise LGTM except for the concern below. Thanks so much for putting this together Jeff!!
My one concern is the sha/Zenodo DOI and how that could work with multiple NAGL versions. Using the sha really does restrict you to only one possible model/file. The way it's currently written, the model file name must also match strictly so could only match one possible data file in the Zenodo record. I think this is probably going to be fine and NAGL should be able to work with legacy files programmatically, but I might need to take a couple days to think about how we ship force field files that we ensure are generalizable across different software versions for fundamental dependencies such as pytorch, numpy, even python given the dependence on pickling.
Co-authored-by: Lily Wang <31115101+lilyminium@users.noreply.github.com>
It's a weird but important thing that will keep coming up - might be good to even put this into the EP template #71 (comment)
Good catch. TL;DR: I'm ambivalent about the SHA and could drop it. I think the DOI is pretty important, but would approve the first version of this spec without it if it's objectionable. I hadn't considered changes in dependencies that could make the model unreadable but I think that can be handled a variety of ways. Long version: Thanks for the input, you're thinking about this from another angle and it's really helpful, please take your time! My thinking was roughly that:
That was all of my thinking on DOIs/SHAs. I hadn't considered that we might need to make new releases of old models in response to pytorch or numpy changes. Without giving it a lot of thought, I think we'd be kinda OK for the NAGL software to someday say "this version of the NAGL software can't load that NAGL model, you may need to downgrade", or if there's a lot of demand, for us to refresh old FF releases with updated NAGL models (ex. if |
|
An alternate proposal is to use a model name instead of file, and to leave the SHA/DOI untangling to the libraries themselves. I think this is similar in philosophy to the current ToolkitAM1BCC provider that species a method name, and leaves the implementation up to the backend. Am I overlooking anything dangerous, insecure, or underspecified? However, I've been thinking this over for a few days and I think the extreme likelihood (90+%) is that this is fine. Assuming pickling doesn't completely break, I believe the next highest risk would be pytorch typing. Outside of that we should be able to fairly easily recover the data and reformat it to requirements for our other dependencies. Finally, I believe that we have decided that we do want to move to a more general GNNCharges spec for the next model, so the NAGLCharges spec may not be used extensively. I'll leave this open until Jeff is back from leave to see if this merits further discussion, but for now my vote is a provisional approval. |
|
I am in general good with this, but I DO really want the DOI to be pointed to, even if it creates some slight risk of ambiguity. So I vote to approve. |
|
@j-wags and I discussed after stand-up today. A basic summary of the discussion is:
|
Please only consider the
OFF-EP-0011.mdfile when reviewing this PR. The modifications insmirnoff.mdare just a copy of part of the EP (where it says "this part will be pasted in verbatim") and a little housekeeping to disambiguate charge method precedence (which is also covered in the EP text).This will pave the way for the upcoming openff-2.3.0 release with graph charges.
Please use the GitHub review mechanisms (Approve/Request Changes) to vote. One convention we commonly use around reviews is that minor changes can be filed under an Approve (just list whether each proposed change is “blocking” - that is “this is approved only if this change is made” - or “not blocking” meaning “I think this would be a nice change, but I’d approve this being merged without it”).
As listed in the PR, the voting period will be open for two weeks (starting May 21 2025):