To ensure usability, we forked the OpenFold repo, and sorted a couple details in the installation guides. Here is what we advise ROCKET users to do:
Note: The openfold installation requires approximately 6 GB of free space to download weights. Please ensure you start in a directory with sufficient available space.
Note: To ensure a smooth installation and execution of ROCKET, install on a GPU machine that matches the hardware you’ll use in production. In other words, for HPC users, if you plan to run your code on a node with a particular GPU model, request the same GPU model when you install OpenFold. This is important because the installation process performs hardware-specific compilation. We also recommend using GPUs with CUDA Compute Capability 8.0 or higher.
Clone our fork of the OpenFold repo, switch to the pl_upgrades branch to work with CUDA 12:
git clone https://github.com/minhuanli/rocket_openfold.git
cd rocket_openfold
git checkout pl_upgrades
Create a conda/mamba env with the environment.yml . Mamba is recommended as the dependencies required by OpenFold are quite large and mamba can speed up the process. If you installed Conda instead of Mamba, adjust the commands provided below by simply replacing any instance of mamba with conda.
Note: If you work with an HPC cluster with package management like module, purge all your modules before this step to avoid conflicts.
The main change we made is moving the flash-attn package outside of the yml file, so you can install it manually afterwards. This is necessary because this OpenFold version relies on pytorch 2.1, which is incompatible with the latest flash-attn, so a simple pip install flash-attn would fail. Also using a --no-build-isolation flag allows using ninja for compilation, which is much faster.
Install compatible flash-attn (latest flash-attn with noted support for pytroch-2.1 + cuda-12.1)
<ABSOLUTE_PATH_TO_OPENFOLD_FOLDER> should be the output of pwd -P you get from the OpenFold repo path.
Deactivate and reactivate your python environment, you should be able to run and see the path:
echo $OPENFOLD_RESOURCES
Check your OpenFold build with unit tests:
./scripts/run_unit_tests.sh
Ensure you see no errors:
...
Time to load evoformer_attn op: 243.8257336616516 seconds
............s...s.sss.ss.....sssssssss.sss....ssssss..s.s.s.ss.s......s.s..ss...ss.s.s....s........
----------------------------------------------------------------------
Ran 117 tests in 275.889s
OK (skipped=41)
Install Phenix
(Required for automatic preprocessing and post-refinement)
Phenix is required for automatic data preprocessing and for post-refinement when polishing final model geometry. Follow the steps below to install it and add the path to the system environment variables:
Download the latest nightly-build Phenix python3 installer according to https://phenix-online.org/download, note your PHENIX version has to be at least updated to 2.0rc1-5647
Run the installer
You will be prompted to type your preferred path of installation, after specifying it, you will see:
Note: <phenix_directory> must be a absolute path. The installer will will make <phenix_directory>/phenix-2.0rc1-5647 and install there.
Append the following line to <path_to_your_conda_env>/etc/conda/activate.d/env_vars.sh, you should have created it from the previous section
<phenix_directory> is where you install Phenix in the last step
Deactivate and reactivate your python environment, you should be able to run and see the path:
Install ROCKET
Install ROCKET. First move to the parent folder, clone the ROCKET repo (so you don't mix the ROCKET repo with the OpenFold one), then install it with pip
It will automatically install dependencies like SFcalculator and reciprocalspaceship.
Note: If you get errors about incompatibility of prompt_toolkit, ignore them.
For develop mode, run
Run rk.score --help after installation, if you see a normal doc strings without errors, you are good to go!