Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch forward method of the EMLE class #39

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

JMorado
Copy link
Contributor

@JMorado JMorado commented Nov 25, 2024

Hi,

Building on the changes made to the forward method of EMLEBase, this PR introduces a batched forward method for the EMLE class. The implementation is designed to be TorchScript-compatible and significantly improves (over 100-fold) the speed of static and induced EMLE predictions for batched use cases.

This implementation has been very effective in accelerating some of my workflows/use cases. I’ve made efforts to ensure the changes are backward-compatible, but I’m happy to answer any questions or address any concerns.

Thank you!

@JMorado JMorado force-pushed the feature_batch_predictions branch from 800306d to 94ec417 Compare November 25, 2024 18:22
@lohedges
Copy link
Contributor

Many thanks for this, much appreciated. I had implement this crudely a while back on a local branch but it makes much more sense to add it now that the base class is batched. I should be able to take a look this afternoon. I mostly want to check any performance hit for supporting batched and non-batched tensors, although I don't think this should be an issue. If it makes more sense to just support batched use in future, then I can adjust the Sire TorchQMForce API for the next Sire release and we can drop the non-batch use for the EMLE models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants