Garden's Almanac of Matter Models

Orb-v3

January 2025

Checkpoint Params Polaris Sophia Perlmutter Delta Frontier Della
orb-v3-conservative-20-omat 25.5M
orb-v3-conservative-20-mpa 25.5M
orb-v3-conservative-inf-omat 25.5M
orb-v3-conservative-inf-mpa 25.5M
orb-v3-direct-20-omat
orb-v3-direct-20-mpa
orb-v3-direct-inf-omat
orb-v3-direct-inf-mpa
orb-v3:custom
verified, last 30 days installed, not recently verified not installed

No cluster has installed any checkpoint of this model yet.


Running this model
1# from a job or interactive session on a supported cluster:
2from rootstock import RootstockCalculator
3
4with RootstockCalculator(
5 cluster=YOUR_CLUSTER_ID, # eg, "polaris", "sophia"
6 checkpoint="orb-v3-conservative-20-omat",
7 device="cuda",
8) as calc:
9 # model is now running in subprocess on compute node
10 atoms.calc = calc
11 atoms.get_potential_energy()

Environments

Rootstock runs each model family inside an isolated Python environment defined by a single file. This environment file includes the specific dependencies needed, plus a setup() function that loads the model and returns an ASE calculator. These files are usually almost identical for a given model family, but because of cluster-specific quirks (eg, an old CUDA driver) the dependencies and setup code can vary a bit.

