File size: 4,660 Bytes
7087ec2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
---
license: apache-2.0
language:
- en
tags:
- OneScience
- BENO
- elliptic PDEs
- boundary-embedded neural operator
frameworks: PyTorch
---

<p align="center">
  <strong>
    <span style="font-size: 30px;">BENO</span>
  </strong>
</p>

# Model Overview

BENO is a boundary-embedded neural operator developed by researchers at Peking University for solving elliptic PDEs subject to complex boundary conditions. It enables rapid prediction of steady-state physical fields across varying geometries and nonhomogeneous boundary conditions.

Paper: [BENO: Boundary-embedded Neural Operators for Elliptic PDEs](https://openreview.net/forum?id=ZZTkLDRmkg)

# Model Description
BENO employs a boundary-embedded neural operator architecture that combines a dual-branch graph neural network with a Transformer. Trained on the BENO dataset, it predicts steady-state physical fields governed by elliptic PDEs such as the Poisson and Laplace equations on complex geometries with nonhomogeneous boundary conditions.

# Use Cases

| Use Case | Description |
| ---------- | --------------------------------- |
| Elliptic PDE solving | Rapidly approximate steady-state boundary-value problems such as the Poisson and Laplace equations |
| Complex boundary modeling | Capture the effects of free-form boundaries, irregular domains, and nonhomogeneous boundary values on the solution field |
| Steady-state field prediction | Predict equilibrium physical fields determined jointly by source terms and boundary conditions |
| Numerical solver acceleration | Replace or augment conventional FEM, FDM, and FVM workflows to improve inference efficiency |

# Usage
## 1. OneCode

Use the online OneCode environment for an intelligent, one-click AI for Science (AI4S) programming experience:

[Launch OneCode for one-click AI4S programming](https://web-2069360198568017922-iaaj.ksai.scnet.cn:58043/home)

## 2. Manual Setup

**Hardware Requirements**

- A GPU or DCU is recommended.
- A CPU can be used for import checks and small-scale pipeline validation, but full training and inference will be slow.
- DCU users must install DTK in advance. DTK 25.04.2 or later, or the OneScience-recommended version for the target cluster, is recommended.

### Download the Model Package

```bash
modelscope download --model OneScience/BENO --local_dir ./BENO
cd BENO
```

### Set Up the Runtime Environment


**DCU Environment**

```bash
# Activate DTK and Conda first
conda create -n onescience311 python=3.11 -y
conda activate onescience311
# Installation with uv is also supported
pip install onescience[cfd-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/  --trusted-host mirrors.onescience.ai
```

**GPU Environment**
```bash
# Activate Conda first
conda create -n onescience311 python=3.11 -y libstdcxx-ng=12 libgcc-ng=12 gcc_linux-64=12 gxx_linux-64=12
conda activate onescience311
# Installation with uv is also supported
pip install onescience[cfd-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/  --trusted-host mirrors.onescience.ai
```

### Training Data
The OneScience community provides the `beno` dataset for training. Download it with the command below and verify that the data path in `config/config.yaml` is configured correctly:

```bash
modelscope download --dataset OneScience/beno --local_dir ./data
```
The complete dataset is also available from the [official download link](https://drive.google.com/file/d/11PbUrzJ-b18VhFGY_uICSciCkeGrsaTZ/view).

### Training

Single GPU:

```bash
python scripts/train.py
```

Multiple GPUs:
```
torchrun --standalone --nnodes=<num_nodes> --nproc_per_node=<num_GPUs> scripts/train.py
```

### Model Weights
This repository will provide weights trained on the BENO dataset in the `weights/` directory. The weights will be uploaded soon.

### Inference

```bash
python scripts/inference.py
```

### Evaluation and Visualization

```bash
python scripts/result.py
```

# Official OneScience Resources

| Platform | OneScience Repository | Skills Repository |
| --- | --- | --- |
| Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills |
| GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills |

# Citations and License

- Original BENO paper: [BENO: Boundary-embedded Neural Operators for Elliptic PDEs](https://proceedings.iclr.cc/paper_files/paper/2024/file/218ca0d92e6ed8f9db00621e103dc70c-Paper-Conference.pdf)
- This repository retains source attribution and has been adapted for automated execution through OneScience and ModelScope. Before public redistribution, verify the applicable licensing requirements of the upstream project.