Equiformer V3

Model Introduction

Equiformer V3 is an SE(3)-equivariant graph attention potential model for three-dimensional atomic systems. It predicts the energy, atomic forces, and stress of atomic structures.

Model Description

Equiformer V3 is based on an equivariant graph neural network architecture. Building on Equiformer V2, it improves equivariant normalization, smooth cutoff attention, and SwiGLU-S² activation for materials potential energy surface modeling. This release includes OneScience-adapted model code, pretrained weights, single-point inference, and an OC20 training example.

Use Cases

Use case Description
Single-point energy, forces, and stress Predict energy, forces, and stress for ASE-readable structures
Structure relaxation and formation energy Use the model and elemental reference energies for structure optimization and formation-energy calculations
Elastic tensor Calculate the elastic properties of periodic materials
Phonons Calculate the phonon properties of periodic materials
OC20 S2EF training Train on energy and force labels using preprocessed data from OneScience-Group/oc20
Custom data migration Convert custom data to the ASE-LMDB format required by the configuration, then update the training paths

Usage

1. Using OneCode

Try intelligent, one-click AI4S programming in the OneCode online environment:

Try intelligent, one-click AI4S programming

2. Manual Installation and Usage

Hardware requirements

  • An NVIDIA GPU or Hygon DCU is recommended for inference and training.
  • A CPU can be used to inspect configurations and prepare data but is not recommended for production training.
  • DCU users must load a DTK environment compatible with the current PyTorch build.

Download the Model Package

hf download --model OneScience-Group/Equiformer_v3 --local-dir ./Equiformer_v3
cd Equiformer_v3

Install the Runtime Environment

DCU environment

# Activate DTK and Conda first
conda create -n onescience311 python=3.11 -y
conda activate onescience311
pip install onescience[matchem-dcu] \
  -i http://mirrors.onescience.ai:3141/pypi/simple/ \
  --trusted-host mirrors.onescience.ai

GPU environment

# Activate Conda first
conda create -n onescience311 python=3.11 -y
conda activate onescience311
pip install onescience[matchem-gpu] \
  -i http://mirrors.onescience.ai:3141/pypi/simple/ \
  --trusted-host mirrors.onescience.ai

Training Dataset

Training data is not bundled with this model repository. The OC20 training data is available from the Hugging Face dataset OneScience-Group/oc20 and corresponds to the Open Catalyst 2020 (OC20) S2EF task. See the OC20 dataset paper and the FAIR Chemistry OC20 documentation for the original data, task definitions, and citation information. When using the data, follow the licenses and terms on the OneScience dataset page, from the Open Catalyst Project, and for the original data.

hf download --dataset OneScience-Group/oc20 --local-dir ./data

Convert the downloaded data to the ASE-LMDB format expected by the training configuration. The current configuration reads:

data/oc20_finetune/
├── train/                 # ASE-LMDB training data
└── val/                   # ASE-LMDB validation data

If the downloaded OC20 data consists of .extxyz files or other ASE-readable source files, convert it with the bundled UMA data-processing script:

python scripts/create_uma_finetune_dataset.py \
  --train-dir ./data/oc20/s2ef_200k_uncompressed \
  --val-dir ./data/oc20/s2ef_val_id_uncompressed \
  --uma-task oc20 \
  --regression-tasks ef \
  --output-dir ./data/oc20_finetune \
  --num-workers 8

The script generates train/ and val/ ASE-LMDB shards together with a UMA data configuration file. Input files must contain energy and force labels provided through an ASE calculator. Files that fail conversion are recorded in a .failed log corresponding to each output shard. create_finetune_dataset.py is the low-level ASE data conversion implementation, while create_uma_finetune_dataset.py is the complete OC20/UMA data-processing entry point. Both scripts come from the UMA repository and are provided in their original form.

Under the OneScience MatChem data root, the corresponding paths are:

${ONESCIENCE_DATASETS_DIR}/matchem/oc20/uma_oc20_finetune/
├── train/
└── val/

