Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
93d13d5
Pushing existing FAIR code
abhshkdz Jan 31, 2023
80fd7aa
Merge branch 'main' into mace
abhshkdz Jan 31, 2023
4e037f1
Drop fb license note from mace trainer
abhshkdz Jan 31, 2023
d3d91bc
Corrected configs
abhshkdz Jan 31, 2023
aa5ab51
Updating scale, shift stats
abhshkdz Jan 31, 2023
ca93c8a
config for the tiny dataset
abhshkdz Feb 1, 2023
f039a58
Remove stray breakpoint; exact nbrs config
abhshkdz Feb 1, 2023
82fcea1
Updating loss functions to follow the mace trainer
abhshkdz Feb 18, 2023
22f1562
Changes to train on total energies and correctly compute linref energies
abhshkdz Feb 19, 2023
78f82fd
Update Z one-hot embedding to only consider elements present in dataset
abhshkdz Feb 22, 2023
dfcdeee
Sanity check idx
abhshkdz Feb 22, 2023
7ad890b
Updating interaction_cls_first to be consistent with Ilyes
abhshkdz Feb 22, 2023
44dc305
Some more configs
abhshkdz Feb 22, 2023
d52b000
Some more metrics to track
abhshkdz Feb 22, 2023
d04a1e4
Config + script for loading Ilyes' weights
abhshkdz Feb 22, 2023
591ff45
Getting neighborlist from ase
abhshkdz Feb 22, 2023
4a5b5c2
Corresponding config
abhshkdz Feb 22, 2023
dc89643
Lint
abhshkdz Feb 22, 2023
6030d3b
Support for training on all atoms with mace_trainer
abhshkdz Mar 30, 2023
9484e69
Latest E0s
abhshkdz Mar 30, 2023
27d68fc
Latest configs
abhshkdz Mar 30, 2023
ed6a3d7
max_ell=4 and Adam weight decay sweeps
abhshkdz Mar 31, 2023
9959f1a
Support for gaussian rbf
abhshkdz Apr 3, 2023
01aeb01
Configs for scaling up, support for controllable rbf hidden channels
abhshkdz Apr 5, 2023
020ceb7
Scaling up to 1024 hidden_irreps
abhshkdz Apr 6, 2023
300645c
Direct force prediction via gated equivariant blocks
abhshkdz Apr 6, 2023
679875b
Direct prediction MACE training only on interaction energies
abhshkdz Apr 7, 2023
fce03c9
Trying max_ell=4, higher weight decay, training on all atoms
abhshkdz Apr 8, 2023
d9d713e
Reorganizing code a bit
abhshkdz Apr 12, 2023
9ab51a8
Support for species-agnostic interaction and contraction
abhshkdz Apr 12, 2023
3f2bdd6
Linear skip connection for node features
abhshkdz Apr 18, 2023
7c11cdb
Conv weights from source, target nodes and rbf embeddings
abhshkdz Apr 25, 2023
c126d54
final config that worked
abhshkdz Apr 29, 2023
be2204d
Support for making source / target node feature size configurable
abhshkdz May 1, 2023
12c9ed4
Species-dependent + source/target conv
abhshkdz May 1, 2023
528d126
Source/target edge weights, multiple convs, identity skip block
samwaltonnorwood Jun 27, 2023
e0b5fa0
Merge pull request #2 from samwaltonnorwood/edge-gated
abhshkdz Aug 23, 2023
e6653e5
EdgeGated config
abhshkdz Sep 19, 2023
5f49261
EdgeGatedInteractionBlock with augmented edge features
abhshkdz Nov 3, 2023
11373a8
Larger h512 model with edge-gating + source-target edge features for tp
abhshkdz Nov 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions configs/s2ef/2M/mace/012702_128x0e_128x1o_128x2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
trainer: mace_trainer

logger: wandb

task:
dataset: lmdb
primary_metric: forces_mae
train_on_free_atoms: True
eval_on_free_atoms: True

dataset:
- src: /datasets01/open_catalyst/oc20/082422/struct_to_energy_forces/train/2M
# Switch off normalize_labels since scale_shift in the MACE model does the same thing.
normalize_labels: False
# target_mean: -0.7554450631141663
# target_std: 2.887317180633545
# grad_target_mean: 0.0
# grad_target_std: 2.887317180633545
- src: /datasets01/open_catalyst/oc20/082422/struct_to_energy_forces/val/id_30k

