High-performance training and inference for deep equivariant interatomic potentials
Listen
Radio episode about this paper
Transcript
Introduction to the show: ident: Physics. The day in general physics: instruments, methods and results across the field.
Kai: I'm Kai.
Mira: And I'm Mira, here with Lev.
Kai: We're looking at the paper: "High-performance training and inference for deep equivariant interatomic potentials".
Paper summary: Kai: We just touched on how this paper is trying to overhaul the NequIP framework for better performance. To recap, the thesis is that deep equivariant neural networks are state-of-the-art for these tasks, but they need better ways to train and run them efficiently <ref:2504.16068#pg1>.
Mira: They claim this work presents a major overhaul focusing on multi-node parallelism, computational performance, and extensibility in the NequIP framework <ref:2504.16068#pg1>. It’s about taking the existing structure and making it much more versatile for all sizes of training and inference tasks <ref:2504.16068#pg1>.
Lev: From an engineering standpoint, I'm interested in how they are handling the core challenge, which is that predicting forces requires exact derivatives of the potential energy <ref:2504.16068#pg2>.
Kai: They tackle that by tracing the entire model, including those derivative calculations, into a single computational graph using torch fx <ref:2504.16068#pg2>. That allows them to handle both forward passes and backwards passes in one go <ref:2504.16068#pg2>.
Mira: So they’re also addressing the barrier where standard tools can't handle this derivative calculation directly, which is why they had to adapt the code <ref:2504.16068#pg2>. It ensures forces stay conservative fields of the energy, which is essential for keeping energy conservation stable in simulations <ref:2504.16068#pg2>.
Lev: That sounds like a necessary adaptation, but what about the actual speedup potential? Are we talking about just minor tweaks or something more substantial?
Kai: They introduce several methods to accelerate the training process itself <ref:2504.16068#pg2>. They use TorchInductor to transform graphs into highly optimized, device-specific code using Triton for GPUs and C++ and OpenMP for CPUs <ref:2504.16068#pg2>.
Mira: On GPUs, they leverage Triton, which is a hardwareagnostic language, to generate optimized kernels thirty-six <ref:2504.16068#pg2>. On CPUs, it produces C++ and OpenMP code thirty-seven, so it's trying to optimize for whatever machine you have available <ref:2504.16068#pg2>.
Lev: So they're targeting both GPU and CPU setups, which is good because real hardware isn't always uniform. But I wonder how the automatic differentiation part fits into that compilation pipeline?
Kai: They adapted the code to trace the entire model into a single computational graph using torch fx library forty-four, which is compatible with both train-time compilation and ahead-oftime compilation for inference <ref:2504.16068#pg2>. It’s about making the compiler work for both training and inference stages <ref:2504.16068#pg2>.
Mira: That unified graph approach is key because it lets them handle the derivative calculation, which isn't a primitive PyTorch operation <ref:2504.16068#pg2>. They are essentially making sure the compiler can see and optimize everything at once <ref:2504.16068#pg2>.
Lev: Okay, so it’s about getting the compilation pipeline to handle things that PyTorch doesn't natively support as primitives. It’s a lot of work for real hardware implementation, I bet.
Kai: Yeah, and they tackle inference separately by introducing AOTI as a variant of TorchInductor meant to export models as self-contained native code for non-Python environments <ref:2504.16068#pg3>. That’s a big deal for deployment <ref:2504.16068#pg3>.
Mira: And they also implemented a custom kernel for the Allegro model’s most expensive operation, which is the tensor product <ref:2504.16068#pg3>. This custom Triton kernel uses fusion and scheduling patterns to accelerate that operation using a compressed sparse format fifty-seven <ref:2504.16068#pg3,using a compressed sparse format 57>.
Lev: A compressed sparse format sounds like a clever way to handle the data structure for that tensor product, which is usually memory intensive <ref:2504.16068#pg3>. That’s where you save space and time simultaneously.
Kai: And it also avoids materializing intermediate outer products between the input tensors, which results in significant memory savings <ref:2504.16068#pg3>. It’s about making the memory footprint manageable for bigger models <ref:2504.16068#pg3>.
Mira: So, to summarize this paper "High-performance training and inference for deep equivariant interatomic potentials," it's a major framework overhaul <ref:2504.16068#pg1>. The goal is to dramatically improve computational performance across training and inference tasks of all sizes <ref:2504.16068#pg1>. [
Conclusion: Kai: So we've been looking at how they overhauled that NequIP framework for better performance on these deep equivariant potentials <ref:2504.16068#pg1>.
Mira: It’s basically taking this existing structure and making it much more versatile for both training and running simulations of all the different sizes <ref:2504.16068#pg1>.
Kai: The authors are focusing on a major rewrite to boost computational speed across the board <ref:2504.16068#pg1>.
Mira: They’re tackling that by integrating PyTorch two point zero compiler technology with distributed training and custom kernels for things like tensor products <ref:2504.16068#pg7>.
Kai: So they’re using specific tools, like Triton on GPUs and AOTI for inference, to get those speedups <ref:2504.16068#pg3>.
Mira: The authors are showing that this overhaul provides a solid foundation for developing new MLIP architectures <ref:2504.16068#pg7>.
Kai: It does handle per-edge-type cutoff radii that depend on the atomic types of both the central and neighbor atoms <ref:2504.16068#pg7>.
Mira: And they’ve made sure the structure forces you to build things modularly, like adding new models such as Allegro without breaking the acceleration techniques <ref:2504.16068#pg7>.
Kai: It seems they've really focused on making this framework extensible for future work <ref:2504.16068#pg7>.
Mira: But how much speedup are we actually seeing in practice for the people using this new setup?
John A. Paulson School of Engineering and Applied Sciences Harvard University · Center for Computational Science and Engineering Massachusetts Institute of Technology Center for Computational Science and Engineering · Department of Materials Science and Engineering Massachusetts Institute of Technology Department of Materials Science and Engineering Center for the Environment Harvard University Research Laboratory of Electronics Massachusetts Institute of Technology Research Laboratory of Electronics Sandia National Laboratories Robert Bosch LLC Research and Technology Center Mirian Technologies Inc.
physics.comp-ph, cs.LG, physics.chem-ph
Submitted: 2025-04-22
Updated: 2025-04-22
DOI: 10.1039/d5dd00423c
Code: https://github.com/mir-group/nequip
License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/
Importance score: 99/100
The gist: Machine learning interatomic potentials, particularly those based on deep equivariant neural networks…
Key concepts
- NequIP framework
- NequIP is a software framework designed for machine learning interatomic potentials. The authors significantly overhauled this framework to enhance multi-node parallelism, computational performance, and overall extensibility for developing MLIP architectures.
- TorchInductor
- TorchInductor transforms neural network graphs into highly optimized code tailored for specific hardware. It uses Triton for GPUs and C++ with OpenMP for CPUs to generate efficient kernels, speeding up the training process.
- AOTI
- AOTI is a specialized variant of TorchInductor used to export compiled PyTorch models as self-contained native code, suitable for non-Python environments. It's key to achieving dramatic inference speedups by removing Python overhead.
- Allegro tensor product kernel
- This is a custom kernel implemented in Triton specifically for the Allegro model's most computationally expensive operation: the tensor product. It uses a compressed sparse format and fusion/scheduling patterns to drastically improve memory efficiency and speed during inference.
Terminology
Summary
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. p. 0<ref:2504.16068#pg1, 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>. p. 0 This work presents a major overhaul of the NequIP framework focusing on multi-node parallelism, computational performance, and extensibility. p. 0<ref:2504.16068#pg1, This work presents a major overhaul of the NequIP framework focusing on multi-node parallelism, computational performance, and extensibility>. p. 0
Framework Redesign for Performance
The redesigned NequIP framework supports distributed training on large datasets and removes barriers preventing full utilization of the PyTorch 2.0 compiler at train time. p. 0<ref:2504.16068#pg1, The redesigned NequIP framework supports distributed training on large datasets and removes barriers preventing full utilization of the PyTorch 2. p. 00 compiler at train time>. p. 0 This overhaul aims to dramatically improve computational performance and versatility across training and inference tasks of all sizes. p. 0<ref:2504.16068#pg1, This work presents a major revamp of the NequIP software framework for MLIPs to dramatically improve computational performance and versatility across training and inference tasks of all sizes>. p. 0
Training Acceleration Techniques
Several methods are employed to accelerate the training process.<ref:2504.16068#pg2>. The NequIP framework is built on top of the PyTorch neural network library. p. 0<ref:2504.16068#pg2>. TorchInductor transforms graphs into highly-optimized, device-specific code using Triton for GPUs and C++ and OpenMP for CPUs. p. 0<ref:2504.16068#pg2, On GPUs, TorchInductor leverages Triton [36], a hardwareagnostic language, to generate optimized kernels, while on CPUs, it produces C++ and OpenMP code [37]. p. 0 To handle automatic differentiation for forces and virials as exact derivatives of the potential energy, the authors adapted the code to trace the entire model into a single computational graph using torch. p. 1fx library [44], which is compatible with both train-time compilation and ahead-oftime compilation for inference > <ref:2504. p. 116068#pg2, Computing the derivative, however, is not a primitive PyTorch operation that is supported directly by the compiler machinery>. p. 1
Inference Optimization Strategies
The authors introduce several advancements specifically targeting inference speed.<ref:2504.16068#pg3>. They introduce AOTI as a variant of TorchInductor specialized to export compiled PyTorch models as self-contained native code for use in non-Python environments. p. 1<ref:2504.16068#pg3>. Furthermore, they implement a custom kernel for the Allegro model’s most expensive operation, the tensor product. p. 0<ref:2504.16068#pg3>. This custom Triton kernel implements fusion and scheduling patterns to accelerate the Allegro tensor product operation using a compressed sparse format. p. 2<ref:2504.16068#pg3, Our custom kernel takes advantage of the mathematical structure of the tensor product by using a compressed sparse format [57]>. p. 2
Case Study Results
A case study involving training Allegro models on the SPICE 2 dataset was conducted to demonstrate performance gains.<ref:2504.16068#pg3, III. p. 0 CASE STUDY: TRAINING AND INFERENCE OF SPICE 2 MODELS>. p. 0 The results show that accuracy improves from the small to medium to large model when evaluating energy and force errors on subsets of the SPICE 2 test set. p. 2<ref:2504.16068#pg4>. Training efficiency was benchmarked using distributed multi-GPU training with a custom DDP approach that performs communications only after the full backwards pass has completed. p. 1<ref:2504.16068#pg3>. The training performance shows that training with torch. p. 4compile achieves between 2. p. 4 p. 44–5.0 times speedups over TorchScript on MI250X and A100 (80GB) GPUs across the range of MPI ranks investigated. p. 4<ref:2504.16068#pg5, We observe that training with torch. p. 4compile achieves between 2.4–5.0 times speedups over TorchScript on MI250X and A100 (80GB) GPUs across the range of MPI ranks investigated>. p. 4
Inference Throughput Gains
Inference testing confirmed dramatic improvements using AOTI and the custom kernel.<ref:2504.16068#pg6>. Across all hardware and models, the small molecule examples see accelerations ranging from 4-18 times when comparing the TorchScript baseline to AOTI with the optimized TP; the same range of speedups is seen in the water simulations. p. 4<ref:2504.16068#pg6>. The combination of AOTI and the custom tensor product kernel dramatically increases memory efficiency, allowing larger models to run on significantly more atoms. p. 5<ref:2504.16068#pg6, Figure 4 demonstrates that AOTI improves memory efficiency and that the combination of AOTI and the optimized tensor product kernel dramatically increases the maximum number of atoms that can fit on one rank>. p. 4
Conclusion
The updated NequIP framework provides an extensible foundation for developing MLIP architectures.<ref:2504.16068#pg7, Finally, the updated NequIP framework is an extensible foundation for the development of MLIP architectures and training strategies>. p. 6 The new infrastructure achieves substantial performance improvements for both training and inference by integrating PyTorch 2. p. 50 compiler technologies, distributed training, and optimized custom Triton kernels. p. 5<ref:2504.16068#pg7>. The framework supports per-edge-type cutoff radii that depend on the atomic types of both the central and the neighbor atoms. p. 5<ref:2504.16068#pg7>. The modular structure enforces development of extension packages like Allegro ensuring they can leverage acceleration techniques. p. 6<ref:2504.16068#pg7, The modular structure it enforces facilitates the development of extension packages like Allegro and ensures that they can easily leverage both the computational acceleration techniques described here and the broader set of tools, integrations, and infrastructure offered by the framework>. p. 6
--- Page 1 ---
High-performance training and inference for deep equivariant interatomic potentials.<ref:2504.16068#pg1, High-performance training and inference for deep equivariant interatomic potentials>. p. 0
--- Page 2 ---
2.<ref:2504.16068#pg2>.
--- Page 3 ---
3.<ref:2504.16068#pg3>.
--- Page 4 ---
4.<ref:2504.16068#pg4>.
--- Page 5 ---
5.<ref:2504.16068#pg5>.
--- Page 6 ---
6.<ref:2504.16068#pg6>.
--- Page 7 ---
7.<ref:2504.16068#pg7>.
--- Page 8 ---
8.<ref:2504.16068#pg8>.
--- Page 9 ---
9.<ref:2504.16068#pg9>.
--- Page 10 ---
--- Page 11 ---
.
--- Page 25 ---
.
--- Page 34 ---
.
--- Page 39 ---
.
--- Page 47 ---
.
--- Page 50 ---
.
--- Page 53 ---
.
--- Page 54 ---
.
--- Page 57 ---
.
--- Page 58 ---
.
--- Page 59 ---
.
--- Page 63 ---
.
--- Page 64 ---
.
--- Page 77 ---
.
--- Page 128 ---
.
--- Page 139 ---
.
--- Page 377 ---
.
--- Page 459 ---
.
Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.
Improvements for AI systems
-
torchCompile acceleration for training enables speedups of between 2.4–5.0 times over TorchScript on MI250X and A100 (80GB) GPUs across a range of MPI ranks, which allows the entire dataset to be processed in fewer stochastic gradient descent steps, reducing wall time per epoch.
-
Custom DDP approach for distributed training performs communications only after the full backwards pass has completed, which allows TorchInductor to compile the entire backward pass rather than splitting it into multiple subgraphs with communication operations in between, reducing overhead and introducing additional opportunities for fusion.
-
Ahead-of-Time Inductor (AOTI) compilation provides an end-to-end infrastructure that uses the PyTorch Ahead-of-Time Inductor compiler for inference, allowing MLIP models to be used in high-performance codes like LAMMPS without resorting to complicated, high-overhead solutions such as embedded Python interpreters.
-
Fused custom kernels implemented using Triton accelerate the Allegro tensor product operation by implementing
fused custom kernels
that overcome fusion limitations of TorchInductor, resulting in a reduction ofcostly intermediate memory reads and writes.
-
AOTI compilation combined with the optimized tensor product kernel dramatically increases the maximum number of atoms that can fit on one rank, extending this limit to 288 atoms for the large model on all GPU types.
Sources
- Optimizing Data Distribution and Kernel Performance for Efficient Training of Chemistry Foundation Models: A Case Study with MACE
- Open Materials 2024 (OMat24) Inorganic Materials Dataset and Models
- A Foundational Potential Energy Surface Dataset for Materials
- MACE-OFF: Transferable Short Range Machine Learning Force Fields for Organic Molecules
- A foundation model for atomistic materials chemistry
- MatterSim: A Deep Learning Atomistic Model Across Elements, Temperatures and Pressures
- Orb: A Fast, Scalable Neural Network Potential
- Orb-v3: atomistic simulation at scale
- Learning Smooth and Expressive Interatomic Potentials for Physical Property Prediction
- Identifying Split Vacancy Defects with Machine-Learned Foundation Models and Electrostatics
- Screening of material defects using universal machine-learning interatomic potentials
- TorchBench: Benchmarking PyTorch with High API Surface Coverage
- Accelerating Neural Network Training: An Analysis of the AlgoPerf Competition
- Forces are not Enough: Benchmark and Critical Evaluation for Machine Learning Force Fields with Molecular Simulations
- Universal Machine Learning Interatomic Potentials are Ready for Phonons
- The dark side of the forces: assessing non-conservative force models for atomistic machine learning
- PyTorch Distributed: Experiences on Accelerating Data Parallel Training
- A predictive machine learning force field framework for liquid electrolyte development
- Using Python for Model Inference in Deep Learning
- OpenMM-Python-Force: Deploying Accelerated Python Modules in Molecular Dynamics Simulation
Related papers
- Gradient-Based Inverse Design of Free-Energy Landscapes with Diffusion Models
- Mixture of Polyconvex Neural Potentials for Parametric Hyperelasticity: Towards Foundation Material Models
- Development and large-scale benchmarks of a protein--ligand absolute binding free energy toolkit
- A nonequilibrium-capturing unified gas-kinetic scheme II: multi-frequency radiation transport
- Spin disorder competing with positional symmetry breaking governs the metal-insulator behavior in oxide paramagnets
- Investigation of the Asymptotic Properties of Active Impedance in Large Finite Array Antennas