If the data is stored elsewhere, update the train and val fields in demo/configs/oc20_scratch_8dcu.yaml and demo/configs/oc20_scratch_8dcu_smoke.yaml, or set ONESCIENCE_DATASETS_DIR. The Equiformer V3 training YAML must continue to use its own train, val, and transforms.element_references.energy.file fields; the UMA fine-tuning YAML generated by the UMA script does not directly replace the Equiformer V3 training configuration. After changing the training data, refit the elemental reference-energy coefficients:

python fit_element_references.py \
  --config demo/configs/oc20_scratch_8dcu.yaml \
  --output demo/reference_data/oc20_subset_energy_element_references.npz

Model Weights

This repository includes the following Equiformer V3 weights:

weight/
├── Jd.pt
├── mptrj_gradient.pt
├── omat24_direct.pt
├── omat24_gradient.pt
└── omat24-mptrj-salex_gradient.pt
Weight Training task or domain Intended use
mptrj_gradient.pt MPtrj gradient Inference or evaluation on MPtrj material structures
omat24_direct.pt OMat24 direct + DeNS Inference or evaluation with the OMat24 direct model
omat24_gradient.pt OMat24 gradient Inference or evaluation with the OMat24 gradient model
omat24-mptrj-salex_gradient.pt OMat24 + MPtrj + sAlex gradient General materials-structure inference; used by the inference scripts by default

Jd.pt contains the Wigner rotation basis and is loaded automatically from weight/Jd.pt by the entry-point scripts.

Fine-Tuning

Run the OC20 smoke-test configuration:

export ONESCIENCE_DATASETS_DIR=/path/to/onescience_datasets
bash demo/run.sh --config configs/oc20_scratch_8dcu_smoke.yaml

The smoke-test configuration uses eight training samples, eight validation samples, and a reduced one-layer model. It performs a single update to verify the data pipeline, distributed communication, forward and backward passes, optimizer, and checkpoint-saving workflow.

Run the full OC20 configuration:

bash demo/run.sh --config configs/oc20_scratch_8dcu.yaml

This configuration uses one node, eight DCUs, and 12 epochs. FP32 is the currently validated stable path. Controlled experiments with the same full model in FP16/BF16 encountered a DCU kernel VMFault, so the release configuration uses amp: false.

Inference

Single-point energy, forces, and stress:

python single_point.py --device cuda --output outputs/single_point.json

Formation energy:

python formation_energy.py --device cuda --output outputs/formation_energy.json

Elastic tensor:

python elastic.py --relax --device cuda --output outputs/elastic.json

Phonons:

python phonons.py \
  --supercell 3 3 3 \
  --bandpath GXWKGL \
  --device cuda \
  --output-dir outputs/phonons

Custom structures or weights:

python single_point.py --input structure.cif
python elastic.py --input POSCAR --output outputs/elastic.json
python phonons.py --input structure.cif --supercell 2 2 2
python single_point.py --checkpoint weight/omat24_gradient.pt

--input supports CIF, POSCAR, XYZ, trajectory, and other formats readable by ASE. All four inference scripts use weight/omat24-mptrj-salex_gradient.pt by default.

Official OneScience Resources


Citation and License

  • The Equiformer V3 architecture code is based on upstream software released under the MIT License. See LICENSE in the repository root.
  • The OC20 dataset is licensed under CC BY 4.0 as described on its official page. The repository's MIT License does not cover the dataset license.
  • If you use Equiformer V3 or OC20 in research, cite the Equiformer V3 paper, the OC20 dataset paper, and the source of the dataset actually used.
@article{equiformer_v3,
  title={EquiformerV3: Scaling Efficient, Expressive, and General SE(3)-Equivariant Graph Attention Transformers},
  author={Yi-Lun Liao and Alexander J. Hoffman and Sabrina C. Shen and Alexandre Duval and Sam Walton Norwood and Tess Smidt},
  journal={arXiv preprint arXiv:2604.09130},
  year={2026}
}

@article{oc20,
  title={Open Catalyst 2020 (OC20) Dataset and Community Challenges},
  author={Lowik Chanussot and Abhishek Das and Siddharth Goyal and others},
  journal={ACS Catalysis},
  year={2021},
  doi={10.1021/acscatal.0c04525}
}

中文说明

模型简介

Equiformer V3 是面向三维原子体系的 SE(3) 等变图注意力势模型,用于预测原子结构的能量、原子力和应力。

模型描述

