Running AlphaFold 3 on DaVinci

Ampere cards

Turing cards

Performance

The following environment variables are set by module load AlphaFold/3.0.0:

You can change these and tweak the performance by following the documentation.

I have not adjusted pair_transition_shard_spec in model_config.py as suggested in the performance documentation, but it could be an option when running into memory problems.

Running AlphaFold 2

Running AlphaFold 2 on DaVinci

Visualizing the results

shows that model_3_ptm is the top ranked model.

Installing AlphaFold

Installing AlphaFold 3

Make sure python binaries end up in the scratch filesystem. Otherwise they will be placed in the home directory of the user that creates the environment:

export UV_PYTHON_INSTALL_DIR=/scratch/burst/uv

mkdir -p /scratch/burst/alphafold-3
uv venv --python 3.11 /scratch/burst/alphafold-3/

source /scratch/burst/alphafold-3/bin/activate
uv pip install pip

# Not part of Dockerbuild but necessary
uv pip install setuptools

Install hmmer:

mkdir /scratch/burst/alphafold-3/src
cd /scratch/burst/alphafold-3/src
mkdir hmmer_build hmmer
wget http://eddylab.org/software/hmmer/hmmer-3.4.tar.gz --directory-prefix /scratch/burst/alphafold-3/src/hmmer_build
(cd hmmer_build && tar zxf hmmer-3.4.tar.gz && rm -f hmmer-3.4.tar.gz)
(cd hmmer_build/hmmer-3.4 && ./configure --prefix /scratch/burst/alphafold-3/)
(cd hmmer_build/hmmer-3.4 && make -j)
(cd hmmer_build/hmmer-3.4 && make install)
(cd hmmer_build/hmmer-3.4/easel && make install)
git clone https://github.com/google-deepmind/alphafold3.git
cd alphafold3
pip3 install -r dev-requirements.txt
pip3 install --no-deps .
build_data
mkdir /scratch/burst/alphafold-3/share/alphafold3
yum install -y zstd
bash /scratch/burst/alphafold-3/src/alphafold3/fetch_databases.sh /scratch/burst/alphafold-3/share/alphafold3/public_databases

Fix permissions on database:

chmod 755 /scratch/burst/alphafold-3/share/alphafold3/public_databases/mmcif_files
chmod -R +r /scratch/burst/alphafold-3/share/alphafold3/public_databases/mmcif_files

Copy over the model:

mkdir /scratch/burst/alphafold-3/share/alphafold3/models
mv <model.zstd> /scratch/burst/alphafold-3/share/alphafold3/models
cd /scratch/burst/alphafold-3/share/alphafold3/models
unzstd <model.zstd>

This part is not part of the docker. Just move the running scripts into the path and fix some paths:

cp /scratch/burst/alphafold-3/src/alphafold3/run_alphafold.py /scratch/burst/alphafold-3/bin/

Point to the place where we put the data instead ot the default /root:

sed -i "s|_HOME_DIR = pathlib\.Path(os\.environ\.get('HOME'))|_HOME_DIR = pathlib.Path('/scratch/burst/alphafold-3/share/alphafold3/')|" /scratch/burst/alphafold-3/bin/run_alphafold.py
cp /scratch/burst/alphafold-3/src/alphafold3/run_alphafold_test.py /scratch/burst/alphafold-3/bin/

Make the scripts executable and add a shebang:

chmod +x /scratch/burst/alphafold-3/bin/run_alphafold.py
chmod +x /scratch/burst/alphafold-3/bin/run_alphafold_test.py
sed -i '1s/^/\#\!\/usr\/bin\/env python\n/' /scratch/burst/alphafold-3/bin/run_alphafold.py
sed -i '1s/^/\#\!\/usr\/bin\/env python\n/' /scratch/burst/alphafold-3/bin/run_alphafold_test.py