Add explicit gradients to the LLPR energy ensemble - #1210
Merged
ppegolo merged 2 commits intoJul 24, 2026
Conversation
ppegolo
force-pushed
the
energy-ensemble-explicit-gradients
branch
2 times, most recently
from
July 21, 2026 13:28
801da6a to
476ae9c
Compare
Contributor
Author
|
cscs-ci run |
sofiia-chorna
left a comment
Collaborator
There was a problem hiding this comment.
thanks a lot! i added some questions
ppegolo
force-pushed
the
energy-ensemble-explicit-gradients
branch
from
July 24, 2026 11:42
2c86267 to
16f5630
Compare
sofiia-chorna
approved these changes
Jul 24, 2026
sofiia-chorna
left a comment
Collaborator
There was a problem hiding this comment.
thanks! looks good on my side
Collaborator
|
cscs-ci run |
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.
The
energy_ensembleoutput can now returnpositionsandstraingradients, so one can get per-ensemble-member forces and stresses straight from the exported model, and can use their spread as an uncertainty estimate or propagate the ensemble to other observables (e.g., phonon bands).In other words, this feature is required to be able to easily request conservative forces and stress ensembles for a model.
To comply with metatomic, the properties of the energy ensemble TensorMap had to be changed to
energy, with a single column enumerating members. Non-energy targets keep the previous["ensemble_member", <target>]format.The gradients have to be computed in a loop over members instead of setting
is_grads_batched=Trueto compy with TorchScript.LLPR tests tend to not use shared testing utilities, so I added a new test file. Probably it could be made to use the shared utilities more, but I think it requires modifying them enough to go outside of the scope of the current PR, so it might be delegated to a different one in the future.
Contributor (creator of pull-request) checklist
Maintainer/Reviewer checklist
📚 Documentation preview 📚: https://metatrain--1210.org.readthedocs.build/en/1210/