aiqm / torchani

Accurate Neural Network Potential on PyTorch
https://aiqm.github.io/torchani/
MIT License
460 stars 127 forks source link

Do no require grad in ASE calculator #559

Closed zubatyuk closed 3 years ago

zubatyuk commented 3 years ago

By default, the ANI models are loaded with gradient required on parameters. This slows down ANI in inference mode. Should be a good idea to disable it in the Calculator class. Alternatively, this could be done in BuiltinModel. My quick test of ASE LBFGS optimization shows ~25% speed improvement on CPU and 10% on GPU (tested on Google Colab).