SevenNet, Mace, CHGNetへの対応 (rework of #76)#80
Draft
k-yoshimi wants to merge 8 commits into
Draft
Conversation
- params.py: fix typo self.dvice -> self.device (device was never set on the default DFTParams path) - main_dft_latgas.py: restrict the pretrained base_input_dir creation to the MLIP solvers (sevennet/mace/chgnet) so existing solvers are not affected; use makedirs(exist_ok=True) - sevennet/mace/chgnet solvers: drop unused imports (numpy, torch, tomli and the nequip imports that pulled nequip in as a hard dependency) - chgnet.py: correct copy-pasted module docstring - *_trainer.py: replace broken 'e.args += str' handling (TypeError) in new_baseinput with a proper RuntimeError - __init__.py: add trailing newline Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a lightweight integration test that runs abics_sampling with the pretrained CHGNet solver (use_pretrained=true, relax=false) over a small MgAl2O4 cell for a few RXMC steps, and checks that sampling produces finite, physically plausible energies. CHGNet ships its weights, so the test needs no network at runtime. Wired into the CI matrix as the SamplingCHGNet testname with install_chgnet.sh. chgnet requires Python >=3.10, so it runs only on Python 3.13 (chgnet supports numpy 2, unlike the pinned nequip). Verified locally (Python 3.13, chgnet 0.4.2 / torch 2.12.1): the 2-replica sampling run completes and check.py passes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Mirror the CHGNet smoke test for the MACE solver: run abics_sampling with the pretrained MACE-MP foundation model (use_pretrained=true, relax=false) over a small MgAl2O4 cell and check the energies are finite and physically plausible. The MACE-MP model is downloaded on first use (no model file committed). Wired into the CI matrix as SamplingMace with install_mace.sh, on Python 3.13. Verified locally (mace-torch 0.3.16): the sampling run completes, check.py passes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Mirror the CHGNet/MACE smoke tests for the SevenNet solver: run abics_sampling with the pretrained 7net-0 potential (use_pretrained=true, relax=false) over a small MgAl2O4 cell and check the energies are finite and physically plausible. The 7net-0 potential ships with the sevenn package. Wired into the CI matrix as SamplingSevenNet with install_sevennet.sh, on Python 3.13. Verified locally (sevenn 0.13.0): the sampling run completes, check.py passes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The SamplingMace job hung until the 6-hour CI limit: mace_mp downloads the foundation model on first use, and when that download failed in one of the two MPI ranks, that rank crashed while the other deadlocked on the replica-exchange MPI Recv. Download the model once in a single process before mpiexec so the ranks load it from cache with no network access (and a download failure now fails fast instead of hanging). Verified locally with the mace-pinned e3nn==0.4.4: pre-cache succeeds and the 2-replica sampling run completes, check.py passes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds MLIP solver/trainer support for SevenNet, Mace, and CHGNet.
It is a rework of the previous PR #76 (
ykonishi:develop). That PR was once merged intodevelop, but since it landed without any CI coverage it has been backed out ofdevelop. This PR reintroduces the same work with review fixes applied, so it can be merged again once tests are in place.Contents
sevennet.py,mace.py,chgnet.pysevennet_trainer.py,mace_trainer.py,chgnet_trainer.py__init__.py, and support inparams.py/train.py/main_dft_latgas.pytutorial/other_models.rst,how_to_use/index.rst)Review fixes applied on top of PR #76
params.py: fix theself.dvicetypo (self.device);devicewas never set on the defaultDFTParamspathmain_dft_latgas.py: restrict the pretrainedbase_input_dircreation to the sevennet/mace/chgnet solvers so existing solvers are unaffected; usemakedirs(exist_ok=True)nequipimports that pulled nequip in as a hard dependency)e.args += strexception handling in each trainer'snew_baseinputwith a properRuntimeErrorchgnet.py; add a trailing newline to__init__.pyTODO before merge
Test_abICS.ymlmatrix)xsf_to_asefeeds dummy forces generated byMorsePotentialinto training (need to confirm the force-loss weight is 0)relax, the energy is from the relaxed structure while the returned structure is the un-relaxed one (inconsistency)Kept as Draft until the test coverage is ready, so it is not merged prematurely.
Co-authored-by: Yusuke Konishi konishi@academeia.co.jp
🤖 Generated with Claude Code