chemtrain-deploy: A parallel and scalable framework for machine learning potentials in million-atom MD simulations

Paul Fuchs, Weilong Chen, Stephan Thaler, Julija ZavadlavarXiv 2025 · DOI

Introduction

Machine Learning Potentials (MLPs), particularly Graph Neural Networks (GNNs), have emerged as the "gold standard" for molecular dynamics (MD), offering a balance between quantum mechanical accuracy and classical force field efficiency. Despite their success, a significant "deployment gap" persists. Most state-of-the-art MLPs are developed in JAX or PyTorch, which are optimized for training but difficult to integrate into high-performance MD engines like LAMMPS. Existing integration solutions are often architecture-specific, lack multi-GPU scalability, or fail when system sizes reach millions of atoms.

To address these challenges, we introduce chemtrain-deploy, a model-agnostic framework that bridges JAX-based MLPs with LAMMPS. It enables million-atom simulations across multiple GPUs with near-ideal scaling, supporting diverse architectures such as MACE, Allegro, and PaiNN without requiring manual C++ rewrites for each new model.

The chemtrain-deploy Framework

The framework is designed for high scalability and hardware independence through three core components:

  1. Export: Converts JAX-defined potentials into a self-contained format using the MLIR framework, ensuring cross-environment compatibility.
  2. Import (LAMMPS Plugin): A C++ plugin for LAMMPS that manages spatial decomposition and "ghost atom" communication, ensuring each GPU receives the necessary local data.
  3. Evaluation Library: Powered by XLA (Accelerated Linear Algebra) and PJRT, this component translates models into efficient machine code for specific hardware (CPUs or GPUs) at runtime.
Overview of the chemtrain-deploy workflow, illustrating model training, export, and deployment within the LAMMPS spatial decomposition environment.

Several technical innovations ensure performance:

  • Neighbor List Pruning: LAMMPS neighbor lists are pruned to match the MLP's specific cutoff radius, reducing unnecessary computation.
  • Input Buffering: To prevent frequent XLA recompilations caused by fluctuating atom counts in local domains, the framework buffers data to fixed shapes.
  • Collective Recompilation: Synchronized recompilation across multi-GPU setups prevents staggered warm-up periods that would otherwise degrade performance.

Experimental Validation

The framework was validated using three chemically diverse datasets: ANI-AL (aluminum), SPICE (drug-like molecules and solvated peptides), and H2O-PBE0TS (liquid water and ice). These tests provided a rare "apples-to-apples" comparison of leading MLP architectures.

Performance metrics (Energy and Force RMSE/MAE) for Allegro, MACE, and PaiNN models across the ANI-AL, SPICE, and H2O-PBE0TS datasets.

Key results include:

  • Scalability: The framework successfully simulated systems exceeding 1 million atoms. In weak scaling tests, performance increased nearly linearly with the number of GPUs.
  • Throughput: For a million-atom aluminum system, the Allegro model achieved nearly 100 million atom-steps per second across 64 GPUs.
  • Model Comparison: While PaiNN demonstrated high accuracy, it faced memory efficiency challenges in large, diverse systems compared to MACE and Allegro.

Discussion and Future Outlook

Our findings highlight a trade-off between locality and accuracy. "Strictly local" models like Allegro scale exceptionally well due to reduced inter-GPU communication, whereas "message-passing" models like MACE offer superior robustness for complex chemical systems. Notably, chemtrain-deploy can handle larger systems on a single GPU than pure JAX-based engines by optimizing memory and neighbor list management.

Future work will focus on extending the framework to support long-range interactions (e.g., Coulomb forces), integrating with other MD packages like GROMACS and NAMD, and implementing advanced algorithms like multi-time-step integration to further enhance simulation throughput.

Summary updated

BibTeX
@misc{fuchs2025chemtrain,
  author = {Paul Fuchs and Weilong Chen and Stephan Thaler and Julija Zavadlav},
  title = {{chemtrain-deploy: A parallel and scalable framework for machine learning potentials in million-atom MD simulations}},
  year = {2025},
  eprint = {2506.04055},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.04055},
}
Figure