Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions rfcs/Science/20251009_e3nn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# e3nn 适配 paddle 设计文档

> RFC 文档相关记录信息

| | |
| ------------ | ------------------ |
| 提交作者 | BeingGod |
| 提交时间 | 2025-10-09 |
| RFC 版本号 | v1.0 |
| 依赖飞桨版本 | 3.2 版本 |
| 文件名 | 20251009_e3nn |

## 1. 概述

### 1.1 相关背景

e3nn(Euclidean Neural Networks) 是一个专门为 三维几何与物理问题 设计的 群等变(equivariant)深度学习库,基于 PyTorch 实现。主要用于 三维结构、物理建模、分子模拟 等需要几何等变性的场景。

### 1.2 功能目标

1. 完整实现e3nn中的全部API,精度实现对齐;
2. 实现对应的单元测试;


### 1.3 意义

e3nn 作为 PaddleCFD 的第三方依赖,被广泛应用于材料、流体等科学计算领域中,paddle 完整支持 e3nn 可以进一步丰富飞桨在 AI4S 领域的应用生态。

## 2. 目标调研

### 2.1 适配版本

| 组件 | 版本 |
| ------------ | ------------------ |
| paddle | 3.2 |
| e3nn | 0.5.6 |


### 2.2 相关接口及对应单测梳理

项目结构
|模块 |功能| 示例|
| ------------ | ------------------ |------------------ |
|e3nn.o3 |SO(3) 群操作与张量代数 |Irreps, SphericalHarmonics, TensorProduct|
|e3nn.nn |等变网络层 |FullyConnectedTensorProduct, Gate, BatchNorm|
|e3nn.io |输入输出封装 |转换为 IrrepsData 类型|
|e3nn.util |工具函数 |坐标变换、可视化等|

单测
| 单测路径 |
| ------------ |
| tests/math/perm_test.py|
| tests/math/soft_one_hot_test.py|
| tests/math/normalize_activation_test.py|
| tests/math/soft_unit_step_test.py|
| tests/nn/s2act_test.py|
| tests/nn/activation_test.py|
| tests/nn/extract_test.py|
| tests/nn/gate_test.py|
| tests/nn/so3act_test.py|
| tests/nn/batchnorm_test.py|
| tests/nn/normact_test.py|
| tests/nn/fc_test.py|
| tests/nn/dropout_test.py|
| tests/o3/s2_test.py|
| tests/o3/angular_spherical_harmonics_test.py|
| tests/o3/norm_test.py|
| tests/o3/irreps_test.py|
| tests/o3/wigner_test.py|
| tests/o3/rotation_test.py|
| tests/o3/reduce_tensor_test.py|
| tests/o3/tensor_product_sub_test.py|
| tests/o3/cartesian_spherical_harmonics_test.py|
| tests/o3/tensor_product_test.py|
| tests/o3/linear_test.py|
| tests/util/test_test.py|
| tests/util/test_jit.py|
| tests/defaults_test.py|

## 3. 设计思路与实现方案

1. 使用 PaConvert 完成 python 接口迁移
2. 对不支持的接口进行手动改写
3. 跑通全量单测并实现精度对齐

### 3.1 补充说明[可选]

由于 Paddle 主框架对 compile 支持有限,对于 e3nn 中涉及 torch.compile 相关的测例暂时跳过。

## 4. 测试和验收的考量

1. 实现e3nn中的API,并给出安装、使用说明;
2. 实现其中对应的单元测试并通过;
3. 最终代码合入PFCCLab组织下;

## 5. 可行性分析和排期规划

- 2025.10:调研,复现代码并作调整。整理项目产出,撰写案例文档

## 6. 影响面

1. 在 PFCC 下添加 e3nn 仓库