model:
name: scaleshift_mace
# Copied from https://github.com/ACEsuit/mace#training.
r_max: 6.0 # was originally 5.0
# Use `avg_num_neighbors` = 50 if r_max is 12.0, 35 if r_max is 6.0.
# This is because max_neighbors is set to 50. At r_max = 12, we get all nbrs.
avg_num_neighbors: 35
num_bessel: 8
num_polynomial_cutoff: 5
max_ell: 3
num_interactions: 3
num_elements: 83
hidden_irreps: 128x0e + 128x1o + 128x2e
MLP_irreps: 128x0e
# atomic_energies: ref energy per atomic number.
correlation: 3
atomic_inter_shift: -0.75544
atomic_inter_scale: 2.88732
# OCP flags.
regress_forces: True
otf_graph: True
use_pbc: True

optim:
batch_size: 8
eval_batch_size: 8
load_balancing: atoms
eval_every: 1000
num_workers: 2
# Default in MACE (https://github.com/ACEsuit/mace/blob/main/mace/tools/arg_parser.py#L234)
# was 1.e-2.
lr_initial: 1.e-2
optimizer: AdamW
optimizer_params: {"amsgrad": True}
scheduler: ReduceLROnPlateau
mode: min
factor: 0.8
# In the MACE code, the RLROP scheduler is run every epoch even if validation loss is stale.
# https://github.com/ACEsuit/mace/blob/5470b632d839358faed4e9c97f67fece1b558962/mace/tools/train.py#L149
# In the OCP code, we step the scheduler only when validation loss is recomputed.
# https://github.com/ACEsuit/mace-ocp/blob/main/ocpmodels/trainers/forces_trainer.py#L412
# And so we should probably keep a lower patience. Using default from OCP for now.
patience: 3
max_epochs: 40
# TODO(@abhshkdz): implement the swa scheduler, i.e. switch to high energy coefficient and low force coefficient after loss plateaus with initial coefficients.
force_coefficient: 100
energy_coefficient: 1
# default from https://github.com/ACEsuit/mace/blob/main/mace/tools/arg_parser.py#L285
ema_decay: 0.99
# default from https://github.com/ACEsuit/mace/blob/main/mace/tools/arg_parser.py#L321
clip_grad_norm: 10
loss_energy: mae
loss_force: l2mae
# default from https://github.com/ACEsuit/mace/blob/main/mace/tools/arg_parser.py#L240.
weight_decay: 5.e-7

slurm:
constraint: "volta32gb"
80 changes: 80 additions & 0 deletions configs/s2ef/2M/mace/013101_correct_scaleshift_weight_decay.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
trainer: mace_trainer

logger: wandb

task:
dataset: lmdb
primary_metric: forces_mae
train_on_free_atoms: True
eval_on_free_atoms: True

dataset:
- src: /datasets01/open_catalyst/oc20/082422/struct_to_energy_forces/train/2M
# Switch off normalize_labels since scale_shift in the MACE model does the same thing.
normalize_labels: False
# target_mean: -0.7554450631141663
# target_std: 2.887317180633545
# grad_target_mean: 0.0
# grad_target_std: 2.887317180633545
- src: /datasets01/open_catalyst/oc20/082422/struct_to_energy_forces/val/id_30k

model:
name: scaleshift_mace
# Copied from https://github.com/ACEsuit/mace#training.
r_max: 6.0 # was originally 5.0
# Use `avg_num_neighbors` = 50 if r_max is 12.0, 35 if r_max is 6.0.
# This is because max_neighbors is set to 50. At r_max = 12, we get all nbrs.
avg_num_neighbors: 35
num_bessel: 8
num_polynomial_cutoff: 5
max_ell: 3
num_interactions: 3
num_elements: 83
hidden_irreps: 128x0e + 128x1o
MLP_irreps: 128x0e
# atomic_energies: ref energy per atomic number.
correlation: 3
# torch.div(energies, natoms).mean()
atomic_inter_shift: -0.0106
# torch.sqrt(torch.mean(torch.square(forces)))
atomic_inter_scale: 0.4263
# OCP flags.
regress_forces: True
otf_graph: True
use_pbc: True

