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).

Four model backends are supported out of the box:

Fairchem UMA, ORB-v3 and SevenNet support optional DFT-D3(BJ) dispersion correction. It is off by default and rejected for the default uma-s-1p2p1-ft-d4rev and the AIMNet2 models, which already include dispersion.

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

This installs gpuma together with all dependencies (including the Fairchem UMA, ORB-v3, SevenNet and AIMNet2 backends, as well as the nvMolKit GPU conformer-embedding backend). Every dependency is pinned to the exact tested version, so install gpuma into a fresh environment. 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. Keep torch==2.13.0, which gpuma pins, and only change the cuXXX index, e.g.:

pip install torch==2.13.0 --index-url https://download.pytorch.org/whl/cu126

The cu126 build runs on drivers from 525 on; the default PyPI build needs driver 580 or newer.

  • 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 2.13.0 with CUDA support (keep the version, pick the cuXXX index for your driver)
    uv pip install torch==2.13.0 --index-url https://download.pytorch.org/whl/cu126
    
    # 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 2.13.0 with CUDA support (keep the version, pick the cuXXX index for your driver)
    pip install torch==2.13.0 --index-url https://download.pytorch.org/whl/cu126
    
    # 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 2.13.0 with CUDA support (keep the version, pick the cuXXX index for your driver)
pip install torch==2.13.0 --index-url https://download.pytorch.org/whl/cu126

# 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 HF_TOKEN environment variable or via the config (direct token string or path to a file containing the token).

Using with AI agents

GPUMA ships a skill for AI coding agents (Claude Code, Codex, Gemini CLI, Copilot, Cursor), so chemists can run it in plain language without writing Python. Install it with gpuma skills install and check the machine with gpuma doctor; see docs/agents.md.

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).
  • AIMNet2: models are downloaded automatically on first use. They cover 14 elements, and only aimnet2-nse handles open-shell structures; other inputs are rejected before the model loads (see docs/config.md).
  • BFGS: "batch_optimizer": "bfgs" keeps a dense Hessian per structure and can run out of GPU memory on large batch jobs with any backend; prefer lbfgs or fire.
  • D3 dispersion correction: off by default. Set "d3_correction": true to enable DFT-D3(BJ) for models trained without dispersion. It is rejected for uma-s-1p2p1-ft-d4rev and AIMNet2 and logs a warning for the other UMA models, ORB *_omol models and SevenNet omol25_* modals (see docs/config.md).

License

MIT License (see LICENSE)

Metadata

Release files for gpuma 0.9.0

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

Source distribution (sdist)

Source distribution for gpuma 0.9.0
File Size Uploaded Provenance Actions
gpuma-0.9.0.tar.gz 2.2 MB Without provenance Details for gpuma-0.9.0.tar.gz

Built distribution (wheel)

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

Total release size: 2.3 MB

Release files / gpuma-0.9.0.tar.gz

Download URL gpuma-0.9.0.tar.gz
Size 2.2 MB
Tags Source
SHA-256 checksum
How to use checksums
e5b87fab30fc53a45c99e5d6325d88cca39fc77714c3e8dd41fb75a573ff1997
BLAKE2b-256 checksum
How to use checksums
6249763528a553e957b9469be3502511e65bea5eb98c64493a044a6a633bd73e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Release files / gpuma-0.9.0-py3-none-any.whl

Download URL gpuma-0.9.0-py3-none-any.whl
Size 97.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e1cdf0f042c32cb0e474fcc8d79808a9ea8cab34213d8b2f6d761fff563f9a3e
BLAKE2b-256 checksum
How to use checksums
7c33e4038e71f8faebd331c6f543ce2663724653662353be7542558042b72674
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Security for gpuma 0.9.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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