HeliXonProtein / OmegaFold

OmegaFold Release Code
Apache License 2.0
532 stars 75 forks source link

Fix for older versions of pytorch #35

Closed jnooree closed 1 year ago

jnooree commented 1 year ago

Current _get_device function will raise AttributeError if mps import was failed. This patch will handle such exception and set the device to cpu add a function named _mps_is_available to resolve such issue.

RuiWang1998 commented 1 year ago

Great! Thanks for this pr. However, could you help us by telling us about your setup? Mostly your PyTorch setup so that we can be sure.

jnooree commented 1 year ago

The PyTorch version has nothing to do with this PR. It's all about the try-import code.

https://github.com/HeliXonProtein/OmegaFold/blob/bea366327f4875d9412dc54b1fcfe308092a72a0/omegafold/pipeline.py#L44-L47

The problematic function, FYI:

https://github.com/HeliXonProtein/OmegaFold/blob/bea366327f4875d9412dc54b1fcfe308092a72a0/omegafold/pipeline.py#L267-L297

None does not have an attribute is_available, indeed.

RuiWang1998 commented 1 year ago

ok!