stfc / janus-core

Tools for machine learnt interatomic potentials
https://stfc.github.io/janus-core/
BSD 3-Clause "New" or "Revised" License
9 stars 7 forks source link

Fix setting devices #208

Closed ElliottKasoar closed 1 month ago

ElliottKasoar commented 1 month ago

Resolves #95

It's not in the main branch of MACE yet, but as mentioned in #95, there's no reason not to allow xpu in theory, so I've added it.

More importantly, in the process of extending the allowed devices, I realised that device was not passed to MACE-MP, or MACE-OFF, so this should now be fixed.

Also adds a test that the chosen device is valid, as the PyTorch error isn't particularly clear:

RuntimeError: don't know how to restore data location of torch.storage.UntypedStorage (tagged with invalid)

This should perhaps be three PRs, but they're interconnected and otherwise very minor...