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

Option 1: Install from PyPI (recommended)

pip install gpuma

This installs gpuma together with its core dependencies. Make sure you are using Python 3.12 or newer.

⚠️ 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 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.0.tar.gz (41.5 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.0-py3-none-any.whl (27.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gpuma-0.5.0.tar.gz
  • Upload date:
  • Size: 41.5 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.0.tar.gz
Algorithm Hash digest
SHA256 84d9f3f8c969378e72fade8ad7f57a69fa723e9e44beeb94f10f0f96ab2d2267
MD5 1788c37bde913bf713c04028cf8a27f5
BLAKE2b-256 e6789c9845ec133dea9a0296193de616f315b5300438675c5c23a24457763331

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gpuma-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 27.5 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 649ceb7012954962112dfe1345ab6de8b9e3df3d1bbedf2a6b8ba74a108b2138
MD5 86cd42194850fbe509574003a4fe0365
BLAKE2b-256 3e77dc6b5af94564d3a4083edf291bedb8ac9d41976f9561443d7ecd0e371a38

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