[Paper Review] High-performance training and inference for deep equivariant interatomic potentials
The paper overhauls NequIP with TorchInductor for distributed training and introduces Ahead-of-Time Inductor (AOTI) plus a custom Triton tensor-product kernel, achieving up to 18x speedups in MD inference and enabling large-scale training on SPICE 2 data.
Machine learning interatomic potentials, particularly those based on deep equivariant neural networks, have demonstrated state-of-the-art accuracy and computational efficiency in atomistic modeling tasks like molecular dynamics and high-throughput screening. The size of datasets and demands of downstream workflows are growing rapidly, making robust and scalable software essential. This work presents a major overhaul of the NequIP framework focusing on multi-node parallelism, computational performance, and extensibility. The redesigned framework supports distributed training on large datasets and removes barriers preventing full utilization of the PyTorch 2.0 compiler at train time. We demonstrate this acceleration in a case study by training Allegro models on the SPICE 2 dataset of organic molecular systems. For inference, we introduce the first end-to-end infrastructure that uses the PyTorch Ahead-of-Time Inductor compiler for machine learning interatomic potentials. Additionally, we implement a custom kernel for the Allegro model's most expensive operation, the tensor product. Together, these advancements speed up molecular dynamics calculations on system sizes of practical relevance by up to a factor of 18.
Motivation & Objective
- Improve scalability and performance of training MLIPs on large datasets.
- Enable end-to-end high-performance inference integration with traditional MD codes.
- Provide end-to-end compiler-based acceleration for deep equivariant interatomic potentials.
- Demonstrate practical gains on a large, diverse dataset (SPICE 2).
- Enhance framework extensibility for future MLIP architectures (e.g., Allegro).
Proposed method
- Trace the full model including derivatives into a single PyTorch FX graph for train-time compilation and inference compatibility.
- Apply TorchInductor to generate optimized kernels for forward and backward passes via torch.compile.
- Implement distributed data-parallel training with a custom DDP approach that avoids gradient bucketing to maximize fusion opportunities.
- Introduce Ahead-of-Time Inductor (AOTI) to export compiled PyTorch models as native code for use in non-Python environments (e.g., LAMMPS).
- Develop custom fused Triton kernels for the Allegro tensor product to replace non-fusable portions of the PyTorch implementation.
- Use a compressed sparse format to represent Wigner 3-j contraction coefficients and avoid materializing intermediates to reduce memory footprint.
Experimental results
Research questions
- RQ1How can TorchInductor be leveraged to accelerate training and inference of deep equivariant interatomic potentials?
- RQ2What are the performance gains when integrating AOTI for inference with high-performance MD codes like LAMMPS?
- RQ3Can a custom fused kernel for tensor products further reduce memory and compute bottlenecks in Allegro?
- RQ4How does distributed multi-GPU training scale for large MLIP datasets such as SPICE 2?
- RQ5What are the accuracy and generalization implications of training Allegro models on SPICE 2 under different charge-state subsets?
Key findings
- Training with torch.compile yields 2.4–5.0x speedups over TorchScript across tested GPUs.
- Distributed training scales well up to 128 ranks with reasonable efficiency at 256 ranks (40% on AMD, 24% on NVIDIA with the reported baseline).
- Inference with AOTI and the optimized tensor product kernel achieves up to 18x speedups over TorchScript on small molecules and water boxes.
- AOTI enables memory-efficient, scalable inference for large systems, extending feasible system sizes per GPU (e.g., large model up to 4320–5184 atoms depending on hardware).
- Strong scaling for biomolecular systems (DHFR, cellulose) shows excellent performance up to 256 nodes on Frontier and Perlmutter, with notable throughput gains for AOTI+TP.
- Compared against SPICE 2 benchmarks, all three Allegro models (small/medium/large) show favorable torsion barrier predictions with decreasing MAE/RMSE as model size increases.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.