Add NequIP & Allegro to matbench leaderboard - #282
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
|
@janosh I think this is nearly ready to go. The remaining issues that seem to be causing the Then also for the geo-opt analysis script: The discovery analysis script works fine though. |
|
Trying to use the compile-WBM script, I get: (with |
auto-format nequip + allegro hyperparam YAMLs
|
very nice work! 👍 thanks a lot for this submission @kavanase! 🙏 i'm very excited to add NequiP and Allegro to the benchmark! thanks for reporting the re the failing |
|
also, apologies about all the |
|
this script seems to mostly bring the kappa pred files into the expected format (except there's still an extra nesting level that doesn't play well with standardize_kappa_preds.py"""Convert kappa predictions to Matbench format."""
import json
import os
import shutil
import pandas as pd
from pymatviz.enums import Key
from matbench_discovery import today
from matbench_discovery.enums import MbdKey, Model
DRY_RUN = False
col_map = {
"mp_id": Key.mat_id,
"name": Key.formula,
"max_stress": Key.max_stress,
"reached_max_steps": "reached_max_steps",
"imaginary_freqs": Key.has_imag_ph_modes,
"frequencies": Key.ph_freqs,
"kappa_TOT_RTA": MbdKey.kappa_tot_rta,
"kappa_P_RTA": MbdKey.kappa_p_rta,
"kappa_C": MbdKey.kappa_c,
"weights": Key.mode_weights,
"qpoints": Key.q_points,
"mode_kappa_TOT": MbdKey.mode_kappa_tot_rta,
"kappa_TOT_ave": MbdKey.kappa_tot_avg,
"initial_space_group_number": Key.spg_num,
"mode_kappa_TOT_ave": MbdKey.mode_kappa_tot_avg,
}
cols_to_drop = [
"DFT_kappa_TOT_ave",
"SRD",
"SRE",
"SRME",
"errors",
"error_traceback",
"symprec_tests",
"redirected_to_symm",
]
models_updated: dict[str, dict[str, str | list[str]]] = {}
for model in Model:
if model.kappa_103_path is None or not os.path.isfile(model.kappa_103_path):
print(f"{model.label=} kappa_103_path={model.kappa_103_path!r} does not exist")
continue
df_ml = pd.read_json(model.kappa_103_path)
if MbdKey.mode_kappa_tot_avg in df_ml:
print(f"{model.label=} already processed")
continue # skip if already processed
old_cols = df_ml.columns.copy()
df_ml = df_ml.rename(columns=col_map)
renamed_cols = {
str(old_col): str(new_col)
for old_col, new_col in zip(old_cols, df_ml)
if old_col != new_col
}
old_cols = df_ml.columns.copy()
df_ml = df_ml.drop(columns=cols_to_drop, errors="ignore")
dropped_cols = [col for col in old_cols if col not in df_ml]
# if dataframe was modified, backup the original file
if renamed_cols or dropped_cols:
models_updated[model.key] = {
"renamed_cols": renamed_cols,
"dropped_cols": dropped_cols,
}
if not DRY_RUN:
shutil.copy(model.kappa_103_path, f"{model.kappa_103_path}.bak")
df_ml.to_json(model.kappa_103_path)
print(f"{model.label=} new column names: {df_ml.columns}")
else:
print(f"{model.label=} no changes")
print(f"\n\n{len(models_updated)=}")
for model_key, actions in models_updated.items():
print(f"{model_key=} {actions=}")
# write updated models to file
with open(f"{today}-kappa-model-files-updated.json", mode="w") as file:
json.dump(models_updated, file, indent=2) |
|
Thanks for this @janosh! 🙏 |
…+phonon pred files + geo opt analysis files to MBD figshare - Introduced a `--timeout` argument in the CLI for HTTP request timeouts, defaulting to 30 seconds. - Added a `set_timeout` function in `figshare.py` to manage the timeout configuration for API calls. - Updated the `make_request` function to utilize the configured timeout. - Adjusted the upload process to reflect the new timeout settings. - Modified model YAML files to include new metrics and updated URLs for predictions. - Added nested progress bar to show individual file upload states
|
Excited to see this merged soon! |
…ing removal of legacy geo_opt figshare article https://figshare.com/articles/dataset/28187999 was superseded by https://figshare.com/articles/dataset/28642406
This comment was marked as outdated.
This comment was marked as outdated.
…rs for Allegro and NequIP
/home/runner/work/_actions/lycheeverse/lychee-action/v2/entrypoint.sh: eval: line 58: syntax error near unexpected token `('
--exclude https://figshare.com/articles/(dataset|files) \
Fixed now! I missed this entry for the Allegro models on the first draft 🤦 |
|
@janosh thanks very much for pushing through with this!
|
There was a problem hiding this comment.
thanks again for this submission @kavanase! outstanding work 👍 🚀
been hoping for the day when Allegro and Nequip are added to the leaderboard for almost 2 years now! so many people kept asking me why those we're missing and all I could say is lack of time...
very glad that's now over 🙏
but looking at the outputs it's showing download errors for the updated NequIP/Allegro figshare files?
i think i just forgot to re-publish the Figshare article after uploading these files. should be good now
build of local:ty,ase,pymatgen,pymatviz@1 for python@python3.12 exceeds tier max size 250MiB: 697.5MiB
standardize YAML notes title casing
|
Great to see this merged, thanks very much @janosh !! |
* Initial commit of NequIP/Allegro models * Add NequIP MP model * Add Allegro models * Clean up * Add config files * Add MIR logo * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Rename test script files * Add lean READMEs * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Formatting * Remove ipy delimiters * Update yamls for pre-commit * Update configs to new format * geo-opt metrics for nequip & allegro MPtrj and Omat models * bump pymatviz from 0.16.0 to 0.17.1 to fix #282 (comment) auto-format nequip + allegro hyperparam YAMLs * add --timeout arg to figshare CLI and upload nequip+allegro discovery+phonon pred files + geo opt analysis files to MBD figshare - Introduced a `--timeout` argument in the CLI for HTTP request timeouts, defaulting to 30 seconds. - Added a `set_timeout` function in `figshare.py` to manage the timeout configuration for API calls. - Updated the `make_request` function to utilize the configured timeout. - Adjusted the upload process to reflect the new timeout settings. - Modified model YAML files to include new metrics and updated URLs for predictions. - Added nested progress bar to show individual file upload states * add/update figshare download ULRs for allegro + nequip geo opt pred + analysis files * fix tests * update legacy metrics.geo_opt.pred_file_url in all model YAMLs following removal of legacy geo_opt figshare article https://figshare.com/articles/dataset/28187999 was superseded by https://figshare.com/articles/dataset/28642406 * fix copy-paste error: Nequip -> Allegro * add e_form and e_hull parity plots and per-element hull distance errors for Allegro and NequIP * fill placeholder model checkpoint license URLs with https://creativecommons.org/licenses/by/4.0/legalcode * fix link check /home/runner/work/_actions/lycheeverse/lychee-action/v2/entrypoint.sh: eval: line 58: syntax error near unexpected token `(' --exclude https://figshare.com/articles/(dataset|files) \ * update date_added to today * Update checkpoint URL in allegro-MP-L-0.1.yml * Update checkpoint URL in allegro-OAM-L-0.1.yml * fix ASE optim_cls and filter_cls type hints across model test scripts * try ty with just just ase + pymatgen build of local:ty,ase,pymatgen,pymatviz@1 for python@python3.12 exceeds tier max size 250MiB: 697.5MiB * just ase as ty additional dep standardize YAML notes title casing * fix dead links --------- Co-authored-by: Janosh Riebesell <janosh.riebesell@gmail.com>

Description
This PR adds initial foundation potentials from the
NequIPGNN andAllegroarchitectures, including both compliant and non-compliant (OMat) models.Checklist
Please check the following items before submitting your PR:
models/<arch_name>/<model_variant>.ymlfor my submission.arch_nameis the name of the architecture andmodel_variant.ymlincludes things like author details, training set names and important hyperparameters.Model.<arch_name>enum on theModelenum inenums.py.<yyyy-mm-dd>-<model_variant>-preds.csv.gz).<yyyy-mm-dd>-wbm-IS2RE-FIRE.jsonl.gz). JSON Lines allows fast loading of small numbers of structures withpandas.read_json(lines=True, nrows=100)for inspection.<yyyy-mm-dd>-kappa-103-FIRE-<values-of-dist|fmax|symprec>.gz).models/<arch_name>/<model_variant>.yml). If not using Figshare I have included the urls to the cloud storage service in the description of the PR.test_<arch_name>_<task>.pyfortaskindiscovery,kappa,diatomics) that generated the prediction files.Additional Information (Optional)
train_<arch_name>.py) if I trained a model specifically for this benchmark.readme.mdwith additional details about my model.@coderabbitai ignore