aiqm/torchani

TorchANI 2.0 is an open-source library that supports training, development, and research of ANI-style neural network interatomic potentials. It was originally developed and is currently maintained by the Roitberg group.

TorchANI 2.0 – Neural‑Network Interatomic Potentials in PyTorch

TorchANI is an open‑source Python library built on top of PyTorch that lets researchers train, evaluate, and use ANI‑style neural network interatomic potentials (NN‑IPs). These are machine‑learning models that predict the potential energy and forces of a molecule directly from its atomic coordinates, enabling fast, accurate molecular dynamics (MD) and hybrid ML/MM simulations.

What the library does

  • Model library – provides ready‑to‑use pretrained ANI models and a clean API to define new ones.
  • Training utilities – tools for fitting NN‑IPs to quantum‑chemical reference data.
  • Fast inference – C++/CUDA extensions compute the ANI descriptors and run the networks on GPUs for near‑real‑time MD.
  • Command‑line interface – the ani executable offers quick utilities (e.g., energy/force evaluation, building extensions).
  • Integration points – a separate TorchANI‑Amber package lets you plug the potentials into Amber’s classical MD engine for ML/MM simulations.

Who might use it

  • Computational chemists or materials scientists who need high‑performance, ML‑based force fields for simulations.
  • Researchers developing new NN‑IP architectures and wanting a PyTorch‑native baseline.
  • Anyone looking to run ML‑driven molecular dynamics on GPUs without writing low‑level CUDA code.

Getting started (from the README)

  1. Set up a Python environment (conda/mamba or a virtualenv). The library is distributed on PyPI, but the authors recommend installing with pip even inside a conda env because the conda package is unmaintained.
  2. Install a compatible PyTorch (e.g., pip install torch==2.13 --index-url https://download.pytorch.org/whl/cu130 for CUDA 13.0). TorchANI 2 requires PyTorch ≥ 2.0.
  3. Install TorchANI: pip install torchani.
  4. Build the optional C++/CUDA extensions for descriptor computation and fast inference:
    ani build-extensions          # builds for all detected GPU SMs
    # or limit to specific SMs, e.g.:
    ani build-extensions --sm 8.0 --sm 8.9
    
  5. (Optional) Clone the repo and create the development environment via the provided environment.yaml if you need to build docs, run tests, or modify the source.

Platform notes

  • GPU support: Works on NVIDIA GPUs with CUDA; strongly recommended for any non‑trivial workload. AMD/ROCm is not tested.
  • macOS: No CUDA; the library is untested with Apple’s MPS backend.
  • Conda package: Available for developers; can be built locally using the recipe directory.

Documentation & help

  • Full user guide and API reference: https://aiqm.github.io/torchani/
  • Migration guide for moving from TorchANI 1.x to 2.0.
  • Bug reports and feature requests are welcomed via GitHub issues.

Citing TorchANI

If you use the library in published work, cite the two papers listed in the README (the original TorchANI paper and the TorchANI 2.0 extension paper).


TL;DR: TorchANI 2.0 is a PyTorch‑based toolkit for building and running neural‑network potentials for molecular simulations, offering GPU‑accelerated inference, training utilities, and integration with classical MD packages like Amber. It is a genuine AI/ML software project aimed at the computational chemistry community.

Related

  • Project
  • Project
  • Project
  • Project
  • Project