UMA

Meta has released the  Universal Model for Atoms  (UMA), which is a large foundation machine-learned potential trained on a diverse range of materials. Installing and launching UMA can be a bit tricky at first, so we outline the steps here.

Setup

    Make an account on  https://huggingface.co  using your academic e-mail address.
    Apply for model access at  https://huggingface.co/facebook/UMA  and sign the agreement. Make sure to put the full university name (e.g. "Princeton University" and not "Princeton").
    Add an access token to your Hugging Face account (Account > Access Tokens) and give the token read access permissions to the facebook/UMA repository.
    On the machine where you plan to run UMA and in a fresh Python environment, do pip install huggingface_hub[cli] to install the Hugging Face CLI tool. Remember that UMA is a machine-learned potential, so it should be run on a machine with GPUs.
    Optional but recommended: In your ~/.bashrc, set the HF_HOME environment variable to some location where storage limits are not much of a concern, like in a scratch directory. For instance, that might look like export HF_HOME=/scratch/gpfs/ROSENGROUP/<NetID>/huggingface. Then make sure to source ~/.bashrc so the changes are reflected.
    On the login node of the machine, run huggingface-cli login and paste your <HFToken> is the token from Step 3. Alternatively, you can define an environment variable named HF_TOKEN in your ~/.bashrc.
    Install the fairchem code via pip install fairchem-core in the fresh environment that you made in Step 4.
    Run a minimal calculation on the login node with your model of choice (example below). We are doing this because the first time you run UMA, it needs to download a few files, and the compute nodes do not have network access. If you wish to use a different model, simply modify the model_name variable accordingly.
from ase.build import bulk
from fairchem.core import pretrained_mlip, FAIRChemCalculator

atoms = bulk("Si")

model_name = "uma-s-1p1"
predictor = pretrained_mlip.get_predict_unit(model_name)
calc = FAIRChemCalculator(predictor, task_name="omat")

atoms.calc = calc
e = atoms.get_potential_energy()
print(e)
    Assuming the above calculation runs, then you are good to run UMA on the compute nodes. The first time you run a calculation on the compute nodes, check that the model is using the GPUs appropriately and is not accidentally running on the CPU instead. If there are problems, it usually means that you need to re-install  🔥PyTorch  with the appropriate configuration.