Skip to content

Commit c90ce00

Browse files
update document and fix bugs
1 parent 65f981b commit c90ce00

File tree

6 files changed

+67
-66
lines changed

6 files changed

+67
-66
lines changed

deploy/python_infer/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Predictor:
3838
Args:
3939
pdmodel_path (Optional[str]): Path to the PaddlePaddle model file. Defaults to None.
4040
pdiparams_path (Optional[str]): Path to the PaddlePaddle model parameters file. Defaults to None.
41-
device (Literal["gpu", "cpu", "npu", "xpu"], optional): Device to use for inference. Defaults to "cpu".
41+
device (Literal["gpu", "cpu", "npu", "xpu", "sdaa"], optional): Device to use for inference. Defaults to "cpu".
4242
engine (Literal["native", "tensorrt", "onnx", "mkldnn"], optional): Inference engine to use. Defaults to "native".
4343
precision (Literal["fp32", "fp16", "int8"], optional): Precision to use for inference. Defaults to "fp32".
4444
onnx_path (Optional[str], optional): Path to the ONNX model file. Defaults to None.
@@ -54,7 +54,7 @@ def __init__(
5454
pdmodel_path: Optional[str] = None,
5555
pdiparams_path: Optional[str] = None,
5656
*,
57-
device: Literal["gpu", "cpu", "npu", "xpu"] = "cpu",
57+
device: Literal["gpu", "cpu", "npu", "xpu", "sdaa"] = "cpu",
5858
engine: Literal["native", "tensorrt", "onnx", "mkldnn"] = "native",
5959
precision: Literal["fp32", "fp16", "int8"] = "fp32",
6060
onnx_path: Optional[str] = None,

docs/zh/multi_device.md

+59-59
Original file line numberDiff line numberDiff line change
@@ -8,80 +8,80 @@
88

99
| 问题类型 | 案例名称 | 昆仑芯 | 海光 | 寒武纪 | 昇腾 | 燧原 | 天数 | 摩尔线程 | 沐曦 | 太初 |
1010
|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
11-
| 亥姆霍兹方程 | [SPINN(Helmholtz3D)](./examples/spinn.md) | || | | | | | ||
12-
| 相场方程 | [Allen-Cahn](./examples/allen_cahn.md) | || | | | | | ||
13-
| 微分方程 | [拉普拉斯方程](./examples/laplace2d.md) | || | | | | | ||
14-
| 微分方程 | [伯格斯方程](./examples/deephpms.md) | || | | | | | ||
15-
| 微分方程 | [非线性偏微分方程](./examples/pirbn.md) | || | | | | | ||
16-
| 微分方程 | [洛伦兹方程](./examples/lorenz.md) | || | | | | | ||
17-
| 微分方程 | [若斯叻方程](./examples/rossler.md) | || | | | | | ||
18-
| 算子学习 | [DeepONet](./examples/deeponet.md) | || | | | | | ||
19-
| 微分方程 | [梯度增强的物理知识融合 PDE 求解](https://github.com/PaddlePaddle/PaddleScience/blob/develop/examples/gpinn/poisson_1d.py) | || | | | | | ||
20-
| 积分方程 | [沃尔泰拉积分方程](./examples/volterra_ide.md) | || | | | | | ||
21-
| 微分方程 | [分数阶微分方程](https://github.com/PaddlePaddle/PaddleScience/blob/develop/examples/fpde/fractional_poisson_2d.py) | || | | | | | ||
22-
| 光纤怪波 | [Optical rogue wave](./examples/nlsmb.md) | || | | | | | ||
23-
| 域分解 | [XPINN](./examples/xpinns.md) | || | | | | | ||
24-
| 布鲁塞尔扩散系统 | [3D-Brusselator](./examples/brusselator3d.md) | || | | | | | ||
25-
| 符号回归 | [Transformer4SR](./examples/transformer4sr.md) | || | | | | | ||
11+
| 亥姆霍兹方程 | [SPINN(Helmholtz3D)](./examples/spinn.md) | | | | | | | | | |
12+
| 相场方程 | [Allen-Cahn](./examples/allen_cahn.md) | | | | | | | | | |
13+
| 微分方程 | [拉普拉斯方程](./examples/laplace2d.md) | | | | | | | | | |
14+
| 微分方程 | [伯格斯方程](./examples/deephpms.md) | | | | | | | | | |
15+
| 微分方程 | [非线性偏微分方程](./examples/pirbn.md) | | | | | | | | | |
16+
| 微分方程 | [洛伦兹方程](./examples/lorenz.md) | | | | | | | | | |
17+
| 微分方程 | [若斯叻方程](./examples/rossler.md) | | | | | | | | | |
18+
| 算子学习 | [DeepONet](./examples/deeponet.md) | | | | | | | | | |
19+
| 微分方程 | [梯度增强的物理知识融合 PDE 求解](https://github.com/PaddlePaddle/PaddleScience/blob/develop/examples/gpinn/poisson_1d.py) | | | | | | | | | |
20+
| 积分方程 | [沃尔泰拉积分方程](./examples/volterra_ide.md) | | | | | | | | | |
21+
| 微分方程 | [分数阶微分方程](https://github.com/PaddlePaddle/PaddleScience/blob/develop/examples/fpde/fractional_poisson_2d.py) | | | | | | | | | |
22+
| 光纤怪波 | [Optical rogue wave](./examples/nlsmb.md) | | | | | | | | | |
23+
| 域分解 | [XPINN](./examples/xpinns.md) | | | | | | | | | |
24+
| 布鲁塞尔扩散系统 | [3D-Brusselator](./examples/brusselator3d.md) | | | | | | | | | |
25+
| 符号回归 | [Transformer4SR](./examples/transformer4sr.md) | | | | | | | | | |
2626

2727
<br>
2828
<p align="center"><b>技术科学(AI for Technology)</b></p>
2929

3030
| 问题类型 | 案例名称 | 昆仑芯 | 海光 | 寒武纪 | 昇腾 | 燧原 | 天数 | 摩尔线程 | 沐曦 | 太初 |
3131
|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
32-
| 汽车表面阻力预测 | [DrivAerNet](./examples/drivaernet.md) | || | | | | | ||
33-
| 一维线性对流问题 | [1D 线性对流](./examples/adv_cvit.md) | || | | | | | ||
34-
| 非定常不可压流体 | [2D 方腔浮力驱动流](./examples/ns_cvit.md) | || | | | | | ||
35-
| 定常不可压流体 | [Re3200 2D 定常方腔流](./examples/ldc2d_steady.md) | || | | | | | ||
36-
| 定常不可压流体 | [2D 达西流](./examples/darcy2d.md) | || | | | | | ||
37-
| 定常不可压流体 | [2D 管道流](./examples/labelfree_DNN_surrogate.md) | || | | | | | ||
38-
| 定常不可压流体 | [3D 颅内动脉瘤](./examples/aneurysm.md) | || | | | | | ||
39-
| 定常不可压流体 | [任意 2D 几何体绕流](./examples/deepcfd.md) | || | | | | | ||
40-
| 非定常不可压流体 | [2D 非定常方腔流](./examples/ldc2d_unsteady.md) | || | | | | | ||
41-
| 非定常不可压流体 | [Re100 2D 圆柱绕流](./examples/cylinder2d_unsteady.md) | || | | | | | ||
42-
| 非定常不可压流体 | [Re100~750 2D 圆柱绕流](./examples/cylinder2d_unsteady_transformer_physx.md) | || | | | | | ||
43-
| 可压缩流体 | [2D 空气激波](./examples/shock_wave.md) | || | | | | | ||
44-
| 飞行器设计 | [MeshGraphNets](https://aistudio.baidu.com/projectdetail/5322713) | || | | | | | ||
45-
| 飞行器设计 | [火箭发动机真空羽流](https://aistudio.baidu.com/projectdetail/4486133) | || | | | | | ||
46-
| 飞行器设计 | [Deep-Flow-Prediction](https://aistudio.baidu.com/projectdetail/5671596) | || | | | | | ||
47-
| 通用流场模拟 | [气动外形设计](./examples/amgnet.md) | || | | | | | ||
48-
| 流固耦合 | [涡激振动](./examples/viv.md) | || | | | | | ||
49-
| 多相流 | [气液两相流](./examples/bubble.md) | || | | | | | ||
50-
| 多相流 | [twophasePINN](https://aistudio.baidu.com/projectdetail/5379212) | || | | | | | ||
51-
| 流场高分辨率重构 | [2D 湍流流场重构](./examples/tempoGAN.md) | || | | | | | ||
52-
| 流场高分辨率重构 | [2D 湍流流场重构](https://aistudio.baidu.com/projectdetail/4493261?contributionType=1) | || | | | | | ||
53-
| 流场高分辨率重构 | [基于Voronoi嵌入辅助深度学习的稀疏传感器全局场重建](https://aistudio.baidu.com/projectdetail/5807904) | || | | | | | ||
54-
| 流场预测 | [Catheter](https://aistudio.baidu.com/projectdetail/5379212) | || | | | | | ||
55-
| 求解器耦合 | [CFD-GCN](./examples/cfdgcn.md) | || | | | | | ||
56-
| 受力分析 | [1D 欧拉梁变形](./examples/euler_beam.md) | || | | | | | ||
57-
| 受力分析 | [2D 平板变形](./examples/biharmonic2d.md) | || | | | | | ||
58-
| 受力分析 | [3D 连接件变形](./examples/bracket.md) | || | | | | | ||
59-
| 受力分析 | [结构震动模拟](./examples/phylstm.md) | || | | | | | ||
60-
| 受力分析 | [2D 弹塑性结构](./examples/epnn.md) | || | | | | | ||
61-
| 受力分析和逆问题 | [3D 汽车控制臂变形](./examples/control_arm.md) | || | | | | | ||
62-
| 受力分析和逆问题 | [3D 心脏仿真](./examples/heart.md) | || | | | | | ||
63-
| 拓扑优化 | [2D 拓扑优化](./examples/topopt.md) | || | | | | | ||
64-
| 热仿真 | [1D 换热器热仿真](./examples/heat_exchanger.md) | || | | | | | ||
65-
| 热仿真 | [2D 热仿真](./examples/heat_pinn.md) | || | | | | | ||
66-
| 热仿真 | [2D 芯片热仿真](./examples/chip_heat.md) | || | | | | | ||
32+
| 汽车表面阻力预测 | [DrivAerNet](./examples/drivaernet.md) | | | | | | | | | |
33+
| 一维线性对流问题 | [1D 线性对流](./examples/adv_cvit.md) | | | | | | | | | |
34+
| 非定常不可压流体 | [2D 方腔浮力驱动流](./examples/ns_cvit.md) | | | | | | | | | |
35+
| 定常不可压流体 | [Re3200 2D 定常方腔流](./examples/ldc2d_steady.md) | | | | | | | | | |
36+
| 定常不可压流体 | [2D 达西流](./examples/darcy2d.md) | | | | | | | | | |
37+
| 定常不可压流体 | [2D 管道流](./examples/labelfree_DNN_surrogate.md) | | | | | | | | | |
38+
| 定常不可压流体 | [3D 颅内动脉瘤](./examples/aneurysm.md) | | | | | | | | | |
39+
| 定常不可压流体 | [任意 2D 几何体绕流](./examples/deepcfd.md) | | | | | | | | | |
40+
| 非定常不可压流体 | [2D 非定常方腔流](./examples/ldc2d_unsteady.md) | | | | | | | | | |
41+
| 非定常不可压流体 | [Re100 2D 圆柱绕流](./examples/cylinder2d_unsteady.md) | | | | | | | | | |
42+
| 非定常不可压流体 | [Re100~750 2D 圆柱绕流](./examples/cylinder2d_unsteady_transformer_physx.md) | | | | | | | | | |
43+
| 可压缩流体 | [2D 空气激波](./examples/shock_wave.md) | | | | | | | | | |
44+
| 飞行器设计 | [MeshGraphNets](https://aistudio.baidu.com/projectdetail/5322713) | | | | | | | | | |
45+
| 飞行器设计 | [火箭发动机真空羽流](https://aistudio.baidu.com/projectdetail/4486133) | | | | | | | | | |
46+
| 飞行器设计 | [Deep-Flow-Prediction](https://aistudio.baidu.com/projectdetail/5671596) | | | | | | | | | |
47+
| 通用流场模拟 | [气动外形设计](./examples/amgnet.md) | | | | | | | | | |
48+
| 流固耦合 | [涡激振动](./examples/viv.md) | | | | | | | | | |
49+
| 多相流 | [气液两相流](./examples/bubble.md) | | | | | | | | | |
50+
| 多相流 | [twophasePINN](https://aistudio.baidu.com/projectdetail/5379212) | | | | | | | | | |
51+
| 流场高分辨率重构 | [2D 湍流流场重构](./examples/tempoGAN.md) | | | | | | | | | |
52+
| 流场高分辨率重构 | [2D 湍流流场重构](https://aistudio.baidu.com/projectdetail/4493261?contributionType=1) | | | | | | | | | |
53+
| 流场高分辨率重构 | [基于Voronoi嵌入辅助深度学习的稀疏传感器全局场重建](https://aistudio.baidu.com/projectdetail/5807904) | | | | | | | | | |
54+
| 流场预测 | [Catheter](https://aistudio.baidu.com/projectdetail/5379212) | | | | | | | | | |
55+
| 求解器耦合 | [CFD-GCN](./examples/cfdgcn.md) | | | | | | | | | |
56+
| 受力分析 | [1D 欧拉梁变形](./examples/euler_beam.md) | | | | | | | | | |
57+
| 受力分析 | [2D 平板变形](./examples/biharmonic2d.md) | | | | | | | | | |
58+
| 受力分析 | [3D 连接件变形](./examples/bracket.md) | | | | | | | | | |
59+
| 受力分析 | [结构震动模拟](./examples/phylstm.md) | | | | | | | | | |
60+
| 受力分析 | [2D 弹塑性结构](./examples/epnn.md) | | | | | | | | | |
61+
| 受力分析和逆问题 | [3D 汽车控制臂变形](./examples/control_arm.md) | | | | | | | | | |
62+
| 受力分析和逆问题 | [3D 心脏仿真](./examples/heart.md) | | | | | | | | | |
63+
| 拓扑优化 | [2D 拓扑优化](./examples/topopt.md) | | | | | | | | | |
64+
| 热仿真 | [1D 换热器热仿真](./examples/heat_exchanger.md) | | | | | | | | | |
65+
| 热仿真 | [2D 热仿真](./examples/heat_pinn.md) | | | | | | | | | |
66+
| 热仿真 | [2D 芯片热仿真](./examples/chip_heat.md) | | | | | | | | | |
6767

6868
<br>
6969
<p align="center"><b>材料科学(AI for Material)</b></p>
7070

7171
| 问题类型 | 案例名称 | 昆仑芯 | 海光 | 寒武纪 | 昇腾 | 燧原 | 天数 | 摩尔线程 | 沐曦 | 太初 |
7272
|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
73-
| 材料设计 | [散射板设计(反问题)](./examples/hpinns.md) | || | | | | | ||
73+
| 材料设计 | [散射板设计(反问题)](./examples/hpinns.md) | | | | | | | | | |
7474

7575
<br>
7676
<p align="center"><b>地球科学(AI for Earth Science)</b></p>
7777

7878
| 问题类型 | 案例名称 | 昆仑芯 | 海光 | 寒武纪 | 昇腾 | 燧原 | 天数 | 摩尔线程 | 沐曦 | 太初 |
7979
|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|
80-
| 天气预报 | [Extformer-MoE 气象预报](./examples/extformer_moe.md) | || | | | | | ||
81-
| 天气预报 | [FourCastNet 气象预报](./examples/fourcastnet.md) | || | | | | | ||
82-
| 天气预报 | [NowCastNet 气象预报](./examples/nowcastnet.md) | || | | | | | ||
83-
| 天气预报 | [GraphCast 气象预报](./examples/graphcast.md) | || | | | | | ||
84-
| 大气污染物 | [UNet 污染物扩散](https://aistudio.baidu.com/projectdetail/5663515?channel=0&channelType=0&sUid=438690&shared=1&ts=1698221963752) | || | | | | | ||
85-
| 天气预报 | [DGMR 气象预报](./examples/dgmr.md) | || | | | | | ||
86-
| 地震波形反演 | [VelocityGAN 地震波形反演](./examples/velocity_gan.md) | || | | | | | ||
87-
| 交通预测 | [TGCN 交通流量预测](./examples/tgcn.md) | || | | | | | ||
80+
| 天气预报 | [Extformer-MoE 气象预报](./examples/extformer_moe.md) | | | | | | | | | |
81+
| 天气预报 | [FourCastNet 气象预报](./examples/fourcastnet.md) | | | | | | | | | |
82+
| 天气预报 | [NowCastNet 气象预报](./examples/nowcastnet.md) | | | | | | | | | |
83+
| 天气预报 | [GraphCast 气象预报](./examples/graphcast.md) | | | | | | | | | |
84+
| 大气污染物 | [UNet 污染物扩散](https://aistudio.baidu.com/projectdetail/5663515?channel=0&channelType=0&sUid=438690&shared=1&ts=1698221963752) | | | | | | | | | |
85+
| 天气预报 | [DGMR 气象预报](./examples/dgmr.md) | | | | | | | | | |
86+
| 地震波形反演 | [VelocityGAN 地震波形反演](./examples/velocity_gan.md) | | | | | | | | | |
87+
| 交通预测 | [TGCN 交通流量预测](./examples/tgcn.md) | | | | | | | | | |

docs/zh/user_guide.md

+1
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ PaddleScience 提供了多种推理配置组合,可通过命令行进行组合
373373
| CPU | ✅ | ✅| / | ✅ |
374374
| GPU | ✅ | ✅ | ✅ | / |
375375
| XPU | TODO | / | / | / |
376+
| SDAA | TODO | / | / | / |
376377
377378
接下来以 aneurysm 案例和 Linux x86_64 + TensorRT 8.6 GA + CUDA 11.6 软硬件环境为例,介绍如何使用不同的推理配置。
378379

ppsci/arch/tfnonet.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -511,4 +511,4 @@ def __init__(
511511
)
512512
self.n_modes_height = n_modes_height
513513
self.n_modes_width = n_modes_width
514-
self.n_modes_height = n_modes_height
514+
self.n_modes_depth = n_modes_depth

ppsci/solver/solver.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class Solver:
8383
use_wandb (Optional[bool]): Whether use wandb to log data. Defaults to False.
8484
use_tbd (Optional[bool]): Whether use tensorboardX to log data. Defaults to False.
8585
wandb_config (Optional[Dict[str, str]]): Config dict of WandB. Defaults to None.
86-
device (Literal["cpu", "gpu", "xpu", None], optional): Runtime device. Defaults to None, which means use default device on current platform.
86+
device (Literal["cpu", "gpu", "xpu", "sdaa", None], optional): Runtime device. Defaults to None, which means use default device on current platform.
8787
equation (Optional[Dict[str, ppsci.equation.PDE]]): Equation dict. Defaults to None.
8888
geom (Optional[Dict[str, ppsci.geometry.Geometry]]): Geometry dict. Defaults to None.
8989
validator (Optional[Dict[str, ppsci.validate.Validator]]): Validator dict. Defaults to None.
@@ -145,7 +145,7 @@ def __init__(
145145
use_wandb: bool = False,
146146
use_tbd: bool = False,
147147
wandb_config: Optional[Mapping] = None,
148-
device: Literal["cpu", "gpu", "xpu", None] = None,
148+
device: Literal["cpu", "gpu", "xpu", "sdaa", None] = None,
149149
equation: Optional[Dict[str, ppsci.equation.PDE]] = None,
150150
geom: Optional[Dict[str, ppsci.geometry.Geometry]] = None,
151151
validator: Optional[Dict[str, ppsci.validate.Validator]] = None,

ppsci/utils/config.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ class InferConfig(BaseModel):
212212
pdmodel_path: Optional[str] = None
213213
pdiparams_path: Optional[str] = None
214214
onnx_path: Optional[str] = None
215-
device: Literal["gpu", "cpu", "npu", "xpu"] = "cpu"
215+
device: Literal["gpu", "cpu", "npu", "xpu", "sdaa"] = "cpu"
216216
engine: Literal["native", "tensorrt", "onnx", "mkldnn"] = "native"
217217
precision: Literal["fp32", "fp16", "int8"] = "fp32"
218218
ir_optim: bool = True
@@ -305,7 +305,7 @@ class SolverConfig(BaseModel):
305305
use_tbd: bool = False
306306
wandb_config: Mapping = {}
307307
use_wandb: bool = False
308-
device: Literal["cpu", "gpu", "xpu", None] = None
308+
device: Literal["cpu", "gpu", "xpu", "sdaa", None] = None
309309
use_amp: bool = False
310310
amp_level: Literal["O0", "O1", "O2", "OD"] = "O1"
311311
to_static: bool = False

0 commit comments

Comments
 (0)