MolSSI / QCEngine

Quantum chemistry program executor and IO standardizer (QCSchema).
https://molssi.github.io/QCEngine/
BSD 3-Clause "New" or "Revised" License
163 stars 79 forks source link

Use GPU when invoking torchani #326

Closed kexul closed 2 years ago

kexul commented 2 years ago

Dear molssi developers: I found my workstation is not using GPUs when executing the computing using torchani. Are there some environment variables I need to set?

Here is the code I've used:

import qcengine as qcng
import qcelemental as qcel

mol = qcel.models.Molecule.from_data("""
O  0.0  0.000  -0.129
H  0.0 -1.494  1.027
H  0.0  1.494  1.027
""")
ret = qcng.compute(inp, "torchani")
ret

Here is the output of ret.provenance:

Provenance(creator='torchani', version='unknown', routine='torchani.builtin.aev_computer', wall_time=0.008759737014770508, cpu='Intel(R) Xeon(R) Platinum 8255C CPU @ 2.50GHz', username='root', hostname='VM-121-111-centos', qcengine_version='v0.20.1')
kexul commented 2 years ago

Context: I'm using this https://github.com/openforcefield/bespoke-fit package to refit some force filed parameters, when using torchani as the QC backend, it consumes a lot of memory and ran quite slow, so I'm finding ways to move the model to GPU to accelerate the computation.