https://github.com/openmm/nnpops

High-performance operations for neural network potentials

https://github.com/openmm/nnpops

Science Score: 36.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
  • Academic publication links
  • Committers with academic emails
    1 of 10 committers (10.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.1%) to scientific vocabulary

Keywords

cuda gpu machine-learning molecular-dynamics molecular-modeling

Keywords from Contributors

quantum-chemistry chemistry computational-chemistry
Last synced: 5 months ago · JSON representation

Repository

High-performance operations for neural network potentials

Basic Info
  • Host: GitHub
  • Owner: openmm
  • License: other
  • Language: C++
  • Default Branch: master
  • Homepage:
  • Size: 232 KB
Statistics
  • Stars: 93
  • Watchers: 6
  • Forks: 19
  • Open Issues: 28
  • Releases: 7
Topics
cuda gpu machine-learning molecular-dynamics molecular-modeling
Created over 5 years ago · Last pushed 12 months ago
Metadata Files
Readme License

README.md

GH Actions Status Conda Anaconda Cloud Badge

NNPOps

The goal of this project is to promote the use of neural network potentials (NNPs) by providing highly optimized, open source implementations of bottleneck operations that appear in popular potentials. These are the core design principles.

  1. Each operation is entirely self contained, consisting of only a few source files that can easily be incorporated into any code that needs to use it.

  2. Each operation has a simple, clearly documented API allowing it to be easily used in any context.

  3. We provide both CPU (pure C++) and CUDA implementations of all operations.

  4. The CUDA implementations are highly optimized. The CPU implementations are written in a generally efficient way, but no particular efforts have been made to tune them for optimum performance.

  5. This code is designed for inference (running simulations), not training (creating new potential functions). It computes gradients with respect to particle positions, not model parameters.

Installation

Install with Conda

A conda package can be installed from the conda-forge channel: bash conda install -c conda-forge nnpops If you don't have conda, we recommend installing Miniconda.

Build from source

