Skip to main content

ERStream

Charge-aware machine-learning molecular dynamics at device scale

License: LGPL-3.0-or-later Documentation Cite ERStream MACE-ER models: mace-er DPA4C-ER models: deepmd-lr arXiv: 2611.37665

Installation · Quick start · User guide · Advanced usage · DPA4C-ER · Citation


ERStream is a GPU execution engine for long-range machine-learning interatomic potentials with learned charges. It evaluates energies, forces, stress and the pair-response tensor Z*(pair) behind Born effective charges at every molecular dynamics step, for systems far larger than a whole-system evaluation fits on one GPU, with periodic (SPME) and isolated (free-space) boundaries, on one GPU or on the GPUs of one node.

How it works

Charge-aware potentials couple every local network evaluation to one global electrostatic solve. Keeping all neural activations alive across that solve is what limits system size. ERStream treats the solve as a barrier: it streams spatial tiles through the network, keeps only one charge and one electrostatic adjoint per atom across the barrier, and rematerializes each tile afterwards for forces, stress and Z*(pair).

Tiles carry exact receptive-field halos, so results match a whole-system evaluation up to floating-point summation order. The Z*(pair) method is chosen from the model architecture: one-hop for receiver-local models such as MACE-ER-T1 and DPA4C-ER, multi-hop for message-passing models such as MACE-ER-T2.

At a glance

Models MACE-ER (one- and two-layer MACE with learned charges) via mace-er; DPA4C-ER via the bundled DeePMD-kit plugin (plugins/deepmd-lr)
Outputs every step energy, forces, stress/virial, learned charges, Z*(pair) (all nine components)
Boundaries fully periodic (SPME), slab, isolated (free space); optional uniform external field
Dynamics NVE, NVT (Langevin, Nosé–Hoover chain), NPT/NPH (MTK), FIRE2 cell relaxation
Precision mixed by default (FP32 network; FP64 geometry, readouts, electrostatics and accumulation); FP64 for reference runs
Scaling automatic tile and memory planning, streamed topology for very large systems, single-node multi-GPU
Hardware NVIDIA GPUs; MACE-ER with CUDA 13, DPA4C-ER with CUDA 12 (V100) or 12.8 and later (H100, RTX 5090, B200)
Interfaces Python API, ASE calculator, YAML command line (erstream plan, erstream run)

Installation

Run the following from a source checkout in a Python 3.12 environment. For MACE-ER:

python -m pip install 'git+https://github.com/AM3GroupHub/mace-er.git@d0403b1c7e2b416d946c7e5922b0272069f930ff'
python -m pip install '.[mace,cueq,cueq-cu13]'

For DPA4C-ER, in a separate environment:

python -m pip install -c configs/dpa4c/constraints/toolkit-ops-050.txt '.[dpa4c]' ./plugins/deepmd-lr

The dpa4 extra installs the same pinned stack for DPA4-ER through the deepmd_lr plugin interfaces:

python -m pip install -c configs/dpa4c/constraints/toolkit-ops-050.txt '.[dpa4]' ./plugins/deepmd-lr

ERStream's public dpa4c backend executes charge-only DPA4C-ER models. Then follow the native build instructions before using optimized DPA4C-ER execution. Only load trusted checkpoints: loading PyTorch checkpoints may execute code.

Quick start

import torch
from ase.io import read
from erstream import build_evaluator

if __name__ == "__main__":
    atoms = read("structure.extxyz")               # fully periodic structure
    ev = build_evaluator("model.model", atoms, devices=[0],
                         compute_born=True, compute_virial=True)
    try:
        r = torch.as_tensor(atoms.positions, device=ev.home, dtype=torch.float64)
        energy, forces = ev(r)                     # eV, eV/Å
        stress = ev.stress                         # eV/ų
        z_pair = ev.results["born"]                # Z*(pair), units of e
    finally:
        ev.close()

Or plan and run MD from a YAML file (see examples):

erstream plan config.yaml
erstream run config.yaml

Keep evaluator construction inside the __main__ guard for multi-GPU scripts, whose workers use multiprocessing spawn.

Documentation

Guide Contents
User guide how it works, supported models and features, configuration reference, precision, testing
Advanced usage performance options, tile shapes, slab boundaries and ASE, short-range models, Hessian-vector products, seed builder
Periodic virial and cell dynamics stress conventions, NPT/NPH and cell relaxation
DPA4C-ER installation, native builds, options, outputs, multi-GPU execution
Changelog release notes

Citation

If you use ERStream, please cite the paper and the model packages used in your workflow:

@misc{yu2026erstream,
  title         = {Scaling charge-aware machine learning molecular dynamics through memory-bounded {GPU} streaming},
  author        = {Yu, Xiaoyun and Chen, Yicheng and Zhong, Peichen},
  year          = {2026},
  eprint        = {2611.37665},
  archivePrefix = {arXiv},
  primaryClass  = {physics.comp-ph},
  url           = {https://arxiv.org/abs/2611.37665}
}

Citation metadata for the software and the paper is in CITATION.cff (GitHub: Cite this repository).

License

ERStream code and its modifications to the bundled deepmd-lr plugin are LGPL-3.0-or-later. The distribution also retains Apache-2.0 components and upstream MIT deepmd-lr code (LGPL-3.0-or-later AND Apache-2.0 AND MIT). See LICENSE, COPYING, NOTICE and component licenses.

Contributing

Contributions are welcome; see CONTRIBUTING.md. Report security issues as described in SECURITY.md.

Metadata

Release files for erstream 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for erstream 0.1.1
File Size Uploaded Provenance Actions
erstream-0.1.1.tar.gz 966.9 kB With provenance Details for erstream-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for erstream 0.1.1
File Interpreter ABI Platform Actions
erstream-0.1.1-py3-none-any.whl Python 3 none any Details for erstream-0.1.1-py3-none-any.whl

Total release size: 2.3 MB

Release files / erstream-0.1.1.tar.gz

Download URL erstream-0.1.1.tar.gz
Size 966.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f4d5ccc735c3e4805638739014119ddf9c7ac315ed7065e138195f8c1a7f7468
BLAKE2b-256 checksum
How to use checksums
da2de29c762c3711e340f8023dce9db45bed740726057a39c8b86ba2c0087bc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.

Transparency log

Release files / erstream-0.1.1-py3-none-any.whl

Download URL erstream-0.1.1-py3-none-any.whl
Size 1.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
81ca5b741b49de98e95070c597b814b87017859e357e0076247774f4b29cf823
BLAKE2b-256 checksum
How to use checksums
e025d767aa907294e8b362e7d5bf11ba7a218370b44fd042028897ba933e8d5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.

Transparency log

Security for erstream 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for erstream-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page