Equiformer V3 基于等变图神经网络架构。在 Equiformer V2 的基础上,它改进了等变归一化、平滑截断注意力和 SwiGLU-S² 激活,用于材料势能面建模。此版本包含经 OneScience 适配的模型代码、预训练权重、单点推理(inference)和 OC20 训练示例。

使用场景

使用场景 说明
单点能量、力与应力 预测 ASE 可读取结构的能量、力和应力
结构弛豫与形成能 使用模型和元素参考能进行结构优化和形成能计算
弹性张量 计算周期性材料的弹性性质
声子 计算周期性材料的声子性质
OC20 S2EF 训练 使用来自 OneScience-Group/oc20 的预处理数据,基于能量与力的标签进行训练
自定义数据迁移 将自定义数据转换成配置所需的 ASE-LMDB 格式,然后更新训练路径

使用方法

1. 使用 OneCode

在 OneCode 在线环境中体验智能一键 AI4S 编程。

体验智能一键 AI4S 编程

2. 手动安装与使用

硬件要求

  • 推理与训练建议使用 NVIDIA GPU 或 Hygon DCU。
  • 可使用 CPU 检查配置和准备数据,正式训练不建议使用 CPU。
  • DCU 用户必须加载与当前 PyTorch 构建版本兼容的 DTK 环境。

下载模型包

hf download --model OneScience-Group/Equiformer_v3 --local-dir ./Equiformer_v3
cd Equiformer_v3

安装运行环境

DCU 环境

# Activate DTK and Conda first
conda create -n onescience311 python=3.11 -y
conda activate onescience311
pip install onescience[matchem-dcu] \
  -i http://mirrors.onescience.ai:3141/pypi/simple/ \
  --trusted-host mirrors.onescience.ai

GPU 环境

# Activate Conda first
conda create -n onescience311 python=3.11 -y
conda activate onescience311
pip install onescience[matchem-gpu] \
  -i http://mirrors.onescience.ai:3141/pypi/simple/ \
  --trusted-host mirrors.onescience.ai

训练数据集

本模型仓库未附带训练数据。OC20 训练数据可从 Hugging Face 数据集 OneScience-Group/oc20 获取,对应 Open Catalyst 2020(OC20)的 S2EF 任务。原始数据、任务定义及引用信息见 OC20 数据集论文和 FAIR Chemistry OC20 文档。使用数据时,请遵守 OneScience 数据集页面、Open Catalyst Project 以及原始数据的许可证与条款。

hf download --dataset OneScience-Group/oc20 --local-dir ./data

将下载的数据转换为训练配置所需的 ASE-LMDB 格式。当前配置读取以下数据。

data/oc20_finetune/
├── train/                 # ASE-LMDB training data
└── val/                   # ASE-LMDB validation data

如果下载的 OC20 数据包含 .extxyz 文件或其他 ASE 可读取的源文件,请使用随附的 UMA 数据处理脚本转换。

python scripts/create_uma_finetune_dataset.py \
  --train-dir ./data/oc20/s2ef_200k_uncompressed \
  --val-dir ./data/oc20/s2ef_val_id_uncompressed \
  --uma-task oc20 \
  --regression-tasks ef \
  --output-dir ./data/oc20_finetune \
  --num-workers 8

该脚本生成 train/ 和 val/ ASE-LMDB 分片,以及一个 UMA 数据配置文件。输入文件必须包含由 ASE 计算器提供的能量和力标签。转换失败的文件记录在各输出分片对应的 .failed 日志中。create_finetune_dataset.py 是底层 ASE 数据转换实现,create_uma_finetune_dataset.py 是完整的 OC20/UMA 数据处理入口。两份脚本均来自 UMA 仓库,以原始形式提供。

在 OneScience MatChem 数据根目录下,对应路径如下。

${ONESCIENCE_DATASETS_DIR}/matchem/oc20/uma_oc20_finetune/
├── train/
└── val/

如果数据存放于其他位置,请更新 train 和 val 字段(位于 demo/configs/oc20_scratch_8dcu.yaml 与 demo/configs/oc20_scratch_8dcu_smoke.yaml),或设置 ONESCIENCE_DATASETS_DIR。Equiformer V3 训练 YAML 必须继续使用自身的 train、val 和 transforms.element_references.energy.file 字段,UMA 脚本生成的 UMA 微调(fine-tuning) YAML 无法直接替代 Equiformer V3 训练配置。更换训练数据后,请重新拟合元素参考能系数。

