Performance in OpenFold3 NIM
NIM Accuracy
OpenFold3 is an all-atom biomolecular complex structure prediction model from the OpenFold Consortium and the AlQuraishi Laboratory. OpenFold3 is a PyTorch implementation of the jax-based AlphaFold3 reported in Accurate structure prediction of biomolecular interactions with AlphaFold 3, and like AlphaFold3, OpenFold3 extends protein structure prediction capabilities to model complete biomolecular complexes including proteins, DNA, RNA, and small molecule ligands.
The OpenFold3 NIM’s accuracy should match that of the AlQuraishi Laboratory implementation of OpenFold3, when using equivalent parameters and inputs.
Running on hardware that is not listed as supported in the prerequisites section may produce results that deviate from the expected accuracy.
The accuracy of the NIM is measured by structural quality metrics such as lddt (local distance difference test). These scores help assess the reliability of the predicted structures.
Factors Affecting NIM Performance
The performance of the OpenFold3 NIM is determined by several key factors:
Hardware Factors
- GPU type and memory: Different GPU architectures provide different performance levels
- System RAM: Larger proteins and complexes require more system memory
- Storage speed: Fast NVMe SSD storage improves model loading and caching performance
Input Complexity
- Sequence length: Runtime scales with total sequence length
- Number of chains: Multi-chain complexes require more computation than single chains
- MSA size: Larger MSAs can improve accuracy but increase memory usage and computation time
- Ligands, DNA, RNA: Additional molecular components increase computational cost
Model Configuration
- Inference backend: TensorRT + cuEquivariance provides significant speedups over PyTorch
- Diffusion samples: Multiple samples provide diversity but multiply computational cost
- MSA depth: Deeper MSAs improve accuracy with modest runtime increase
Performance Characteristics
Typical Runtimes
For reference, approximate runtimes on high-end hardware (NVIDIA H100 80GB):
Structure Prediction (OpenFold3 v1.0.0 on H100 with TensorRT + cuEquivariance):
- ~200 residues: 11.8-14.5 seconds
- ~300-400 residues: 15.0-20.4 seconds
- ~500-600 residues: 21.5-25.7 seconds
- ~800-900 residues: 32.7 seconds
- ~1300-1500 residues: 46.5-67.9 seconds
- ~1700-1900 residues: 88.7-101.8 seconds
- Memory usage: Varies with sequence length, typically 40-80GB GPU memory
Performance Notes The total runtime for structure prediction depends on:
- Total number of residues in the complex
- Total number of atoms in the complex
- Number of molecules and chains
- Number of sequences in the MSAs
- Number of diffusion samples requested
Performance Results on H100 (NVIDIA H100 80GB)
Structure Prediction Performance
The following table shows runtime performance for OpenFold3 NIM on NVIDIA H100 GPUs across different inference backends. The rightmost column shows speedup at settings where structural template processing is not active. These backends are described in Backend Selection and in Backend Optimization Options.
Structural template support is available starting from version 1.1.0.
All runtimes are in seconds for end-to-end structure prediction with a single diffusion sample. The template measurements include an average of 4 CIF template files per protein chain. The additional time is primarily attributed to CIF parsing.
Performance Analysis
Key Observations:
- OpenFold3 NIM Optimization: Provides consistent 1.15x to 1.69x speedup over the open source OF3 baseline
- cuEquivariance Acceleration: PyTorch + cuEquivariance shows speedups for larger proteins, demonstrating the value of cuEquivariance optimization
- Scaling Behavior: Performance scales with sequence length
- Best Performance: Largest speedups (1.6x-1.69x) observed for proteins in the 1400-1500 residue range
- Small Proteins: Still achieve significant speedups (1.2x-1.4x) even for sequences under 400 residues
Template Processing Impact:
- Template overhead: Structural templates add modest overhead (typically 0.3-10 seconds) depending on sequence length
- Small proteins (fewer than 400 residues): Template overhead is ~0.3-4 seconds
- Medium proteins (400-1000 residues): Template overhead is ~2-9 seconds
- Large proteins (>1000 residues): Template overhead is ~1.5-10 seconds
- Primary cost: The additional time is mostly attributed to CIF parsing (average 4 templates per chain)
- Overall impact: Templates provide structural guidance with minimal performance cost
Backend Comparison:
- Open source OF3 (PyTorch + DeepSpeed): Baseline implementation from the openfold consortium, good for development and debugging
- PyTorch + cuEquivariance: Improved performance, especially for larger proteins, while maintaining PyTorch flexibility
- OpenFold3 NIM (TensorRT + cuEquivariance): Best performance across all sequence lengths, recommended for production deployments
Recommended Configuration:
- For development/testing: Use open source OF3 (PyTorch + DeepSpeed) for easier debugging and flexibility
- For production: Use OpenFold3 NIM (TensorRT + cuEquivariance, default) for optimal performance
- For large proteins (>1500 residues): OpenFold3 NIM (TensorRT + cuEquivariance) provides the best speedups (1.6x-1.7x)
- For sequence lengths outside 4-2048 range: Use PyTorch backend as TensorRT has length limitations
- For template-guided predictions: Structural templates add minimal performance overhead
Configuration
The benchmarks use the following configuration:
Performance Optimization Tips
Backend Selection
-
Default (TensorRT + cuEquivariance): Best for most use cases
-
PyTorch + cuEquivariance: For flexibility with good performance
-
PyTorch + DeepSpeed: For debugging or sequences outside TRT range
General Optimization Tips
- GPU Selection: Use H100, H200, or B200 GPUs for optimal performance. A100 and L40S GPUs are also supported.
- TRT Sequence Length Limits: TensorRT mode (default) supports sequences between 4 and 2048 residues. For sequences outside this range, use PyTorch backend.
- Sequence Length: Performance scales with sequence length.
- Multiple Samples: Setting
diffusion_samples > 1will increase runtime in affine fashion (input featurization time is independent ofdiffusion_samples). - MSA Size: While larger MSAs can improve accuracy, they also increase memory usage and computation time. Consider filtering MSAs for very large proteins.
- Structural Templates: Templates add modest overhead (1-10 seconds) but can significantly improve prediction accuracy. See Template Processing for guidance.
- Batch Processing: For multiple independent predictions, process them sequentially or use multiple NIM instances.
- Memory Management: Ensure adequate GPU memory for your target sequence lengths. Very long sequences (>1800 residues) may require GPUs with 80GB+ memory (H100, H200, A100, or B200).
Reproducing Performance Benchmarks
Overview
This section provides scripts and instructions for reproducing the performance metrics reported above. The benchmarking process is as follows:
- Run inference with OpenFold3 NIM to generate predicted structures
- Use OpenStructure (OST) to compare predictions against reference structures
- Extract accuracy metrics like lDDT (local Distance Difference Test)
Prerequisites
Run the OpenFold3 NIM
Before running benchmarks, ensure that OpenFold3 NIM is deployed and running. The benchmarking scripts will send inference requests to the NIM service.
Verify NIM is Running:
The default NIM URL is http://localhost:8000. If your NIM is running on a different host or port, you’ll need to specify it using the --nim-url parameter when running benchmarks. For detailed deployment instructions and configuration options, refer to the Getting Started guide.
Install the OpenStructure Docker Image
OpenStructure is a computational structural biology framework that provides tools for structure comparison and validation. You’ll need the OpenStructure Docker image for running benchmarks:
Download Reference Structures
You’ll need reference structures (ground truth) in CIF format for comparison. These are experimentally determined structures from the Protein Data Bank (PDB):
- CIF (Crystallographic Information File): A standard format for representing molecular structures, including atomic coordinates, experimental metadata, and structural annotations
- Obtaining reference structures: Download from RCSB PDB using the PDB IDs from the performance table (e.g., 8eil, 7r6r, 1a3n)
Example:
Preparing Input JSON Files
What are Input JSON Files?
Input JSON files contain the sequence information needed for OpenFold3 NIM to make predictions. Each file specifies:
- Protein sequences (amino acid chains)
- Chain IDs
- Optional: DNA, RNA, ligands, MSAs, templates
Example Input JSON Structure
Create Input JSON Files
You can create input JSON files by extracting sequences from PDB structures. Save this script as generate_inputs.py:
Benchmarking Script
The following is a complete script to benchmark OpenFold3 NIM predictions. Save this as benchmark_openfold3.py:
Running a Single Benchmark
To run a benchmark for a single structure, follow these steps in order:
Each step must complete successfully before proceeding to the next. Verify that input and reference files exist (Step 4) before running the benchmark (Step 5).
Understanding lDDT Metric
lDDT (local Distance Difference Test) is a robust metric for assessing the quality of predicted protein structures:
- Score Range: 0.0 to 1.0 (or 0 to 100 when expressed as percentage)
- Interpretation:
- lDDT > 0.90: Excellent accuracy, very high confidence
- lDDT 0.70-0.90: Good accuracy, reliable predictions
- lDDT 0.50-0.70: Moderate accuracy, some structural features correct
- lDDT < 0.50: Low accuracy, limited reliability
How lDDT Works:
- Measures local geometric agreement between predicted and reference structures
- Evaluates distances between atoms within local neighborhoods (typically 15Å radius)
- More robust to domain movements and flexible regions compared to global metrics like RMSD
- Focuses on local structural correctness rather than global superposition
Why lDDT for OpenFold3:
- AlphaFold3 and OpenFold3 models are trained to optimize lDDT during the training process
- Well-suited for evaluating multi-chain complexes and structures with flexible regions
- Provides per-residue metrics in addition to global metrics
- Standard metric used in CASP (Critical Assessment of protein Structure Prediction) competitions
Running Benchmarks for Performance Table
To reproduce the performance metrics from the table above, follow these steps in order:
Complete Steps 1 and 2 before running Step 3. The benchmark workflow requires:
- Both Python scripts (
generate_inputs.pyandbenchmark_openfold3.py) saved as files - The bash script (
run_benchmarks.sh) saved as a file - All scripts must be in the same directory before execution
Running steps out of order will result in “File Not Found” errors.
Step 1: Prepare the Python scripts
Save the two Python scripts provided earlier in this document:
generate_inputs.py- Creates input JSON files from PDB (see Preparing Input JSON Files)benchmark_openfold3.py- Runs inference and compares structures (see Benchmarking Script)
Step 2: Create the benchmark workflow script
Save the following as run_benchmarks.sh:
Step 3: Run the complete workflow
The run_benchmarks.sh script handles all steps automatically: generating input files, downloading reference structures, and running benchmarks for all test cases. Make sure the OpenFold3 NIM is running before executing the script.
Expected Output Format
The comparison results JSON file contains detailed metrics:
The primary metric of interest is lddt, which is a float value (0.0 to 1.0) representing the overall structural quality of the prediction. Higher values indicate better agreement with the reference structure.
Troubleshooting
General Performance Issues
- Out of memory errors: Reduce MSA depth, decrease sequence length, or upgrade to GPUs with more memory
- Slow performance: Ensure fast storage (NVMe SSD), sufficient CPU cores, and adequate system RAM
- Poor quality predictions: Check input sequence quality, increase MSA depth if available, or adjust diffusion parameters
Backend-Specific Issues
- TensorRT errors with long sequences: Use PyTorch backend for sequences >2048 residues
- TensorRT errors with short sequences: Use PyTorch backend for sequences of fewer than 4 residues
- Inconsistent results between backends: This is expected; TensorRT uses optimizations that may produce slightly different numerical results while maintaining accuracy
Benchmarking Issues
The following are “File not found” errors.
- “Input file not found”: Generate input JSON files first using
generate_inputs.py - “Reference file not found”: Download CIF files from RCSB PDB
The following are structure comparison issues.
- OpenStructure comparison failures: Ensure both predicted and reference structures have compatible chain IDs and residue numbering
- Missing atoms in predictions: Use
--fault-tolerantflag to handle incomplete structures (already included in script) - lDDT score of 0.0: Check that sequences match between prediction and reference; may indicate alignment failure
The following are NIM connection issues.
- “Connection refused”: Ensure OpenFold3 NIM is running
For detailed performance tuning guidance specific to your deployment, refer to the documentation on configuration and optimization.