torchani

Accurate Neural Network Potential on PyTorch

https://github.com/aiqm/torchani

Science Score: 59.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: acs.org
  • Committers with academic emails
    3 of 17 committers (17.6%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.0%) to scientific vocabulary

Keywords

deep-learning force-field molecular-simulation neural-network quantum-chemistry quantum-mechanics
Last synced: 6 months ago · JSON representation

Repository

Accurate Neural Network Potential on PyTorch

Basic Info
Statistics
  • Stars: 503
  • Watchers: 29
  • Forks: 138
  • Open Issues: 26
  • Releases: 25
Topics
deep-learning force-field molecular-simulation neural-network quantum-chemistry quantum-mechanics
Created almost 8 years ago · Last pushed 7 months ago
Metadata Files
Readme License Codeowners

README.md

TorchANI 2 logo

PyPI PyPI - Downloads conda page ci workflow conda workflow

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. For information and examples, please see the comprehensive documentation.

If you were using a previous version of TorchANI and your code does not work with TorchANI 2.0 check out the migration guide, there are very few breaking changes, most code should work with minimal modifications. If you can't figure something out please open a GitHub issue, we are here to help!

If you find a bug of TorchANI, or have some feature request, also feel free to open a GitHub issue.

TorchANI 2.0 is currently tested against PyTorch 2.5 and CUDA 12.4

Installation

From Anaconda.org, using conda

Coming Soon!

From PyPI, using pip

Coming Soon!

From source (GitHub repo), using conda or pip

To build and install TorchANI directly from the GitHub repo do the following:

```bash

Clone the repo and cd to the directory

git clone https://github.com/roitberg-group/torchanisandbox.git cd ./torchanisandbox

Create a conda (or mamba) environment

Note that dev_environment.yaml contains many optional dependencies needed to

build the compiled extensions, build the documentation, and run tests and tools

You can comment these out if you are not planning to do that

conda env create -f ./dev_environment.yaml ```

Instead of using a conda (or mamba) environment you can use a python venv, and install the torchani optional dependencies running pip install -r dev_requirements.txt.

Now you have two options, depending on whether you want to install the torchani compiled extensions. To install torchani with no compiled extensions run:

bash pip install --no-deps -v .

To install torchani with the cuAEV and MNP compiled extensions run instead:

```bash

Use 'ext-all-sms' instead of 'ext' if you want to build for all possible GPUs

pip install --config-settings=--global-option=ext --no-build-isolation --no-deps -v . ```

In both cases you can add the editable, -e, flag after the verbose, -v, flag if you want an editable install (for developers). The -v flag can of course be omitted, but it is sometimes handy to have some extra information about the installation process.

After this you can perform some optional steps if you installed the required dev dependencies:

```bash

Download files needed for testing and building the docs (optional)

bash ./download.sh

Build the documentation (optional)

sphinx-build docs/src docs/build

Manually run unit tests (optional)

cd ./tests pytest -v . ```

This process works for most use cases, but for more details regarding building the CUDA and C++ extensions refer to TorchANI CSRC.

From the internal Roitberg Group servers, using conda or pip

To install the internal version of TorchANI, hosted in the internal roitberg-group servers using conda run:

```bash conda create -n ani python=3.11 conda activate ani

The following command is all one line, and channels must be specified in that order

conda install \ -c http://moria.chem.ufl.edu/conda-pkgs \ -c pytorch \ -c nvidia \ -c conda-forge \ torchani ```

Note that this installation currently includes the compiled extensions by default, but it doesn't include either the ase module, to use it run also:

bash conda install -c conda-forge ase

From source in macOS

Note that there is no CUDA support on macOS and TorchANI is untested with Apple Metal Performance Shaders (MPS). The dev_environment.yaml file needs slight modifications if installing on macOS. Please consult the corresponding file and modify it before creating the conda environment.

GPU support

TorchANI can be run in CUDA-enabled GPUs. This is highly recommended unless doing simple debugging or tests. If you don't run TorchANI on a GPU, expect highly degraded performance. TorchANI is untested with AMD GPUs (ROCm | HIP).

CUDA and C++ extensions

A CUDA extension for speeding up AEV calculations and a C++ extension for parallelizing networks (MNP or Multi Net Parallel) using OpenMP are compiled by default in the conda package. They have to be built manually if installed from GitHub.

Command Line Interface

Torchani provides an executable script, torchani, with some utilities. Check usage by calling torchani --help.

Citations