python fit_element_references.py \
  --config demo/configs/oc20_scratch_8dcu.yaml \
  --output demo/reference_data/oc20_subset_energy_element_references.npz

模型权重

本仓库包含以下 Equiformer V3 权重。

weight/
├── Jd.pt
├── mptrj_gradient.pt
├── omat24_direct.pt
├── omat24_gradient.pt
└── omat24-mptrj-salex_gradient.pt
权重 训练任务或领域 预期用途
mptrj_gradient.pt MPtrj gradient 在 MPtrj 材料结构上推理或评估
omat24_direct.pt OMat24 direct + DeNS 使用 OMat24 direct 模型进行推理或评估
omat24_gradient.pt OMat24 gradient 使用 OMat24 gradient 模型进行推理或评估
omat24-mptrj-salex_gradient.pt OMat24 + MPtrj + sAlex gradient 通用材料结构推理,为推理脚本的默认权重

Jd.pt 包含 Wigner 旋转基底,入口脚本会从 weight/Jd.pt 自动加载。

微调

运行 OC20 冒烟测试配置。

export ONESCIENCE_DATASETS_DIR=/path/to/onescience_datasets
bash demo/run.sh --config configs/oc20_scratch_8dcu_smoke.yaml

冒烟测试配置使用八个训练样本、八个验证样本和一个精简的单层模型。它执行一次参数更新,用于验证数据管线、分布式通信、前向与反向传播、优化器以及模型权重(检查点)(checkpoint)保存流程。

运行完整 OC20 配置。

bash demo/run.sh --config configs/oc20_scratch_8dcu.yaml

此配置使用一个节点、八张 DCU,训练 12 轮。FP32 是当前经过验证的稳定方式。同一完整模型使用 FP16/BF16 进行的对照实验遇到了 DCU 内核 VMFault,因此发布配置使用 amp: false。

推理

单点能量、力与应力

python single_point.py --device cuda --output outputs/single_point.json

形成能

python formation_energy.py --device cuda --output outputs/formation_energy.json

弹性张量

python elastic.py --relax --device cuda --output outputs/elastic.json

声子

python phonons.py \
  --supercell 3 3 3 \
  --bandpath GXWKGL \
  --device cuda \
  --output-dir outputs/phonons

自定义结构或权重

python single_point.py --input structure.cif
python elastic.py --input POSCAR --output outputs/elastic.json
python phonons.py --input structure.cif --supercell 2 2 2
python single_point.py --checkpoint weight/omat24_gradient.pt

--input 支持 CIF、POSCAR、XYZ、轨迹及 ASE 可读取的其他格式。四个推理脚本均默认使用 weight/omat24-mptrj-salex_gradient.pt。

OneScience 官方资源


引用与许可证

  • Equiformer V3 架构代码基于按 MIT License 发布的上游软件。请参见仓库根目录下的 LICENSE。
  • OC20 数据集采用 CC BY 4.0 授权,详见其官方页面。本仓库的 MIT License 不涵盖数据集许可。
  • 如果在研究中使用 Equiformer V3 或 OC20,请引用 Equiformer V3 论文、OC20 数据集论文以及实际使用数据集的来源。
@article{equiformer_v3,
  title={EquiformerV3: Scaling Efficient, Expressive, and General SE(3)-Equivariant Graph Attention Transformers},
  author={Yi-Lun Liao and Alexander J. Hoffman and Sabrina C. Shen and Alexandre Duval and Sam Walton Norwood and Tess Smidt},
  journal={arXiv preprint arXiv:2604.09130},
  year={2026}
}

@article{oc20,
  title={Open Catalyst 2020 (OC20) Dataset and Community Challenges},
  author={Lowik Chanussot and Abhishek Das and Siddharth Goyal and others},
  journal={ACS Catalysis},
  year={2021},
  doi={10.1021/acscatal.0c04525}
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train OneScience-Group/Equiformer_v3

Paper for OneScience-Group/Equiformer_v3