Skip to content

Commit

Permalink
add mac installation script and quickstart MD example (#45)
Browse files Browse the repository at this point in the history
* add one click script to uv pip install on mac

* add quickstart example

* update orb model source to aws
  • Loading branch information
chiang-yuan authored Jan 29, 2025
1 parent e8f2e75 commit 69330cc
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 3 deletions.
47 changes: 46 additions & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
> [!NOTE]
> Contributions of new tasks are very welcome! If you're interested in joining the effort, please reach out to Yuan at [[email protected]](mailto:[email protected]). See [project page](https://github.com/orgs/atomind-ai/projects/1) for some outstanding tasks, or propose new one in [Discussion](https://github.com/atomind-ai/mlip-arena/discussions/new?category=ideas).
MLIP Arena is a platform for evaluating foundation machine learning interatomic potentials (MLIPs) beyond conventional energy and force error metrics. It focuses on revealing the underlying physics and chemistry learned by these models and assessing their performance in molecular dynamics (MD) simulations. The platform's benchmarks are specifically designed to evaluate the readiness and reliability of open-source, open-weight models in accurately reproducing both qualitative and quantitative behaviors of atomic systems.
MLIP Arena is a unified platform for evaluating foundation machine learning interatomic potentials (MLIPs) beyond conventional error metrics. It focuses on revealing the underlying physics and chemistry learned by these models and assessing their utilitarian performance agnostic to underlying model architecture. The platform's benchmarks are specifically designed to evaluate the readiness and reliability of open-source, open-weight models in accurately reproducing both qualitative and quantitative behaviors of atomic systems.

MLIP Arena leverages modern pythonic workflow orchestractor [Prefect](https://www.prefect.io/) to enable advanced task/flow chaining and caching.

## Installation

Expand All @@ -24,6 +26,8 @@ pip install mlip-arena

### From source

**Linux**

```bash
git clone https://github.com/atomind-ai/mlip-arena.git
cd mlip-arena
Expand All @@ -36,6 +40,16 @@ pip install -e .[mace]
DP_ENABLE_TENSORFLOW=0 pip install -e .[deepmd]
```

**Mac**

```bash
# (Optional) Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/env
# One script installation
bash scripts/install-macosx.sh
```

## Contribute

MLIP Arena is now in pre-alpha. If you're interested in joining the effort, please reach out to Yuan at [[email protected]](mailto:[email protected]).
Expand All @@ -46,6 +60,37 @@ MLIP Arena is now in pre-alpha. If you're interested in joining the effort, plea
streamlit run serve/app.py
```

## Quickstart

### Molecular dynamics (MD)

Run all the compiled MLIPs by looping thorugh `MLIPEnum`:

```python
from mlip_arena.tasks.md import run as MD
# from mlip_arena.tasks import MD # convenient loading
from mlip_arena.models import MLIPEnum

from ase.build import bulk

atoms = bulk("Cu", "fcc", a=3.6)

results = []

for model in MLIPEnum:
result = MD(
atoms=atoms,
calculator_name=model,
calculator_kwargs={},
ensemble="nve",
dynamics="velocityverlet",
total_time=1e3, # 1 ps = 1e3 fs
time_step=2, # fs
)
results.append(result)

```

### Add new benchmark tasks (WIP)

> [!NOTE]
Expand Down
3 changes: 2 additions & 1 deletion mlip_arena/models/externals/orb.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ def __init__(
cache_dir.mkdir(parents=True, exist_ok=True)
ckpt_path = cache_dir / checkpoint

url = f"https://storage.googleapis.com/orbitalmaterials-public-models/forcefields/{checkpoint}"
# url = f"https://storage.googleapis.com/orbitalmaterials-public-models/forcefields/{checkpoint}"
url = f"https://orbitalmaterials-public-models.s3.us-west-1.amazonaws.com/forcefields/{checkpoint}"

if not ckpt_path.exists():
print(f"Downloading ORB model from {url} to {ckpt_path}...")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ test = [
"nvidia-ml-py==12.560.30",
"e3nn==0.5.0",
"matgl==1.1.2",
"dgl==2.4.0",
# "dgl==2.4.0",
"chgnet==0.3.8",
"fairchem-core==1.2.0",
"sevenn==0.9.3.post1",
Expand Down
18 changes: 18 additions & 0 deletions scripts/install-macosx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@


# (Optional) Install uv
# curl -LsSf https://astral.sh/uv/install.sh | sh
# source $HOME/.local/bin/env

TORCH=2.2.0

uv pip install torch==${TORCH}
uv pip install torch-scatter --no-build-isolation
uv pip install torch-sparse --no-build-isolation

uv pip install dgl -f https://data.dgl.ai/wheels/torch-${TORCH}/cpu/repo.html

uv pip install -e .[test]
uv pip install -e .[mace]


0 comments on commit 69330cc

Please sign in to comment.