Skip to main content

Equiformer v2

Project description

EquiformerV2: Improved Equivariant Transformer for Scaling to Higher-Degree Representations

Paper | OpenReview | Poster

This repository contains the official PyTorch implementation of the work "EquiformerV2: Improved Equivariant Transformer for Scaling to Higher-Degree Representations" (ICLR 2024). We provide the code for training the base model setting on the OC20 S2EF-2M and S2EF-All+MD datasets.

Additionally, EquiformerV2 has been incorporated into OCP repository and used in Open Catalyst demo.

In our subsequent work, we find that we can generalize self-supervised learning similar to BERT, which we call DeNS (Denoising Non-Equilibrium Structures), to 3D atomistic systems to improve the performance of EquiformerV2 on energy and force predictions. Please refer to the paper and the code for further details.

The next generation, EquiformerV3, is here. We further improve efficiency, expressivity, and generality and achieve state-of-the-art results on direct and gradient prediction and on tasks requiring higher-order derivatives.

photo not available

photo not available

photo not available

photo not available

photo not available

Content

  1. Environment Setup
  2. Changelog
  3. Training
  4. File Structure
  5. Checkpoints
  6. Citation
  7. Acknowledgement

Environment Setup

Environment

See here for setting up the environment.

OC20

The OC20 S2EF dataset can be downloaded by following instructions in their GitHub repository.

For example, we can download the OC20 S2EF-2M dataset by running:

    cd ocp
    python scripts/download_data.py --task s2ef --split "2M" --num-workers 8 --ref-energy

We also need to download the "val_id" data split to run training.

After downloading, place the datasets under datasets/oc20/ by using ln -s:

    cd datasets
    mkdir oc20
    cd oc20
    ln -s ~/ocp/data/s2ef s2ef

To train on different splits like All and All+MD, we can follow the same link above to download the datasets.

Changelog

Please refer to here.

Training

OC20

  1. We train EquiformerV2 on the OC20 S2EF-2M dataset by running:

        sh scripts/train/oc20/s2ef/equiformer_v2/equiformer_v2_N@12_L@6_M@2_splits@2M_g@multi-nodes.sh
    

    The above script uses 2 nodes with 8 GPUs on each node.

    If there is an import error, it is possible that ocp/ocpmodels/common/utils.py is not modified. Please follow here for details.

    We can also run training on 8 GPUs on 1 node:

        sh scripts/train/oc20/s2ef/equiformer_v2/equiformer_v2_N@12_L@6_M@2_splits@2M_g@8.sh
    
  2. We train EquiformerV2 (153M) on OC20 S2EF-All+MD by running:

        sh scripts/train/oc20/s2ef/equiformer_v2/equiformer_v2_N@20_L@6_M@3_splits@all+md_g@multi-nodes.sh
    

    The above script uses 16 nodes with 8 GPUs on each node.

  3. We train EquiformerV2 (31M) on OC20 S2EF-All+MD by running:

        sh scripts/train/oc20/s2ef/equiformer_v2/equiformer_v2_N@8_L@4_M@2_splits@all+md_g@multi-nodes.sh
    

    The above script uses 8 nodes with 8 GPUs on each node.

  4. We can train EquiformerV2 with DeNS (Denoising Non-Equilibrium Structures) as an auxiliary task to further improve the performance on energy and force predictions. Please refer to the code for details.

File Structure

  1. nets includes code of different network architectures for OC20.
  2. scripts includes scripts for training models on OC20.
  3. main_oc20.py is the code for training, evaluating and running relaxation.
  4. oc20/trainer contains code for the force trainer as well as some utility functions.
  5. oc20/configs contains config files for S2EF.

Checkpoints

We provide the checkpoints of EquiformerV2 trained on S2EF-2M dataset for 30 epochs, EquiformerV2 (31M) trained on S2EF-All+MD, and EquiformerV2 (153M) trained on S2EF-All+MD.

Model Split Download val force MAE (meV / Å) val energy MAE (meV)
EquiformerV2 2M checkpoint | config 19.4 278
EquiformerV2 (31M) All+MD checkpoint | config 16.3 232
EquiformerV2 (153M) All+MD checkpoint | config 15.0 227

Citation

Please consider citing the works below if this repository is helpful:

  • EquiformerV2:

    @inproceedings{
        equiformer_v2,
        title={{EquiformerV2: Improved Equivariant Transformer for Scaling to Higher-Degree Representations}}, 
        author={Yi-Lun Liao and Brandon Wood and Abhishek Das* and Tess Smidt*},
        booktitle={International Conference on Learning Representations (ICLR)},
        year={2024},
        url={https://openreview.net/forum?id=mCOBKZmrzD}
    }
    
  • eSCN:

    @inproceedings{
        escn,
        title={{Reducing SO(3) Convolutions to SO(2) for Efficient Equivariant GNNs}},
        author={Passaro, Saro and Zitnick, C Lawrence},
        booktitle={International Conference on Machine Learning (ICML)},
        year={2023}
    }
    
  • Equiformer:

    @inproceedings{
        equiformer,
        title={{Equiformer: Equivariant Graph Attention Transformer for 3D Atomistic Graphs}},
        author={Yi-Lun Liao and Tess Smidt},
        booktitle={International Conference on Learning Representations (ICLR)},
        year={2023},
        url={https://openreview.net/forum?id=KwmPfARgOTD}
    }
    
  • OC20 dataset:

    @article{
        oc20,
        author = {Chanussot*, Lowik and Das*, Abhishek and Goyal*, Siddharth and Lavril*, Thibaut and Shuaibi*, Muhammed and Riviere, Morgane and Tran, Kevin and Heras-Domingo, Javier and Ho, Caleb and Hu, Weihua and Palizhati, Aini and Sriram, Anuroop and Wood, Brandon and Yoon, Junwoong and Parikh, Devi and Zitnick, C. Lawrence and Ulissi, Zachary},
        title = {{Open Catalyst 2020 (OC20) Dataset and Community Challenges}},
        journal = {ACS Catalysis},
        year = {2021},
        doi = {10.1021/acscatal.0c04525},
    }
    

Please direct questions to Yi-Lun Liao (ylliao@mit.edu).

Acknowledgement

Our implementation is based on PyTorch, PyG, e3nn, timm, ocp, Equiformer.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

equiformer_v2-0.0.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

equiformer_v2-0.0.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file equiformer_v2-0.0.1.tar.gz.

File metadata

  • Download URL: equiformer_v2-0.0.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for equiformer_v2-0.0.1.tar.gz
Algorithm Hash digest
SHA256 584f82d27c493e0d68bd0f58c7a4f2f2f8b91072b788fd637d1bf9b06352c4b7
MD5 a9633b49397af7ba2e90d462130ae1a1
BLAKE2b-256 ecc1d67628743fa0ac12441b58333ce2cf532dba5ce531bdddf0f346c3e7cb21

See more details on using hashes here.

File details

Details for the file equiformer_v2-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: equiformer_v2-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for equiformer_v2-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1aefebd12849b39d5d31517cf70ffdd0accdf7a84c3878ee24c97ad40793e4ac
MD5 dde42587e3cfc3afe62787fe0044ae5f
BLAKE2b-256 a3953168820b463ede9c28881a568c8564f48f3892231c0a6a59d95714210f15

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page