HeliXonProtein / OmegaFold

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

Error: buffer is not large enough. in Apple M2 #15

Open S-Shimo opened 1 year ago

S-Shimo commented 1 year ago

Hi OmegaFold team,

Thank you for your previous kind teaching. Now, I try to run OmegaFold in M2 Macbook Pro, and clone repository using gh repo clone HeliXonProtein/OmegaFold. I think that It run normally just before prediction. However, during or after prediction step, the program showed error and was aborted.

Log is below(I'm sorry to hide residues' number, it is less than 300.).

~/Desktop/omega fold/OmegaFold $python main.py --device mps INPUT.fasta OUTPUT_DIR INFO:root:Loading weights from ~/.cache/omegafold_ckpt/model.pt INFO:root:Constructing OmegaFold INFO:root:Reading INPUT.fasta INFO:root:Predicting 1th chain in INPUT.fasta INFO:root:--- residues in this chain. /AppleInternal/Library/BuildRoots/20d6c351-ee94-11ec-bcaf-7247572f23b4/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShaders/MPSCore/Types/MPSNDArray.mm:782: failed assertion `[MPSNDArray, initWithBuffer:descriptor:] Error: buffer is not large enough. Must be 5448 bytes ' zsh: abort python main.py --device mps INPUT.fasta OUTPUT_DIR

Versions: Python 3.10.5

biopython 1.79 certifi 2022.6.15 charset-normalizer 2.1.0 idna 3.3 numpy 1.23.1 Pillow 9.2.0 pip 22.2.2 requests 2.28.1 setuptools 63.4.2 torch 1.13.0.dev20220809 torchaudio 0.14.0.dev20220603 torchvision 0.14.0.dev20220809 typing_extensions 4.3.0 urllib3 1.26.11

I can't distinguish whether this error originate from Pytorch or from Omegafold itself. So this is rather just a report.

Best, Shimo

RuiWang1998 commented 1 year ago

Hi,

Thanks for your interest!

Update the code by git clone and try with smaller --subbatch_size, the default is the number of residues in the sequence.

S-Shimo commented 1 year ago

Hi Rui Wang,

Thanks a lot. When I run command with --subbatch_size 50, it normally run, and result PDB file was generated!

However, I can't see anything when I opened PDB file either in PyMOL or in ChimeraX. I checked the PDB and found that all alpha Carbons are situated at the same position(0.000 0.000 0.000).

I think this problem is caused by abnormal environment such as Apple silicon(GPU, some packages not optimized for Apple silicon, etc...). I have other machines(Linax, Intel mac, Windows) to use this interesting structure prediction tool, and almost all persons who want to use some machine learning may have normal Windows machine. So You should solve other issues first, because this issue is very rare case and not important I think.

Finally, thank you very much for your kind help.

Best, Shimo

RuiWang1998 commented 1 year ago

Hi,

Thanks so much for your understanding!

And yes we are seeing the same issue that you found and it turned out to be more complicated than we thought. Guess that's our dose of warning for using a nightly built.