Prerequisites

  • CUDA Toolkit (https://developer.nvidia.com/cuda-downloads)
  • Miniconda (https://docs.conda.io/en/latest/miniconda.html#linux-installers)

Build & install

  • Get the source code bash $ git clone https://github.com/openmm/NNPOps.git

  • Set CUDA_HOME bash $ export CUDA_HOME=/usr/local/cuda-11.2

  • Crate and activate a Conda environment bash $ cd NNPOps $ conda env create -n nnpops -f environment.yml $ conda activate nnpops

  • Configure, build, and install bash $ mkdir build && cd build $ cmake .. \ -DTorch_DIR=$(python -c 'import torch.utils; print(torch.utils.cmake_prefix_path)')/Torch \ -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX $ make install

  • Run the tests bash $ ctest --verbose

Usage

Accelerated TorchANI operations: - torchani.AEVComputer - torchani.neurochem.NeuralNetwork

Example

```python import mdtraj import torch import torchani

from NNPOps.SpeciesConverter import TorchANISpeciesConverter from NNPOps.SymmetryFunctions import TorchANISymmetryFunctions from NNPOps.BatchedNN import TorchANIBatchedNN from NNPOps.EnergyShifter import TorchANIEnergyShifter

from NNPOps import OptimizedTorchANI

device = torch.device('cuda')

Load a molecule

molecule = mdtraj.load('molecule.mol2') species = torch.tensor([[atom.element.atomicnumber for atom in molecule.top.atoms]], device=device) positions = torch.tensor(molecule.xyz * 10, dtype=torch.float32, requiresgrad=True, device=device)

Construct ANI-2x and replace its operations with the optimized ones

nnp = torchani.models.ANI2x(periodictableindex=True).to(device) nnp.speciesconverter = TorchANISpeciesConverter(nnp.speciesconverter, species).to(device) nnp.aevcomputer = TorchANISymmetryFunctions(nnp.speciesconverter, nnp.aevcomputer, species).to(device) nnp.neuralnetworks = TorchANIBatchedNN(nnp.speciesconverter, nnp.neuralnetworks, species).to(device) nnp.energyshifter = TorchANIEnergyShifter(nnp.speciesconverter, nnp.energy_shifter, species).to(device)

Compute energy and forces

energy = nnp((species, positions)).energies energy.backward() forces = -positions.grad.clone()

print(energy, forces)

Alternatively, all the optimizations can be applied with OptimizedTorchANI

nnp2 = torchani.models.ANI2x(periodictableindex=True).to(device) nnp2 = OptimizedTorchANI(nnp2, species).to(device)

Compute energy and forces again

energy = nnp2((species, positions)).energies positions.grad.zero_() energy.backward() forces = -positions.grad.clone()

print(energy, forces) ```

Owner

  • Name: OpenMM
  • Login: openmm
  • Kind: organization
  • Email: john.chodera@choderalab.org

OpenMM is a toolkit for molecular simulation using high performance GPU code

GitHub Events

Total
  • Issues event: 1
  • Watch event: 13
  • Issue comment event: 14
  • Push event: 20
  • Pull request review event: 4
  • Pull request review comment event: 4
  • Pull request event: 7
  • Fork event: 3
  • Create event: 3
Last Year
  • Issues event: 1
  • Watch event: 13
  • Issue comment event: 14
  • Push event: 20
  • Pull request review event: 4
  • Pull request review comment event: 4
  • Pull request event: 7
  • Fork event: 3
  • Create event: 3

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 88
  • Total Committers: 10
  • Avg Commits per committer: 8.8
  • Development Distribution Score (DDS): 0.443
Past Year
  • Commits: 3
  • Committers: 3
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.667
Top Committers
Name Email Commits
Raimondas Galvelis r****s@a****m 49
Peter Eastman p****n@s****u 20
Raul r****z@g****m 9
Raimondas Galvelis r****s@g****m 3
Stephen Farr s****3@g****m 2
Stefan Doerr s****r@g****m 1
Richard Xue y****o@g****m 1
Mike Henry 1****y 1
Lester Hedges l****s@g****m 1
Kevin Boyd k****d@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 56
  • Total pull requests: 72
  • Average time to close issues: 2 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 22
  • Total pull request authors: 11
  • Average comments per issue: 6.71
  • Average comments per pull request: 4.81
  • Merged pull requests: 53
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 2
  • Pull requests: 9
  • Average time to close issues: 16 minutes
  • Average time to close pull requests: 7 days
  • Issue authors: 2
  • Pull request authors: 2
  • Average comments per issue: 1.5
  • Average comments per pull request: 2.33
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • raimis (12)
  • jchodera (6)
  • peastman (6)
  • RaulPPelaez (5)
  • dominicrufa (4)
  • wiederm (3)
  • sef43 (2)
  • JSLJ23 (2)
  • davkovacs (2)
  • mikemhenry (2)
  • zanebeckwith (1)
  • proteneer (1)
  • BJWiley233 (1)
  • keano130 (1)
  • yueyericardo (1)
Pull Request Authors
  • raimis (28)
  • peastman (16)
  • RaulPPelaez (10)
  • stefdoerr (4)
  • mikemhenry (2)
  • lohedges (2)
  • sef43 (2)
  • yueyericardo (2)
  • moradza (1)
  • SimonBoothroyd (1)
  • scal444 (1)
Top Labels
Issue Labels
help wanted (10) question (8) enhancement (6) bug (3)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 1
conda-forge.org: nnpops
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 1
Rankings
Dependent repos count: 24.3%
Stargazers count: 38.9%
Average: 39.1%
Forks count: 41.7%
Dependent packages count: 51.6%
Last synced: 6 months ago

Dependencies

.github/workflows/ci.yml actions
  • Jimver/cuda-toolkit v0.2.8 composite
  • actions/checkout v2 composite
  • conda-incubator/setup-miniconda v2 composite
.github/workflows/self-hosted-gpu-test.yml actions
  • actions/checkout v3 composite
  • aws-actions/configure-aws-credentials v1 composite
  • conda-incubator/setup-miniconda v2 composite
  • machulav/ec2-github-runner main composite
environment.yml pypi