SevenNet (Scalable EquiVariance Enabled Neural Network)

repository·main·Indexed 42 days ago

https://github.com/mdil-snu/sevennet

A GNN-based interatomic potential package for scalable molecular dynamics simulations. It features integration with LAMMPS for GPU-parallelized MD, an ASE calculator, and pretrained universal potentials. SevenNet supports multi-fidelity training, fine-tuning with forgetting prevention, and CUDA-accelerated D3 dispersion correction. Version 0.13.0 includes models like SevenNet-0 and SevenNet-MF-0.

Tokens
30.5K
Snippets
109
Records
141
Agent score
49%

What's inside SevenNet

  1. Overview of SevenNet features

    main

    SevenNet (Scalable EquiVariance-Enabled Neural Network) is a graph neural network (GNN)-based interatomic potential package. It is designed for parallel molecular dynamics simulations and supports integration with LAMMPS.

    Key capabilities include:

    • Pretrained Models: Access to pretrained GNN interatomic potentials and a fine-tuning interface.
    • ASE Integration: Support for the Python Atomic Simulation Environment (ASE) calculator.
    • LAMMPS Support: GPU-parallelized molecular dynamics via LAMMPS integration.
    • Dispersion Correction: CUDA-accelerated D3 (van der Waals) dispersion (compatible with LAMMPS pair style d3).
    • Advanced Training: Multi-fidelity training for combining databases and fine-tuning with forgetting prevention (using Experience Replay and Elastic Weight Consolidation) for continual learning.
  2. Overview of SevenNet-MF-0 (Multi-Fidelity) Model

    main

    SevenNet-MF-0 is a pretrained model trained on both PBE (+U) and $\mathrm{r}^{2}$ SCAN crystal relaxation trajectories from the Materials Project.

    It uses a multi-fidelity training approach with additional 'fidelity-dependent' parameters. These parameters have negligible computational overhead, meaning inference speed is nearly identical to the standard SevenNet-0 model.

    Performance (MAE on $\mathrm{r}^{2}$ SCAN):

    • Energy: 10.8 meV/atom
    • Force: 0.018 eV/Ang.
    • Stress: 0.58 kbar
  3. Overview of SevenNet pretrained models

    main

    SevenNet provides several pretrained models with varying hyperparameters and training sets, offering different trade-offs between accuracy and speed. These models can be used as interatomic potentials in LAMMPS or loaded via the ASE calculator.

    Key model families include:

    • SevenNet-Omni: The recommended multi-task model for diverse materials (crystals, molecules, surfaces, etc.).
    • SevenNet-Omni-i8 / i12: Higher capacity versions of SevenNet-Omni.
    • SevenNet-Nano: A lightweight, distilled version of the mpa task for high-speed simulations.
    • SevenNet-MF-ompa: A multi-fidelity model trained on MPtrj, sAlex, and OMat24 datasets.
    • SevenNet-omat: A single-task model trained exclusively on OMat24.
    • SevenNet-l3i5 / SevenNet-0: Models varying by spherical harmonic degree ($l_{\mathrm{max}}$).
  4. Overview of SevenNet

    main

    SevenNet (Scalable EquiVariance-Enabled Neural Network) is a graph neural network (GNN)-based interatomic potential package. It is designed for scalable atomistic simulations and supports parallel molecular dynamics using LAMMPS. The core model architecture is based on NequIP.

    Key capabilities include:

    • Pretrained Models: Access to universal interatomic potentials.
    • ASE Integration: A Python-based Atomic Simulation Environment (ASE) calculator.
    • High-Performance MD: GPU-parallelized molecular dynamics with LAMMPS and CUDA-accelerated D3 (van der Waals) dispersion.
    • Advanced Training: Multi-fidelity training for combining diverse databases and fine-tuning with forgetting prevention (using experience replay and Elastic Weight Consolidation) for continual learning.
    • Accelerators: Support for tensor product accelerators to improve performance.
  5. Use SevenNet-0 (11July2024) pretrained potential

    main

    SevenNet-0 (11July2024) is an interatomic potential pre-trained on the MPTrj(CHGNet) dataset. It can be applied directly to any system without additional training. If the accuracy is insufficient for your specific use case, the model can be fine-tuned using a custom dataset.

    Key Files in this release:

    • checkpoint_sevennet_0.pth: The pre-trained model checkpoint.
    • fine_tune.yaml: An example configuration file for fine-tuning the model.
    • pre_train.yaml: An example configuration file used during the original pre-training process.

    Performance (MAE):

    MetricEnergy (eV/atom)Force (eV/Å)Stress (GPa)
    Train0.0110.0400.28
  6. D3 pair style parameters and limitations

    main

    When using the CUDA-accelerated D3 pair style, be aware of the following technical constraints and behaviors:

    Limitations

    • Atom Limit: The maximum number of atoms supported is 46,340 due to overflow issues.
    • Parallelism: Only supports single-GPU execution; multi-GPU parallelism is not yet implemented.
    • Boundary Conditions: Supports periodic (PBC) and non-periodic (noPBC) conditions, but does not support selective PBC.
    • Terms: 3-body and n > 8 terms are not implemented.
    • Performance: May be slower than CPU implementations for systems with a small number of atoms.

    Numerical Precision

    • The implementation uses FP32 (single precision) operations for acceleration, which may introduce minor numerical errors, particularly in pressure calculations.
    • If numerical errors are excessive, ensure the fmad=false option was correctly applied during the build process via patch_lammps.sh.
  7. Use reEWC for forgetting-prevented fine-tuning

    main

    reEWC (rehearsal-enhanced Elastic Weight Consolidation) mitigates catastrophic forgetting when fine-tuning a pretrained model on a new target system. It uses two mechanisms:

    1. Experience replay (rehearsal): Replays an old-task "memory" set during each training step.
    2. Elastic Weight Consolidation (EWC): Adds a penalty to anchor parameters to their pre-fine-tuning values (theta*), weighted by a precomputed Fisher matrix (F).

    Note: reEWC is only supported for single-modal models (e.g., SevenNet-0, SevenNet-Nano). Multi-fidelity models are not currently supported.

  8. Compare CuEquivariance and FlashTP performance

    main

    When choosing an accelerator, consider the system size and the LAMMPS interface:

    1. System Size:

      • Small systems: FlashTP with LAMMPS: Torch generally shows a performance advantage.
      • Large systems (> 10³ atoms): CuEquivariance becomes more efficient as a performance crossover occurs around 1,000 atoms.
    2. LAMMPS Interface:

  9. Set up reEWC using the preset command

    main

    You can generate a ready-to-edit configuration file containing both rehearsal and EWC mechanisms using the sevenn preset command.

    To create an input file, run:

    sevenn preset reewc > input.yaml

    Every reEWC key is optional. You can run only one mechanism by removing the other's configuration block:

    • To run only rehearsal: Remove the train.continue.ewc keys.
    • To run only EWC: Remove the data: replay block.

    Once configured, run training as usual:

    sevenn train input.yaml -s
    sevenn preset reewc > input.yaml
    sevenn train input.yaml -s
  10. Use the SevenNet-0 pretrained model

    main

    The SevenNet-0 model is an early pretrained model trained on the MPtrj dataset. While newer models are generally more accurate, SevenNet-0 is optimized for the shortest inference time. It is loaded as the default pretrained model when using the ASE (Atomic Simulation Environment) calculator.

    To specify this model, use the following keywords:

    • 7net-0
    • SevenNet-0
    • 7net-0_11Jul2024
    • SevenNet-0_11Jul2024
    Model keywords: `7net-0` | `SevenNet-0` | `7net-0_11Jul2024` | `SevenNet-0_11Jul2024`