bjing2016 / alphaflow

AlphaFold Meets Flow Matching for Generating Protein Ensembles
MIT License
285 stars 41 forks source link

Dockerfile or CUDA 12 #11

Open Chokyotager opened 3 months ago

Chokyotager commented 3 months ago

Hi,

Thanks for the wonderful work. I am planning on doing some conformation sampling using this work, but unfortunately it seems like the hard requirement of CUDA 11.6 is an issue. I've tried different installers on CUDA 12 and can't get it to work but unfortunately the machines I have access to are all CUDA 12.

It seems like OpenFold has a branch pl_upgrades that can support CUDA 12+ - would it be possible to do a port forward on this branch or provide a Dockerfile?

Thanks.

Raul-araya-secchi commented 3 months ago

I'm having a similar issue. I have accest to CUDA12 GPUs and tried to install a CUDA12 fiendly version of pytorch but a host of issues have appeared during the compilation of openfold. :-(

KithminiHerath commented 2 months ago

By any chance, does the error you encounter on CUDA 12, look like this?

UPDATE: This seems to be an issue with openfold not detecting cuda. If in case anyone bumps into a similar problem checkout https://github.com/aqlaboratory/openfold/issues/293#issuecomment-2058255494

Traceback (most recent call last):
  File "/home/jupyter/alphaflow/predict.py", line 137, in <module>
    main()
  File "/home/jupyter/.conda/envs/alphaflow/lib/python3.9/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/home/jupyter/alphaflow/predict.py", line 123, in main
    prots = model.inference(batch, as_protein=True, noisy_first=args.noisy_first,
  File "/home/jupyter/alphaflow/alphaflow/model/wrapper.py", line 375, in inference
    output = self.model(batch, prev_outputs=prev_outputs)
  File "/home/jupyter/.conda/envs/alphaflow/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/jupyter/alphaflow/alphaflow/model/alphafold.py", line 284, in forward
    z = self.extra_msa_stack(
  File "/home/jupyter/.conda/envs/alphaflow/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/jupyter/.conda/envs/alphaflow/lib/python3.9/site-packages/openfold/model/evoformer.py", line 1006, in forward
    m, z = b(m, z)
  File "/home/jupyter/.conda/envs/alphaflow/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/jupyter/.conda/envs/alphaflow/lib/python3.9/site-packages/openfold/model/evoformer.py", line 517, in forward
    self.msa_att_row(
  File "/home/jupyter/.conda/envs/alphaflow/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/jupyter/.conda/envs/alphaflow/lib/python3.9/site-packages/openfold/model/msa.py", line 277, in forward
    m = self.mha(
  File "/home/jupyter/.conda/envs/alphaflow/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/jupyter/.conda/envs/alphaflow/lib/python3.9/site-packages/openfold/model/primitives.py", line 492, in forward
    o = attention_core(q, k, v, *((biases + [None] * 2)[:2]))
  File "/home/jupyter/.conda/envs/alphaflow/lib/python3.9/site-packages/openfold/utils/kernel/attention_core.py", line 47, in forward
    attn_core_inplace_cuda.forward_(
RuntimeError: attn_softmax_inplace_forward_ not implemented on CPU