optim:
batch_size: 16
eval_batch_size: 16
load_balancing: atoms
eval_every: 1000
num_workers: 2
# Default in MACE (https://github.com/ACEsuit/mace/blob/main/mace/tools/arg_parser.py#L234)
# was 1.e-2.
lr_initial: 1.e-2
optimizer: AdamW
optimizer_params: {"amsgrad": True}
scheduler: ReduceLROnPlateau
mode: min
factor: 0.8
# In the MACE code, the RLROP scheduler is run every epoch even if validation loss is stale.
# https://github.com/ACEsuit/mace/blob/5470b632d839358faed4e9c97f67fece1b558962/mace/tools/train.py#L149
# In the OCP code, we step the scheduler only when validation loss is recomputed.
# https://github.com/ACEsuit/mace-ocp/blob/main/ocpmodels/trainers/forces_trainer.py#L412
# And so we should probably keep a lower patience. Using default from OCP for now.
patience: 3
max_epochs: 40
# TODO(@abhshkdz): implement the swa scheduler, i.e. switch to high energy coefficient and low force coefficient after loss plateaus with initial coefficients.
force_coefficient: 100
energy_coefficient: 1
# default from https://github.com/ACEsuit/mace/blob/main/mace/tools/arg_parser.py#L285
ema_decay: 0.99
# default from https://github.com/ACEsuit/mace/blob/main/mace/tools/arg_parser.py#L321
clip_grad_norm: 10
loss_energy: mae
loss_force: l2mae
# default from https://github.com/ACEsuit/mace/blob/main/mace/tools/arg_parser.py#L240.
weight_decay: 1.e-10

slurm:
constraint: "volta32gb"
80 changes: 80 additions & 0 deletions configs/s2ef/2M/mace/013102_128x0e_128x1o_128x2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
trainer: mace_trainer

logger: wandb

task:
dataset: lmdb
primary_metric: forces_mae
train_on_free_atoms: True
eval_on_free_atoms: True

dataset:
- src: /datasets01/open_catalyst/oc20/082422/struct_to_energy_forces/train/2M
# Switch off normalize_labels since scale_shift in the MACE model does the same thing.
normalize_labels: False
# target_mean: -0.7554450631141663
# target_std: 2.887317180633545
# grad_target_mean: 0.0
# grad_target_std: 2.887317180633545
- src: /datasets01/open_catalyst/oc20/082422/struct_to_energy_forces/val/id_30k

model:
name: scaleshift_mace
# Copied from https://github.com/ACEsuit/mace#training.
r_max: 6.0 # was originally 5.0
# Use `avg_num_neighbors` = 50 if r_max is 12.0, 35 if r_max is 6.0.
# This is because max_neighbors is set to 50. At r_max = 12, we get all nbrs.
avg_num_neighbors: 35
num_bessel: 8
num_polynomial_cutoff: 5
max_ell: 3
num_interactions: 3
num_elements: 83
hidden_irreps: 128x0e + 128x1o + 128x2e
MLP_irreps: 128x0e
# atomic_energies: ref energy per atomic number.
correlation: 3
# torch.div(energies, natoms).mean()
atomic_inter_shift: -0.0106
# torch.sqrt(torch.mean(torch.square(forces)))
atomic_inter_scale: 0.4263
# OCP flags.
regress_forces: True
otf_graph: True
use_pbc: True

