Skip to main content

GPUMA

GPUMA Logo

CI status PyPI version Python versions Documentation License: MIT


GPUMA is a minimalist Python toolkit for facile and rapid high-throughput molecular geometry optimization using machine-learning interatomic potentials (MLIPs).

Three model backends are supported out of the box:

All three backends support optional DFT-D3(BJ) dispersion correction.

GPUMA is especially designed for batch optimizations of many structures (conformer ensembles, datasets) on GPU, ensuring efficient parallelization and maximum GPU utilization by leveraging the torch-sim library. It wraps model backends and torch-sim functionality to provide both a simple command-line interface (CLI) and a small but expressive Python API for single- and multi-structure optimizations.

If conformer sampling is desired, GPUMA can generate conformer ensembles on the fly from SMILES strings. The SMILES → 3D embedding runs on the GPU via nvMolKit when a CUDA device is configured, and on the CPU via the morfeus library otherwise; the backend is chosen from technical.device like everywhere else in GPUMA. Alternative input formats are described in the CLI section below.

Feedback and improvements are always welcome!

Installation

Option 1: Install from PyPI (recommended)

This installs gpuma together with all dependencies (including the Fairchem UMA, ORB-v3, and SevenNet backends, as well as the nvMolKit GPU conformer-embedding backend). At the moment, installation and tests have only been validated under Python 3.12; using other Python versions is currently considered experimental.

GPU support: By default, pip install may pull a CPU-only build of PyTorch (especially on Windows). To enable GPU acceleration, install PyTorch with CUDA before installing GPUMA. Visit pytorch.org/get-started to get the install command for your platform and CUDA version, e.g.:

pip install torch --index-url https://download.pytorch.org/whl/cu124
  • Using a uv virtual environment

    # create and activate a fresh environment (Python 3.12)
    uv venv .venv --python 3.12
    
    # activate the environment
    
    # install PyTorch with CUDA support (pick your CUDA version at https://pytorch.org)
    uv pip install torch --index-url https://download.pytorch.org/whl/cu124
    
    # install gpuma from PyPI inside the environment
    uv pip install gpuma
    
  • Using a conda environment

    # create and activate a fresh environment with Python 3.12
    conda create -n gpuma-py312 python=3.12
    conda activate gpuma-py312
    
    # install PyTorch with CUDA support (pick your CUDA version at https://pytorch.org)
    pip install torch --index-url https://download.pytorch.org/whl/cu124
    
    # install gpuma from PyPI inside the environment
    pip install gpuma
    

GPU conformer embedding: SMILES → 3D conversion can run on the GPU via nvMolKit, which is a core dependency and installs automatically with GPUMA (it pins rdkit==2026.3.1 to match the RDKit build it is linked against). The backend is selected by technical.device in the config, as everywhere else in GPUMA: a CUDA device uses nvMolKit, otherwise the CPU (morfeus) backend is used and results stay valid. The GPU path needs an NVIDIA GPU (compute capability 7.0+); on CPU-only machines the package still installs and the CPU backend is used.

Option 2: Install from source

# clone the repository
git clone https://github.com/niklashoelter/gpuma.git
cd gpuma

# install PyTorch with CUDA support (pick your CUDA version at https://pytorch.org)
pip install torch --index-url https://download.pytorch.org/whl/cu124

# install using (uv) pip
uv pip install .
# or, without uv:
pip install .

Documentation

Full documentation is available at https://niklashoelter.github.io/gpuma/.

For local browsing of the Markdown sources, see in particular:

Using a configuration file is highly recommended for reproducibility and ease of use.

Also check the examples/ folder in the repository for sample config files and usage examples:

Required for UMA models:
To access the UMA models on Hugging Face, you must provide a token either via the HUGGINGFACE_TOKEN environment variable or via the config (direct token string or path to a file containing the token).

CLI Usage

The CLI is provided via the command gpuma. For best results, create a config file (JSON or YAML) and reference it in all CLI calls (see examples/config.json for a minimal example).

Examples: Batch optimization of multiple XYZ structures

Optimize all XYZ files in a directory (each file containing a single structure):

gpuma batch --xyz-dir examples/example_input_xyzs/multi_xyz_dir/ --output output.xyz --config examples/config.json

Optimize multiple structures contained in a single multi-XYZ file:

gpuma batch --multi-xyz examples/example_input_xyzs/multi_xyz_file.xyz --output output.xyz --config examples/config.json

Refer to the CLI documentation for details on configuration options, supported input formats (SMILES, XYZ, directories, multi-XYZ files), and additional CLI examples.

Python API

A minimalistic and high-level Python API is provided for easy integration into custom scripts and workflows.

For example usage, see:

Please refer to the documentation and examples for detailed usage examples and API reference.

Known limitations

When a run is started from SMILES, an RDKit/MMFF force field (via nvMolKit on GPU or the morfeus library on CPU) is used to generate an initial structure. Spin is not taken into account during this step, so the initial estimated geometries can be incorrect. When the MLIP models are applied subsequently, the structure can sometimes be optimized to a maximum rather than a minimum because the model is not provided with Hessian matrices. This behavior only affects runs originating from SMILES; it does not occur with better starting geometries (e.g., when starting from XYZ files).

Troubleshooting

  • Fairchem/UMA: ensure network access for model downloads and optionally set or provide huggingface_token (e.g., via a token file) to access the UMA model family.
  • ORB-v3: models are downloaded automatically on first use.
  • SevenNet: models are downloaded automatically on first use; multi-modal checkpoints (e.g. 7net-omni, 7net-mf-ompa) also require a model_modal fidelity (see docs/config.md).
  • D3 dispersion correction: set "d3_correction": true in the config to enable DFT-D3(BJ) for any backend (see docs/config.md).

License

MIT License (see LICENSE)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gpuma-0.7.0.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gpuma-0.7.0-py3-none-any.whl (53.5 kB view details)

Uploaded Python 3

File details

Details for the file gpuma-0.7.0.tar.gz.

File metadata

  • Download URL: gpuma-0.7.0.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.19

File hashes

Hashes for gpuma-0.7.0.tar.gz
Algorithm Hash digest
SHA256 f235bb6aed47b66a9cd1b1bee4f705005616d633499dda86b640c0452b0bbb64
MD5 d02895388e7e39bebfaf507a5f040a33
BLAKE2b-256 6ea2bc799c9e5225e4670697f8568e191719ca4854ac93e7f5559c26f6be26bd

See more details on using hashes here.

File details

Details for the file gpuma-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: gpuma-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 53.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.19

File hashes

Hashes for gpuma-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 315e374721c06e4598b6b68a9bec3d0490b01f94d7414908cb08d0614cd76d60
MD5 6ca81205734a45167f4cd3967b5d76d9
BLAKE2b-256 ded1337cc1d710959374ace009a4ae6db6be62b6e25c316c5ba55165460ac2ae

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page