openmm / openmm-ml

High level API for using machine learning models in OpenMM simulations
Other
76 stars 25 forks source link

Errors with ANI #23

Open peastman opened 2 years ago

peastman commented 2 years ago

I'm trying to use this on a new computer (an ARM Mac) for the first time, and I ran into an error I've never seen before. When it tries to compile the TorchANI model to TorchScript, I get the exception

RuntimeError: Could not cast attribute '_species_to_tensor' to type __torch__.torchani.utils.ChemicalSymbolsToInts (of Python compilation unit at: 0x600002facc98): Could not cast attribute 'rev_species' to type Dict[Tensor, int]: Unable to cast Python instance to C++ type (compile in debug mode for details)

I have PyTorch 1.10.0 and TorchANI 2.2, both installed from conda-forge. Has anyone seen this before?

raimis commented 2 years ago

TorchANI 2.2 or 2.2.2?

peastman commented 2 years ago

2.2. That's the most recent version available on conda-forge. They have 2.2.2 for linux-64 and osx-64, but only 2.2 for everything else.

peastman commented 2 years ago

2.2 is also the most recent release at https://github.com/aiqm/torchani.

raimis commented 2 years ago

The same issue like https://github.com/aiqm/torchani/issues/598. You need TorchANI 2.2.2.

raimis commented 2 years ago

2.2 is also the most recent release at https://github.com/aiqm/torchani.

They released TorchANI 2.2.2 (https://github.com/conda-forge/torchani-feedstock/pull/3), but not updated https://github.com/aiqm/torchani

peastman commented 2 years ago

Where can I get it from? It's neither on conda-forge nor github.

peastman commented 2 years ago

I installed the latest TorchANI code from the main branch on github. I don't know whether that corresponds to 2.2.2, but it fixed the problem. We should make sure the noarch conda build gets updated before we release OpenMM-ML. Otherwise, we'll be getting a lot of bug reports from Mac and Windows users.

jchodera commented 2 years ago

Can we add this to the GitHub Actions CI on @mikemhenry's box?

raimis commented 2 years ago

I installed the latest TorchANI code from the main branch on github. I don't know whether that corresponds to 2.2.2, but it fixed the problem.

Yes, it is on master (https://github.com/aiqm/torchani/releases/tag/2.2.2)

We should make sure the noarch conda build gets updated before we release OpenMM-ML. Otherwise, we'll be getting a lot of bug reports from Mac and Windows users.

Since TorchANI 2.2.1, it is not longer noarch, because of cuAEV (https://github.com/aiqm/torchani/blob/master/torchani/cuaev/README.md). It seems only Linux supported fully (https://anaconda.org/conda-forge/torchani/files). The Mac packages are built without CUDA. The Windows packages don't exist.

raimis commented 2 years ago

Ping @yueyericardo

peastman commented 2 years ago

No CUDA on Mac is fine, but there's only a package for x86, not ARM.

yueyericardo commented 2 years ago

Hi, sorry for that! We will release a new version for noarch soon (maybe today or tomorrow).

peastman commented 2 years ago

Thanks!

yueyericardo commented 2 years ago

Hi, osx_arm64 2.2.2 is added at https://github.com/conda-forge/torchani-feedstock/pull/4, but sorry that we currently don't have time to investigate the ways to build windows version.

For osx_arm64 it could be installed with

conda install -c conda-forge torchani==2.2.2

torchani==2.2.2 is necessary, otherwise it will install noarch which is 2.2