Skip to main content

GPUMA - Geometry optimization toolkit using Fairchem UMA models and Torch-Sim

Project description

GPUMA

GPUMA Logo

GPUMA is a minimalist Python toolkit for facile and rapid high-throughput molecular geometry optimization based on the UMA/OMol25 machine-learning interatomic potential.

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 Fairchem UMA models 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 using the morfeus library. Alternative input formats are described in the CLI section below.

Feedback and improvements are always welcome!

Installation

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

Option 1: Install from PyPI (recommended)

This installs gpuma together with its core dependencies. At the moment, installation and tests have only been validated under Python 3.12; using other Python versions is currently considered experimental.

  • Using a uv virtual environment

    # create and activate a fresh environment
    uv venv .venv
    
    # activate the environment
    
    # 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 gpuma from PyPI inside the environment
    pip install gpuma
    

Option 2: Install from source

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

# 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:

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 optimize --config examples/config.json --xyz-dir examples/example_input_xyzs/multi_xyz_dir/

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

gpuma optimize --config examples/config.json --xyz examples/example_input_xyzs/multi_xyz_file.xyz

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 force field (via the morfeus library) 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 UMA/Omol25 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

  • Missing libraries: install optional dependencies like pyyaml if you use YAML configs.
  • 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.

License

MIT License (see LICENSE)

Project details


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.5.1.tar.gz (43.7 kB view details)

Uploaded Source

Built Distribution

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

gpuma-0.5.1-py3-none-any.whl (27.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gpuma-0.5.1.tar.gz
  • Upload date:
  • Size: 43.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for gpuma-0.5.1.tar.gz
Algorithm Hash digest
SHA256 55b75021930bc9ef9cb3841020d5605355f9548effcef717af024c3eb168d2ee
MD5 2e28f2c5d832d914b5731fc01adb775b
BLAKE2b-256 cbe1a34475a19c10bbbb51d3ca822595232623e0e4d5e27de7e0a47b28ed5b60

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gpuma-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 27.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for gpuma-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 58007053fdbe50c1968f7fed7ec082e21a70bbd7580fd2398bb896caf26f7266
MD5 03c598fb50f24991918b896fab6c4300
BLAKE2b-256 76d633252ae2a2cb1a67f65f0e44b35675e2161b937acd50442b6091ac558af1

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