How to avoid GPU OOM when predicting large multimer complexes (>2500 residues) in AlphaFold 3?
2 hours agoWe are attempting to fold a 4-chain ternary complex (~2600 residues total) using the local AF3 pipeline on a single NVIDIA A100 80GB SXM. The pairformer attention matrix explodes during the diffusion head evaluation, throwing CUDA out of memory. Has anyone found working chunking or CPU-offloading flags?
Answers (2)
You can enable chunked pairformer cross-attention and gradient checkpointing inside the model runner config. In your run script or Python wrapper, set `pairformer_chunk_size=128` and offload the MSA sequence representations after the initial embedding pass:
# Modify runner config in model_eval.py:
model_config = AlphaFold3Config(
pairformer_chunk_size=128,
gradient_checkpointing=True,
offload_msa_to_cpu=True,
diffusion_batch_size=1
)
predictions = model.predict(multimer_features)If you have access to multi-GPU nodes, AF3 supports sequence parallelism across 2x A100/H100 cards via PyTorch FSDP or DeepSpeed ZeRO-3.