MP-NeRF: A massively parallel method for accelerating protein structure reconstruction from internal coordinates

Eric Alcaide, Stella Biderman, Amalio Telenti, M. Cyrus Maher

TL;DR

MP-NeRF introduces a massively parallel algorithm for reconstructing 3D protein structures from internal coordinates, achieving a staggering 400x to 1200x speedup over previous state-of-the-art methods. By decomposing the reconstruction process into independent, batchable matrix operations, the authors eliminate the traditional sequential bottleneck, making it a powerful tool for high-throughput molecular dynamics and deep learning pipelines.

What Problem Does This Paper Address?

In computational biology, proteins are represented in two primary ways: Cartesian coordinates (x, y, z positions of every atom) and internal coordinates (bond lengths, bond angles, and dihedral angles). While Cartesian coordinates are great for visualization and rigid-body rotations, internal coordinates are the "natural language" of molecular forces and interactions.

The challenge lies in "reverse translation"—converting internal coordinates back into 3D Cartesian space. Traditionally, this is a sequential process: to know where atom C is, you must first know the positions of atoms A and B. This serial dependency creates a massive computational bottleneck, especially for long protein chains. As machine learning models (like those predicting protein folding) become more complex, they require thousands of these conversions, making the slow, sequential "Natural extension of Reference Frame" (NeRF) algorithm a major drag on performance.

Methods

The authors propose MP-NeRF (Massively Parallel NeRF), which breaks the sequential chain by dividing the reconstruction into three distinct, parallelizable phases:

  1. Parallel Monomer Composition: Instead of building the whole backbone atom-by-atom, the algorithm builds the backbone fragment of every amino acid in the chain simultaneously.
  2. Backbone Assembly: These independent fragments are then joined together using efficient "roto-translation" operations. This involves batched matrix multiplications to align the fragments and a cumulative sum to position them correctly in 3D space.
  3. Parallel Sidechain Elongation: Once the "spine" (backbone) is assembled, all sidechains (the "arms" of the amino acids) are grown in parallel.

The implementation is built using PyTorch, ensuring the entire process is differentiable. This allows the reconstruction step to be integrated directly into the training loops of deep learning models, where gradients need to flow back from the 3D structure to the input parameters.

Datasets

The paper focuses on algorithmic benchmarking rather than training on a specific biological dataset. To evaluate performance, the authors used:

  • Synthetic Protein Chains: Proteins of varying lengths (from 114 to 1000 residues) to measure how the algorithm scales.
  • SidechainNet Format: Data was processed using the sidechainnet format, which represents proteins as (N x 14 x 3) arrays, where N is the number of residues.

Key Insights and Ideas

  • Extreme Granularity: While previous "parallel" attempts split proteins into 5 or 10 fragments, MP-NeRF takes it to the extreme by treating every single monomer as an independent fragment.
  • CPU vs. GPU Paradox: Interestingly, the authors found that for many protein lengths, the CPU implementation was faster than the GPU version. This is due to the overhead of data transfer between the CPU and GPU and the fact that modern CPUs have highly optimized vector instructions (SIMD/AVX) that handle the "assembly" phase more efficiently than a GPU's lower-clock-speed cores.
  • Numerical Stability: A common fear with parallelizing sequential operations is the accumulation of floating-point errors. The authors demonstrated that even after 1,000 "round-trip" cycles (converting from Cartesian to internal and back), the error (RMSD) remains remarkably low and stable (~0.03 Å).

Key Results

  • Massive Speedups: Compared to the previous state-of-the-art (Bayati et al.), MP-NeRF achieved speedups between 400x and 1200x.
  • Concrete Performance: For a protein with 1,000 residues, the previous SOTA took ~18.66 seconds to reconstruct. MP-NeRF completed the same task on a standard laptop CPU in just 0.0153 seconds.
  • Hardware Accessibility: Because the algorithm is so efficient on CPUs, it eliminates the strict requirement for expensive, specialized GPU hardware for this specific task, making high-speed reconstruction accessible to more researchers.

Limitations and Future Work

  • Python Latency: Although the heavy lifting is done via C-implemented matrix operations, the Python wrapper still introduces some overhead. The authors estimate that a pure C++ implementation could potentially double or triple the current speed.
  • Ring Simplification: To maintain a clear parallel path, the algorithm simplifies molecular rings (like those in Proline or Phenylalanine) by "masking" one bond. While this works for generating point clouds (PDB format), it requires careful handling if the specific connectivity of the ring is required for downstream physics simulations.
  • Scaling to Larger Polymers: While optimized for proteins, the authors suggest the GPU implementation might show more significant advantages for even larger structures, such as long strands of nucleic acids (DNA/RNA), which was not extensively explored in this paper.

Summary updated

Abstract

Abstract The conversion of proteins between internal and cartesian coordinates is a limiting step in many pipelines, such as molecular dynamics simulations and machine learning models. This conversion is typically carried out by sequential or parallel applications of the Natural extension of Reference Frame (NeRF) algorithm. This work proposes a massively parallel NeRF implementation which, depending on the polymer length, achieves speedups between 400-1200x over the previous state-of-the-art. It accomplishes this by dividing the conversion into three main phases: parallel composition of the monomer backbone, assembly of backbone subunits, and parallel elongation of sidechains; and by batching these computations into a minimal number of efficient matrix operations. Special emphasis is placed on reusability and ease of use. We open source the code (available at https://github.com/EleutherAI/mp_nerf ) and provide a corresponding python package.
BibTeX
@article{alcaide2022mp,
  author = {Eric Alcaide and Stella Biderman and Amalio Telenti and M. Cyrus Maher},
  title = {{MP-NeRF: A massively parallel method for accelerating protein structure reconstruction from internal coordinates}},
  journal = {J. Comput. Chem.},
  year = {2022},
  doi = {10.1002/jcc.26768},
}
Figure