Skip to main content

Batch Processing Multiple Inputs

AlphaFold 3 supports efficient batch processing of multiple predictions through directory-based input, MSA reuse, and database sharding. This guide covers strategies for high-throughput structure prediction.

Basic Batch Processing

Processing Multiple Input Files

Instead of processing a single JSON file, you can provide a directory containing multiple input files:

Input Directory Structure

AlphaFold 3 will process each JSON file sequentially.
All JSON files in the input directory must be valid AlphaFold 3 input files following the alphafold3 dialect.

Efficient MSA Reuse

For large-scale experiments, compute MSAs once and reuse them across multiple predictions.

Strategy 1: Fixed Chains with Varying Partners

When folding multiple candidates with fixed chains:
1

Compute MSAs for Fixed Chains

Run data pipeline once for chains that don’t change:
2

Create Multimer Inputs

For each multimer, populate fixed chain data from pre-computed MSAs:
3

Run Full Pipeline

The pipeline will compute MSAs only for chains without pre-computed data:

Strategy 2: All Pairwise Combinations

For n × m combinatorial experiments:
Process each chain individually:

Efficiency Gains

Example: 10 chains × 10 chainsWithout MSA reuse:
  • 100 full runs (data pipeline + inference)
  • ~100 hours on single machine
With MSA reuse:
  • 20 data pipeline runs
  • 100 inference-only runs
  • ~30 hours total (70% time savings)
With MSA reuse + parallelization (4 GPUs):
  • ~10 hours total (90% time savings)

Database Sharding

For maximum throughput on multi-core systems, shard genetic databases to parallelize searches.

What is Database Sharding?

Split large sequence databases into multiple smaller files (shards) that can be searched in parallel.
1

Shuffle Sequences

Randomize sequence order for balanced shards:
2

Split into Shards

Divide into equal parts:
3

Calculate Database Statistics

For correct e-value scaling:

Sharding Naming Convention

Shards must follow this pattern:
Where:
  • shard_index: 5 digits, 0-padded, starts at 00000
  • total_shards: 5 digits, 0-padded
Examples:
  • uniprot.fasta-00000-of-00064
  • uniprot.fasta-00063-of-00064
  • bfd.fasta-00000-of-00256
File spec format: <prefix>@<total_shards>
  • Example: uniprot.fasta@64

Using Sharded Databases

Calculating Parallelization

For protein chains:
For RNA chains:
Ensure your machine has sufficient cores and memory bandwidth. Over-parallelization can slow down performance.

Shard Size Guidelines

Aim for consistent shard sizes across databases:
  • If database A is 3× smaller than database B
  • And database B has 48 shards
  • Then database A should have 48 ÷ 3 = 16 shards
This ensures balanced work distribution.

Multiple Random Seeds

Generate multiple predictions with different random seeds:
AlphaFold 3 will run inference once for each seed, producing n structures.

Batch Seeds Processing

For large-scale seed ensembles:

Parallel Processing Strategies

Strategy 1: Multiple Processes

Strategy 2: Multiple GPUs

Strategy 3: HPC Cluster (SLURM)

Submit:

Performance Optimization

Compilation Cache

Reduce recompilation time by enabling persistent cache:
After the first compilation, subsequent runs with similar token counts will reuse cached compilations, saving 10-30 minutes per run.

Bucket Configuration

Optimize bucket sizes for your input distribution:

Memory Optimization

For large batches on limited GPU memory:

Complete Batch Processing Example

Monitoring and Logging

Track progress of batch jobs:

References

From performance.md:27-61:
From input.md:5-10: