TMol provides all-atom scoring, packing, minimization, and FastRelax in PyTorch. It batches proteins, nucleic acids, ligands, and complexes on CPU or CUDA, with gradients through coordinate scoring. On Apple silicon, CPU runs move their heaviest work onto the GPU automatically.
Documentation · Tutorials · API reference
Install from PyPI. For GPU use, first install PyTorch with the matching CUDA major, then choose one command:
python -m pip install tmol # CPU, including Apple Silicon
python -m pip install "tmol[cu12]" # CUDA 12-enabled PyTorch
python -m pip install "tmol[cu13]" # CUDA 13-enabled PyTorchThe base package contains the Python API, data, and CPU kernels. GPU extras add
tmol-ops-cu12 or tmol-ops-cu13 at the same version. GPU use also needs a
compatible NVIDIA driver; pip does not detect GPUs or select a PyTorch CUDA build.
The installation guide
covers requirements, verification, upgrades, and source builds. TMol wheels work
across supported PyTorch minor versions; no per-Torch wheel selection is needed.
import torch, tmol
print(tmol.__version__, tmol.has_cuda(), torch.cuda.is_available())Score a structure on CPU. With matching CUDA-enabled PyTorch and TMol operators,
use torch.device("cuda"):
import torch
import tmol
device = torch.device("cpu")
pose = tmol.pose_stack_from_file("input.pdb", device)
score_function = tmol.beta2016_score_function(device)
score = score_function.render_whole_pose_scoring_module(pose)
print(score(pose.coords))See the quickstart for scoring, minimization, repacking, FastRelax, batching, and ligand preparation. The visual glossary explains the concepts, and the score playground lets you rotate a side chain and inspect TMol scores in the browser. The tutorials are runnable notebooks, each also available in Colab.
git clone https://github.com/RosettaCommons/tmol.git
cd tmol
python -m pip install "torch>=2.14" "scikit-build-core>=0.10" "cmake>=3.24,<4" "pybind11>=2.12" ninja packaging
python -m pip install --no-build-isolation -e ".[dev]"The development guide covers builds, tests, benchmarks, and releases. See the contributor guide for code and documentation conventions, or agent skills for reusable coding-agent instructions.
If you use TMol in your work, please cite:
Andrew Leaver-Fay, Jeff Flatten, Alex Ford, Joseph Kleinhenz, Henry Solberg, David Baker, Andrew M. Watkins, Brian Kuhlman, Frank DiMaio, tmol: a GPU-accelerated, PyTorch implementation of Rosetta's relax protocol (manuscript in preparation).
TMol is available under the terms in LICENSE.