Repository navigation
Add all-in-one ETKDG force field kernels - #375
Merged
Merged
Conversation
Batched force field for RDKit's all-in-one ETKDG refinement (useLegacyImplementation=false): the 4D distance-geometry terms plus harmonic 1-2/1-3 distances, linear angles, experimental torsions and planarity, evaluated by block-per-molecule kernels in single and double precision like the other force fields. The all-in-one terms reuse the DG/ETK device helpers; only the planarity term is new. The DG gradient kernel's shared-memory accumulation is shared with the new kernel. constructAllInOneForceFieldContribs mirrors RDKit's DistGeom::constructAllInOneForceField plus addTorsionTerms and takes its force constants from CrystalFFDetails::forceConsts. Tests compare each term family and the whole force field against RDKit in both minimization phases and both precisions. RDKit 2026.09's torsion gradient mis-evaluates the six-fold term (fixed in rdkit/rdkit#9699), so the torsion gradient reference is a central difference of RDKit's energy.
Collaborator
Author
|
PR 1/2 for #287 |
Contributor
[Medium impact] The latest change appears safe to merge and fixes the previous performance concern.
|
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
evasnow1992
reviewed
Oct 23, 2026
|
|
||
| #include "versions.h" | ||
|
|
||
| #if RDKIT_AIO_ETKDG_API |
Collaborator
There was a problem hiding this comment.
Just wanted to confirm that these new tests aren't currently enabled in our CI pipeline, since our CI uses older RDKit versions. They're only exercised when running tests locally with RDKit 2026.03.4 or later, correct?
Collaborator
Author
There was a problem hiding this comment.
That's right, but I'll be updating CI shortly
evasnow1992
approved these changes
Oct 23, 2026
evasnow1992
left a comment
Collaborator
There was a problem hiding this comment.
Just one clarification question. Changes look good to me.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Batched force field for RDKit's all-in-one ETKDG refinement (useLegacyImplementation=false): the 4D distance-geometry terms plus harmonic 1-2/1-3 distances, linear angles, experimental torsions and planarity, evaluated by block-per-molecule kernels in single and double precision like the other force fields. The all-in-one terms reuse the DG/ETK device helpers; only the planarity term is new. The DG gradient kernel's shared-memory accumulation is shared with the new kernel.