Please cite the following paper if you use TorchANI:

  • Xiang Gao, Farhad Ramezanghorbani, Olexandr Isayev, Justin S. Smith, and Adrian E. Roitberg. TorchANI: A Free and Open Source PyTorch Based Deep Learning Implementation of the ANI Neural Network Potentials. Journal of Chemical Information and Modeling 2020 60 (7), 3408-3415, DOI for Citing

JCIM Cover

Notes for developers

  • Never commit to the master branch directly. If you need to change something, create a new branch and submit a PR on GitHub.
  • All the tests on GitHub must pass before your PR can be merged.
  • Code review is required before merging a pull request.

Details on the conda packages needed to build cuAEV and MNP

The CUDA libraries specified by the pytorch-cuda metapackage are not enough to build the extensions; the *-dev versions with the headers are required. We also pin the version of nvcc, since pytorch can't directly compile extensions with newer nvcc. We also pin the version of cccl due to torch's usage of thrust. Explicitly specifying setuptools and setuptools-scm is required since extensions have to be built with --no-build-isolation. Finally, g++ and gcc compilers that support C++17 are required for compilation (compiler version is pinned to ensure reproducibility). The required conda pkgs are then (sans the version constraints):

yaml - setuptools - setuptools-scm - gxx_linux-64 - gcc_linux-64 - nvidia::cuda-libraries-dev - nvidia::cuda-cccl - nvidia::cuda-nvcc

Building the TorchANI conda package

The conda package can be built locally using the recipe in ./recipe, by running:

bash cd ./torchani_sandbox conda install conda-build conda-verify mkdir ./conda-pkgs/ # This dir must exist before running conda-build conda build \ -c pytorch -c nvidia -c conda-forge \ --no-anaconda-upload \ --output-folder ./conda-pkgs/ \ ./recipe

The meta.yaml in the recipe assumes that the extensions are built using the system's CUDA Toolkit, located in /usr/local/cuda. If this is not possible, add the following dependencies to the host environment:

  • nvidia::cuda-libraries-dev={{ cuda }}
  • nvidia::cuda-nvcc={{ cuda }}
  • nvidia::cuda-cccl={{ cuda }}

and remove cuda_home=/usr/local/cuda from the build script. Note that doing this may significantly increase build time.

The CI (GitHub Actions Workflow) that tests that the conda pkg builds correctly runs only:

  • on pull requests that contain the string conda in the branch name.

The workflow that deploys the conda pkg to the internal server runs only:

  • on the default branch, at 00:00:00 every day
  • on pull requests that contain both the strings conda and release in the branch name

Owner

  • Name: AIQM
  • Login: aiqm
  • Kind: organization

Open Consortium for AI in Quantum Chemistry

GitHub Events

Total
  • Create event: 3
  • Release event: 1
  • Issues event: 5
  • Watch event: 44
  • Delete event: 2
  • Issue comment event: 7
  • Push event: 10
  • Pull request event: 3
  • Fork event: 14
Last Year
  • Create event: 3
  • Release event: 1
  • Issues event: 5
  • Watch event: 44
  • Delete event: 2
  • Issue comment event: 7
  • Push event: 10
  • Pull request event: 3
  • Fork event: 14

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 432
  • Total Committers: 17
  • Avg Commits per committer: 25.412
  • Development Distribution Score (DDS): 0.303
Past Year
  • Commits: 1
  • Committers: 1
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Gao, Xiang q****p@g****m 301
Farhad Ramezanghorbani f****h@u****m 40
Richard Xue y****o@g****m 39
Ignacio Pickering i****g@g****m 37
Kevin Ryan 4****n@u****m 2
Rocco Meli r****i@b****k 2
Alon Grinberg Dana a****d@m****u 1
Rocco Meli r****i@b****h 1
akkamesh a****1@g****m 1
Christian Devereux c****1@g****m 1
Ray Schireman 4****n@u****m 1
Nan Xu 3****s@u****m 1
imgbot[bot] i****]@u****m 1
kfir4444 7****4@u****m 1
Janan Zhu j****u@g****m 1
zubatyuk z****k@g****m 1
Stefan Doerr s****r@u****u 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 69
  • Total pull requests: 58
  • Average time to close issues: 8 months
  • Average time to close pull requests: 3 months
  • Total issue authors: 43
  • Total pull request authors: 18
  • Average comments per issue: 2.52
  • Average comments per pull request: 2.02
  • Merged pull requests: 43
  • Bot issues: 0
  • Bot pull requests: 2