optim:
batch_size: 8
eval_batch_size: 8
load_balancing: atoms
eval_every: 1000
num_workers: 2
# Default in MACE (https://github.com/ACEsuit/mace/blob/main/mace/tools/arg_parser.py#L234)
# was 1.e-2.
lr_initial: 1.e-2
optimizer: AdamW
optimizer_params: {"amsgrad": True}
scheduler: ReduceLROnPlateau
mode: min
factor: 0.8
# In the MACE code, the RLROP scheduler is run every epoch even if validation loss is stale.
# https://github.com/ACEsuit/mace/blob/5470b632d839358faed4e9c97f67fece1b558962/mace/tools/train.py#L149
# In the OCP code, we step the scheduler only when validation loss is recomputed.
# https://github.com/ACEsuit/mace-ocp/blob/main/ocpmodels/trainers/forces_trainer.py#L412
# And so we should probably keep a lower patience. Using default from OCP for now.
patience: 3
max_epochs: 40
# TODO(@abhshkdz): implement the swa scheduler, i.e. switch to high energy coefficient and low force coefficient after loss plateaus with initial coefficients.
force_coefficient: 100
energy_coefficient: 1
# default from https://github.com/ACEsuit/mace/blob/main/mace/tools/arg_parser.py#L285
ema_decay: 0.99
# default from https://github.com/ACEsuit/mace/blob/main/mace/tools/arg_parser.py#L321
clip_grad_norm: 10
loss_energy: mae
loss_force: l2mae
# default from https://github.com/ACEsuit/mace/blob/main/mace/tools/arg_parser.py#L240.
weight_decay: 1.e-10

slurm:
constraint: "volta32gb"
80 changes: 80 additions & 0 deletions configs/s2ef/2M/mace/013103_h256.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
trainer: mace_trainer

logger: wandb

task:
dataset: lmdb
primary_metric: forces_mae
train_on_free_atoms: True
eval_on_free_atoms: True

dataset:
- src: /datasets01/open_catalyst/oc20/082422/struct_to_energy_forces/train/2M
# Switch off normalize_labels since scale_shift in the MACE model does the same thing.
normalize_labels: False
# target_mean: -0.7554450631141663
# target_std: 2.887317180633545
# grad_target_mean: 0.0
# grad_target_std: 2.887317180633545
- src: /datasets01/open_catalyst/oc20/082422/struct_to_energy_forces/val/id_30k

model:
name: scaleshift_mace
# Copied from https://github.com/ACEsuit/mace#training.
r_max: 6.0 # was originally 5.0
# Use `avg_num_neighbors` = 50 if r_max is 12.0, 35 if r_max is 6.0.
# This is because max_neighbors is set to 50. At r_max = 12, we get all nbrs.
avg_num_neighbors: 35
num_bessel: 8
num_polynomial_cutoff: 5
max_ell: 3
num_interactions: 3
num_elements: 83
hidden_irreps: 256x0e + 256x1o
MLP_irreps: 256x0e
# atomic_energies: ref energy per atomic number.
correlation: 3
# torch.div(energies, natoms).mean()
atomic_inter_shift: -0.0106
# torch.sqrt(torch.mean(torch.square(forces)))
atomic_inter_scale: 0.4263
# OCP flags.
regress_forces: True
otf_graph: True
use_pbc: True

optim:
batch_size: 4
eval_batch_size: 4
load_balancing: atoms
eval_every: 1000
num_workers: 2
# Default in MACE (https://github.com/ACEsuit/mace/blob/main/mace/tools/arg_parser.py#L234)
# was 1.e-2.
lr_initial: 1.e-2
optimizer: AdamW
optimizer_params: {"amsgrad": True}
scheduler: ReduceLROnPlateau
mode: min
factor: 0.8
# In the MACE code, the RLROP scheduler is run every epoch even if validation loss is stale.
# https://github.com/ACEsuit/mace/blob/5470b632d839358faed4e9c97f67fece1b558962/mace/tools/train.py#L149
# In the OCP code, we step the scheduler only when validation loss is recomputed.
# https://github.com/ACEsuit/mace-ocp/blob/main/ocpmodels/trainers/forces_trainer.py#L412
# And so we should probably keep a lower patience. Using default from OCP for now.
patience: 3
max_epochs: 40
# TODO(@abhshkdz): implement the swa scheduler, i.e. switch to high energy coefficient and low force coefficient after loss plateaus with initial coefficients.
force_coefficient: 100
energy_coefficient: 1
# default from https://github.com/ACEsuit/mace/blob/main/mace/tools/arg_parser.py#L285
ema_decay: 0.99
# default from https://github.com/ACEsuit/mace/blob/main/mace/tools/arg_parser.py#L321
clip_grad_norm: 10
loss_energy: mae
loss_force: l2mae
# default from https://github.com/ACEsuit/mace/blob/main/mace/tools/arg_parser.py#L240.
weight_decay: 1.e-10

slurm:
constraint: "volta32gb"
Loading