Skip to content

Commit 8cd4378

Browse files
committed
feat(domino): support domino for training and test
1 parent 896bbc6 commit 8cd4378

File tree

27 files changed

+5141
-14
lines changed

27 files changed

+5141
-14
lines changed

examples/domino/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# DoMINO: Decomposable Multi-scale Iterative Neural Operator for External Aerodynamics
2+
3+
DoMINO代码复现。
4+
5+
## 安装依赖
6+
7+
```shell
8+
# 安装PaddlePaddle
9+
10+
cd /path/PaddleScience
11+
pip install -e .
12+
13+
cd /path/PaddleScience/examples/domino
14+
pip install -r requirements.txt
15+
```
16+
17+
## 数据集下载与处理
18+
19+
1. 参考[DoMINO](https://github.com/NVIDIA/modulus/tree/main/examples/cfd/external_aerodynamics/domino#training-the-domino-model)数据下载和处理方式,执行`download_aws_dataset.sh``process_data.py`,获取数据。
20+
21+
2. 本仓库训练数据为`process_data.py`的后处理数据。
22+
23+
## 训练
24+
25+
1. 修改`conf/config.yaml`路径, 原始配置文件参考[DoMINO](https://github.com/NVIDIA/modulus/blob/main/examples/cfd/external_aerodynamics/domino/src/conf/config.yaml)
26+
27+
2. 训练
28+
29+
```shell
30+
cd /path/PaddleScience/examples/domino
31+
python train.py
32+
```
33+
34+
## 推理
35+
36+
1. 修改`conf/config.yaml`路径, 原始配置文件参考[DoMINO](https://github.com/NVIDIA/modulus/blob/main/examples/cfd/external_aerodynamics/domino/src/conf/config.yaml)
37+
38+
2. 推理
39+
40+
```shell
41+
cd /path/PaddleScience/examples/domino
42+
python test.py
43+
```

examples/domino/conf/config.yaml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
project: # Project name
1818
name: AWS_Dataset
1919

20+
seed: 42
2021
exp_tag: 1 # Experiment tag
2122
# Main output directory.
2223
output: outputs/${project.name}/${exp_tag}
@@ -27,8 +28,8 @@ hydra: # Hydra config
2728
output_subdir: hydra # Default is .hydra which causes files not being uploaded in W&B.
2829

2930
data: # Input directory for training and validation data
30-
input_dir: /lustre/rranade/modulus_dev/data/volume_data/
31-
input_dir_val: /lustre/rranade/modulus_dev/data/volume_data_val/
31+
input_dir: /home/aistudio/modulus/examples/cfd/external_aerodynamics/domino/outputs/volume_data/
32+
input_dir_val: /home/aistudio/modulus/examples/cfd/external_aerodynamics/domino/outputs/volume_data/
3233
bounding_box: # Bounding box dimensions for computational domain
3334
min: [-3.5, -2.25 , -0.32]
3435
max: [8.5 , 2.25 , 3.00]
@@ -55,12 +56,12 @@ variables:
5556
model:
5657
model_type: combined # train which model? surface, volume, combined
5758
loss_function: "mse" # mse or rmse
58-
interp_res: [128, 64, 48] # resolution of latent space
59+
interp_res: [64, 32, 24] # resolution of latent space
5960
use_sdf_in_basis_func: true # SDF in basis function network
6061
positional_encoding: false # calculate positional encoding?
61-
volume_points_sample: 8192 # Number of points to sample in volume per epoch
62-
surface_points_sample: 8192 # Number of points to sample on surface per epoch
63-
geom_points_sample: 200_000 # Number of points to sample on STL per epoch
62+
volume_points_sample: 1024 # Number of points to sample in volume per epoch
63+
surface_points_sample: 1024 # Number of points to sample on surface per epoch
64+
geom_points_sample: 2_000 # Number of points to sample on STL per epoch
6465
surface_neighbors: true # Pre-compute surface neighborhood from input data
6566
num_surface_neighbors: 7 # How many neighbors?
6667
use_surface_normals: true # Use surface normals and surface areas for surface computation?
@@ -95,11 +96,10 @@ model:
9596
scaling_params: [30.0, 1.226] # [inlet_velocity, air_density]
9697

9798
train: # Training configurable parameters
98-
epochs: 500
99+
epochs: 50
99100
checkpoint_interval: 1
100101
dataloader:
101102
batch_size: 1
102-
pin_memory: true
103103
sampler:
104104
shuffle: true
105105
drop_last: false
@@ -108,15 +108,14 @@ train: # Training configurable parameters
108108
val: # Validation configurable parameters
109109
dataloader:
110110
batch_size: 1
111-
pin_memory: true
112111
sampler:
113112
shuffle: true
114113
drop_last: false
115114

116115
eval: # Testing configurable parameters
117-
test_path: /lustre/rranade/benchmarking/drivaer_aws_surface_test_new/
118-
save_path: /lustre/rranade/domino/mesh_predictions_surf_final1/
119-
checkpoint_name: DoMINO.0.50.pt
116+
test_path: /home/aistudio/modulus/examples/cfd/external_aerodynamics/domino/drivaer_data_full_new
117+
save_path: /home/aistudio/modulus/examples/cfd/external_aerodynamics/domino/outputs/mesh_predictions_surf_final1/
118+
checkpoint_name: /home/aistudio/xiaoyewww/PaddleScience/examples/domino/outputs/AWS_Dataset/1/models/DoMINO.0.30.pdparams
120119

121120
data_processor: # Data processor configurable parameters
122121
kind: drivaer_aws # must be either drivesim or drivaer_aws

examples/domino/modulus/__init__.py

Whitespace-only changes.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2023 - 2024 NVIDIA CORPORATION & AFFILIATES.
2+
# SPDX-FileCopyrightText: All rights reserved.
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
from .domino_datapipe import DoMINODataPipe # noqa: F401

0 commit comments

Comments
 (0)