Past Year
  • Issues: 8
  • Pull requests: 5
  • Average time to close issues: 2 months
  • Average time to close pull requests: about 7 hours
  • Issue authors: 8
  • Pull request authors: 5
  • Average comments per issue: 1.63
  • Average comments per pull request: 0.4
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • rschireman (6)
  • zasdfgbnm (6)
  • UnixJunkie (5)
  • RMeli (3)
  • JSLJ23 (3)
  • yueyericardo (3)
  • ndonyapour (2)
  • tfisher013 (2)
  • WardLT (2)
  • shubbey (2)
  • kryczko (2)
  • SamTov (2)
  • tengjieksee (1)
  • IgnacioJPickering (1)
  • qzhu2017 (1)
Pull Request Authors
  • yueyericardo (27)
  • IgnacioJPickering (10)
  • zasdfgbnm (8)
  • lohedges (2)
  • JMorado (2)
  • WardLT (1)
  • lgtm-com[bot] (1)
  • kfir4444 (1)
  • avanteijlingen (1)
  • RaulPPelaez (1)
  • jananzhu (1)
  • akkamesh (1)
  • rschireman (1)
  • RMeli (1)
  • cagrikymk (1)
Top Labels
Issue Labels
contribute-welcome (1)
Pull Request Labels
cuaev (1) dependencies (1)

Packages

  • Total packages: 4
  • Total downloads:
    • pypi 3,250 last-month
  • Total docker downloads: 139
  • Total dependent packages: 6
    (may contain duplicates)
  • Total dependent repositories: 13
    (may contain duplicates)
  • Total versions: 41
  • Total maintainers: 5
pypi.org: torchani

PyTorch implementation of ANI

  • Versions: 21
  • Dependent Packages: 3
  • Dependent Repositories: 6
  • Downloads: 3,081 Last month
  • Docker Downloads: 139
Rankings
Dependent packages count: 2.4%
Docker downloads count: 3.0%
Stargazers count: 3.2%
Average: 4.1%
Forks count: 4.4%
Downloads: 5.8%
Dependent repos count: 6.0%
Last synced: 7 months ago
conda-forge.org: torchani
  • Versions: 3
  • Dependent Packages: 3
  • Dependent Repositories: 7
Rankings
Dependent repos count: 12.9%
Dependent packages count: 15.6%
Average: 16.6%
Forks count: 17.7%
Stargazers count: 20.1%
Last synced: 7 months ago
pypi.org: obsv

ONIOM-based Strain Visualisation

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 26 Last month
Rankings
Dependent packages count: 7.4%
Downloads: 27.0%
Average: 34.4%
Dependent repos count: 68.9%
Maintainers (1)
Last synced: 11 months ago
pypi.org: fsv

Fragmentation-based Strain Visualisation

  • Versions: 14
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 143 Last month
Rankings
Dependent packages count: 9.2%
Average: 38.7%
Dependent repos count: 68.2%
Maintainers (1)
Last synced: 11 months ago

Dependencies

docs_requirements.txt pypi
  • h5py *
  • matplotlib *
  • pillow *
  • sphinx *
  • sphinx-gallery *
  • sphinx_rtd_theme *
  • tb-nightly *
setup.py pypi
  • importlib_metadata *
  • lark-parser *
  • requests *
  • torch *
test_requirements.txt pypi
  • ase * test
  • expecttest * test
  • h5py * test
  • pillow * test
  • pkbar * test
  • pytest * test
  • pyyaml * test
  • tb-nightly * test
  • tqdm * test
.github/workflows/clang-format.yml actions
  • actions/checkout v1 composite
.github/workflows/cuda.yml actions
  • actions/checkout v1 composite
  • actions/setup-python v1 composite
.github/workflows/deploy-docs.yml actions
  • actions/checkout v1 composite
  • actions/setup-python v1 composite
.github/workflows/deploy-pypi.yml actions
  • actions/checkout v1 composite
  • actions/setup-python v1 composite
.github/workflows/deploy-test-pypi.yml actions
  • actions/checkout v1 composite
  • actions/setup-python v1 composite
.github/workflows/docs.yml actions
  • actions/checkout v1 composite
  • actions/setup-python v1 composite
.github/workflows/flake8.yml actions
  • actions/checkout v1 composite
  • actions/setup-python v1 composite
.github/workflows/mypy.yml actions
  • actions/checkout v1 composite
  • actions/setup-python v1 composite
.github/workflows/runnable_submodules.yml actions
  • actions/checkout v1 composite
  • actions/setup-python v1 composite
.github/workflows/stable-torch.yml actions
  • actions/checkout v1 composite
  • actions/setup-python v1 composite
.github/workflows/tools.yml actions
  • actions/checkout v1 composite
  • actions/setup-python v1 composite
.github/workflows/unittest.yml actions
  • actions/checkout v1 composite
  • actions/setup-python v1 composite