facebookresearch / esm

Evolutionary Scale Modeling (esm): Pretrained language models for proteins
MIT License
3.16k stars 627 forks source link

RUN esmfold on cpu #353

Closed Catiks closed 1 year ago

Catiks commented 1 year ago

I want to run esmfold on only cpu, but i got the following error: RuntimeError: "LayerNormKernelImpl" not implemented for 'Half'

lewu commented 1 year ago

Got the same error while running prediction with --cpu-only flag.

tomsercu commented 1 year ago

This is due to the ESM2 LM trunk being loaded in fp16 by default, and CPU not supporting fp16. @nikitos9000 maybe we can simply modify the inference script on L133 to move the LM to fp32?

Also see the huggingface notebook - open in colab.

tomsercu commented 1 year ago

Should be fixed now in #360 Will close for now, please let us know if any further issue!

jmrussell commented 1 year ago

I'm probably missing something obvious but I'm still getting this error, even after uninstalling and reinstalling with

pip install git+https://github.com/facebookresearch/esm.git

esm reports version 2.0.1

nikitos9000 commented 1 year ago

Is scripts/esmfold_inference.py still your entrypoint? Could you please check if you have this line as in PR https://github.com/facebookresearch/esm/pull/360/files#diff-5c27367cac97a707aa8cedecbf7726c1e817e644fe4a999548d52ed96dffb483R129 ?

jmrussell commented 1 year ago

Is scripts/esmfold_inference.py still your entrypoint? Could you please check if you have this line as in PR https://github.com/facebookresearch/esm/pull/360/files#diff-5c27367cac97a707aa8cedecbf7726c1e817e644fe4a999548d52ed96dffb483R129 ?

ah removing everything then using pip again and copying the scripts/esmfold_inference.py resolved the issue, I am just bad at git. thanks for the quick response.