Alphafold3
AlphaFold 3, introduced in May 2024 by Google DeepMind in collaboration with Isomorphic Labs, marks a significant advance in computational biology. Building on the groundbreaking success of AlphaFold 2 in protein structure prediction, AlphaFold 3 expands the scope of structure prediction to model the three-dimensional structures and interactions of a broader range of biomolecules, including proteins, DNA, RNA, ligands, and ions.
Package availability¶
| Compute node type | Available |
|---|---|
| CPU | ✓ |
| NVIDIA A100 GPU | ✓ |
| NVIDIA Grace Hopper GPU | ✓ |
Request model parameters¶
To run AlphaFold 3, you must obtain the model parameters separately.
To request access, please complete the AlphaFold 3 model parameters request form provided by Google DeepMind. Access is granted at the sole discretion of Google DeepMind, and responses to requests typically take 2–3 business days.
You may use the AlphaFold 3 model parameters only if they are provided directly by Google DeepMind. Use of the model parameters is subject to the applicable terms of use.
Run AlphaFold 3¶
AlphaFold 3 can be executed in multiple stages to optimise resource utilisation. In particular, the CPU-only data pipeline can be separated from model inference, which requires a GPU. This allows each stage to run on the most appropriate and cost-effective compute resources.
The genetic database searches performed during the data pipeline can also be significantly accelerated by splitting the databases into multiple shards and searching these shards in parallel. For this reason, we recommend separating an AlphaFold 3 analysis into the following Slurm jobs:
- Data pipeline — CPU-only; run on a full CPU node.
- Model inference — GPU-accelerated; run on a GPU node.
Model parameters
You must provide the path to the AlphaFold 3 model parameters directory supplied to you or your group by Google DeepMind using the --model_dir flag.
1. Data pipeline (CPU only)¶
The following example runs the data pipeline on a full CPU node. The database searches are distributed across multiple shards to maximise CPU utilisation.
#!/bin/bash -e
#SBATCH --job-name=alphafold3_data_pipeline
#SBATCH --cluster=merlin7
#SBATCH --partition=hourly
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=256
#SBATCH --time=01:00:00
#SBATCH --output=alphafold3_data_pipeline_%j.log
#SBATCH --mem=0
#SBATCH --exclusive
module purge
module load alphafold3
srun --cpu-bind=threads alphafold3_sharded \
--json_path /path/to/json/input.json \
--model_dir /path/to/model_parameters \
--output_dir /path/to/output \
--run_inference=false \
--run_data_pipeline=true \
--jackhmmer_n_cpu=1 \
--jackhmmer_max_parallel_shards=$((SLURM_CPUS_PER_TASK / 4)) \
--nhmmer_n_cpu=1 \
--nhmmer_max_parallel_shards=$((SLURM_CPUS_PER_TASK / 4))
Required parameters¶
The following parameters must be specified for every AlphaFold 3 run:
| Parameter | Description |
|---|---|
--json_path |
Path to the input JSON file. |
--model_dir |
Path to the directory containing the AlphaFold 3 model parameters. |
--output_dir |
Path to the directory where the results will be saved. |
Performance parameters¶
The following parameters control the number of database shards searched in parallel:
| Parameter | Description |
|---|---|
--jackhmmer_max_parallel_shards |
Maximum number of database shards searched in parallel by JackHMMER. |
--nhmmer_max_parallel_shards |
Maximum number of database shards searched in parallel by NHMMER. |
If the job takes a long time to start
In the example above, each database search uses one CPU per process, with up to 64 shards searched in parallel. Four protein databases are searched concurrently, resulting in:
1 CPU × 64 parallel shards × 4 concurrent database searches = 256 CPUs
This configuration is designed to utilise the full 256-CPU node.
If the job is slow to start due to limited cluster availability, you can reduce the number of parallel shards to request fewer resources by reducing --cpus-per-task and --mem.
Non-sharded databases run¶
You can also run the data pipeline on non-sharded databases. The benchmark results between the two option are displayed below.
#!/bin/bash -e
#SBATCH --job-name=alphafold3_data_pipeline
#SBATCH --cluster=merlin7
#SBATCH --partition=hourly
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=256
#SBATCH --time=01:00:00
#SBATCH --output=alphafold3_data_pipeline_%j.log
#SBATCH --mem=0
#SBATCH --exclusive
module purge
module load alphafold3
srun --cpu-bind=threads alphafold3 \
--json_path /path/to/json/input.json \
--model_dir /path/to/model_parameters \
--output_dir /path/to/output \
--run_inference=false \
--run_data_pipeline=true \
--jackhmmer_n_cpu=$((SLURM_CPUS_PER_TASK / 4)) \
--nhmmer_n_cpu=$((SLURM_CPUS_PER_TASK / 4))
Benchmark results¶
These results are representative of a large, heterogeneous protein–protein complex prediction workload using AlphaFold 3. The input consists of two protein chains, with chain A being an exceptionally long, highly repetitive and compositionally complex protein (approximately 3,000 residues) and chain B being a long, predominantly helical protein (approximately 600 residues). Thus, the benchmark represents a large protein–protein complex prediction with substantial sequence length and structural complexity, rather than a typical small single-protein prediction.
They also compare running with sharded databases and non-sharded.
| Run | Version | CPU (Threads) | Memory (Gb) | Total time (HH:MM:SS) |
|---|---|---|---|---|
| alphafold3_sharded | 3.0.4 | 256 | 472 | 00:12:10 |
| alphafold3 | 3.0.4 | 256 | 472 | 00:29:05 |
| alphafold3_sharded | 3.0.4 | 128 | 236 | 00:24:23 |
| alphafold3 | 3.0.4 | 128 | 236 | 00:29:58 |
| alphafold3_sharded | 3.0.4 | 64 | 118 | 00:32:46 |
| alphafold3 | 3.0.4 | 64 | 118 | 00:37:08 |
| alphafold3_sharded | 3.0.4 | 32 | 59 | 01:02:00 |
| alphafold3 | 3.0.4 | 32 | 59 | 01:06:52 |
2. Inference (GPU only)¶
The inference stage requires a GPU and should be run separately from the CPU-only data pipeline. The following examples show how to run AlphaFold 3 on an NVIDIA A100 GPU node and a Grace Hopper GPU node.
NVIDIA A100 GPU¶
#!/bin/bash -e
#SBATCH --job-name=alphafold3_inference
#SBATCH --cluster=gmerlin7
#SBATCH --partition=a100-hourly
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=32
#SBATCH --time=01:00:00
#SBATCH --output=alphafold3_inference_%j.log
#SBATCH --mem=100G
#SBATCH --gres=gpu:1
module purge
module load alphafold3
srun alphafold3 \
--json_path /path/to/input.json \
--model_dir /path/to/model_params \
--output_dir /path/to/outputs \
--run_inference=true \
--run_data_pipeline=false
Grace Hopper GPU¶
#!/bin/bash -e
#SBATCH --job-name=alphafold3_inference
#SBATCH --cluster=gmerlin7
#SBATCH --partition=gh-hourly
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=72
#SBATCH --time=01:00:00
#SBATCH --output=alphafold3_inference_%j.log
#SBATCH --mem=100G
#SBATCH --gres=gpu:1
module purge
module load alphafold3
srun alphafold3 \
--json_path /path/to/input.json \
--model_dir /path/to/model_params \
--output_dir /path/to/outputs \
--run_inference=true \
--run_data_pipeline=false
Resource allocation
Adapt the sbatch script to the resources required by your job. For example, you may need to increase the number of GPUs or the amount of memory allocated.
Required parameters¶
| Parameter | Description |
|---|---|
--json_path |
Path to the input JSON file. |
--model_dir |
Path to the directory containing the AlphaFold 3 model parameters. |
--output_dir |
Path to the directory where the results will be saved. |
Optional parameters¶
To use the JAX persistent compilation cache and avoid unnecessary recompilation between runs, specify:
Benchmark results¶
| Run | Version | GPUs | CPU (Threads) | Memory (Gb) | Total time (HH:MM:SS) |
|---|---|---|---|---|---|
| GH | 3.0.4 | 1 | 72 | 100 | 00:26:16 |
| A100 | 3.0.31 | 1 | 32 | 100 | 00:41:47 |
-
Running with version 3.0.4 resulted in CUDA OOM errors. ↩