openmm-ml icon indicating copy to clipboard operation
openmm-ml copied to clipboard

Errors with ANI

Open peastman opened this issue 3 years ago • 14 comments

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?

peastman avatar Feb 16 '22 19:02 peastman

TorchANI 2.2 or 2.2.2?

raimis avatar Feb 16 '22 19:02 raimis

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 avatar Feb 16 '22 19:02 peastman

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

peastman avatar Feb 16 '22 19:02 peastman

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

raimis avatar Feb 16 '22 19:02 raimis

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

raimis avatar Feb 16 '22 19:02 raimis

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

peastman avatar Feb 16 '22 19:02 peastman

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.

peastman avatar Feb 16 '22 20:02 peastman

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

jchodera avatar Feb 17 '22 00:02 jchodera

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 avatar Feb 17 '22 10:02 raimis

Ping @yueyericardo

raimis avatar Feb 17 '22 10:02 raimis

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

peastman avatar Feb 17 '22 16:02 peastman

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

yueyericardo avatar Feb 17 '22 17:02 yueyericardo

Thanks!

peastman avatar Feb 17 '22 17:02 peastman

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

yueyericardo avatar Feb 21 '22 17:02 yueyericardo