orb_v3_env.py
1# /// script
2# # <3.13: orb-models pins dm-tree==0.1.8, which has no cp313 wheel and whose
3# # sdist doesn't compile against modern GCC (vendored abseil).
4# requires-python = ">=3.12,<3.13"
5# dependencies = [
6# "orb-models>=0.6.2",
7# "ase>=3.25",
8# "torch>=2.8",
9# # Not imported here — constrains orb-models' transitive dep. setup()'s
10# # no-lock serve path relies on cached_path returning local files without
11# # locking or writing, verified against exactly this version (#67).
12# "cached_path==1.8.10",
13# ]
14#
15# [tool.uv.sources]
16# torch = { index = "pytorch-cu128" }
17#
18# [[tool.uv.index]]
19# name = "pytorch-cu128"
20# url = "https://download.pytorch.org/whl/cu128"
21# explicit = true
22# ///
23"""Orb v3 env — the primary orb env, Orbital Materials' Orb v3 potentials.
24
25Separate from orb.py because the v3 loaders need orb-models>=0.6.2, which
26bumped the Python floor to 3.12 and torch to 2.8; the v3 loader API also
27differs (returns a tuple, requires `atoms_adapter` on ORBCalculator, imports
28the calculator from forcefield.inference). orb.py (v2) survives only for
29orb-d3-v2, the dispersion-corrected variant with no v3 equivalent.
30"""
31
32import os
33import shutil
34import urllib.request
35from pathlib import Path
36
37CHECKPOINTS = {
38 "orb-v3-conservative-inf-omat": "orb-v3-conservative-inf-omat",
39 "orb-v3-conservative-20-omat": "orb-v3-conservative-20-omat",
40 "orb-v3-direct-inf-omat": "orb-v3-direct-inf-omat",
41 "orb-v3-direct-20-omat": "orb-v3-direct-20-omat",
42 "orb-v3-conservative-inf-mpa": "orb-v3-conservative-inf-mpa",
43 "orb-v3-conservative-20-mpa": "orb-v3-conservative-20-mpa",
44 "orb-v3-direct-inf-mpa": "orb-v3-direct-inf-mpa",
45 "orb-v3-direct-20-mpa": "orb-v3-direct-20-mpa",
46 # The omol ids (orb-v3-{conservative,direct}-omol) are dropped from the
47 # catalog 2026-07-30: they had been failing verify on every cluster since
48 # 2026-05. Re-add once the failure is understood.
49 # Your own fine-tuned v3 weights: pair with weights= (loaded via
50 # setup_from_path).
51 "orb-v3:custom": None,
52}
53
54
55def _default_weights_url(load_fn) -> str:
56 """The upstream URL baked into the loader's ``weights_path`` default."""
57 import inspect
58
59 default = inspect.signature(load_fn).parameters["weights_path"].default
60 if not isinstance(default, str) or not default.startswith(("http://", "https://")):
61 raise RuntimeError(
62 f"{load_fn.__name__} has no URL default for weights_path "
63 f"(got {default!r}); update this env file for the installed orb-models"
64 )
65 return default
66
67
68def _local_weights_path(url: str) -> Path:
69 """Where the checkpoint lives in the shared model cache."""
70 cache = Path(os.environ.get("XDG_CACHE_HOME") or Path.home() / ".cache")
71 return cache / "orb" / os.path.basename(url)
72
73
74def _fetch(url: str, dest: Path) -> None:
75 """Download ``url`` to ``dest`` atomically (tmp file + rename)."""
76 dest.parent.mkdir(parents=True, exist_ok=True)
77 tmp = dest.with_name(f"{dest.name}.tmp.{os.getpid()}")
78 try:
79 with urllib.request.urlopen(url) as resp, open(tmp, "wb") as out:
80 shutil.copyfileobj(resp, out)
81 os.replace(tmp, dest)
82 finally:
83 tmp.unlink(missing_ok=True)
84
85
86def setup(checkpoint: str, device: str = "cuda", precision: str = "float32-high"):
87 import torch
88 from orb_models.forcefield import pretrained
89 from orb_models.forcefield.inference.calculator import ORBCalculator
90
91 fn_name = CHECKPOINTS[checkpoint].replace("-", "_")
92 load_fn = getattr(pretrained, fn_name)
93
94 # orb-models resolves its default weights URL through `cached_path`, which
95 # write-locks its cache dir even on warm hits — EACCES for anyone who can't
96 # write the shared install (Garden-AI/rootstock#67). Handed a *local* path
97 # instead, cached_path returns it without locking. So the weights are
98 # pre-fetched into the shared model cache at `rootstock add` time
99 # (maintainer, cache writable) and every later serve loads that file.
100 url = _default_weights_url(load_fn)
101 weights = _local_weights_path(url)
102 if not weights.exists():
103 _fetch(url, weights)
104
105 orbff, atoms_adapter = load_fn(
106 weights_path=str(weights), device=torch.device(device), precision=precision
107 )
108 return ORBCalculator(orbff, atoms_adapter=atoms_adapter, device=torch.device(device))
109
110
111def setup_from_path(
112 path: str,
113 device: str = "cuda",
114 arch: str = "orb-v3-conservative-inf-omat",
115 precision: str = "float32-high",
116):
117 # Custom checkpoints (`:custom` ids with user weights). A weights file doesn't say
118 # which orb architecture produced it, so `arch` names the pretrained
119 # loader to instantiate — pass the right one at call time
120 # (setup_kwargs={"arch": ...} / --kwarg arch=...). Handing the loader a
121 # local path also means no network and no cached_path locking (see setup()).
122 import torch
123 from orb_models.forcefield import pretrained
124 from orb_models.forcefield.inference.calculator import ORBCalculator
125
126 fn_name = arch.replace("-", "_")
127 try:
128 load_fn = getattr(pretrained, fn_name)
129 except AttributeError:
130 raise ValueError(
131 f"unknown orb architecture {arch!r}; expected a loader name from "
132 f"orb_models.forcefield.pretrained, e.g. orb-v3-conservative-inf-omat"
133 ) from None
134
135 orbff, atoms_adapter = load_fn(
136 weights_path=path, device=torch.device(device), precision=precision
137 )
138 return ORBCalculator(orbff, atoms_adapter=atoms_adapter, device=torch.device(device))
139

Built on Polaris: 2026-07-31

Couldn't load the current environments from Rootstock.


References
  1. Rhodes, Benjamin, Vandenhaute, Sander, Šimkus, Vaidotas, Gin, James, Godwin, Jonathan, Duignan, Tim, Neumann, Mark, Orb-v3: atomistic simulation at scale, arXiv, 2025.