Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build with torch
name: Build and Validation with CPU inference
on:
push:
branches:
Expand All @@ -8,7 +8,8 @@ on:
- master
jobs:
gpu_build:
runs-on: ubuntu-latest
runs-on: self-hosted
if: github.repository_owner == 'deepmodeling'
container:
image: ubuntu:20.04
steps:
Expand All @@ -35,15 +36,16 @@ jobs:
conda install -c cantera libcantera-devel
conda install pytorch
conda install pybind11
conda install --channel https://conda.anaconda.org/zhaofeng-shu33 easydict
cd /github/home/miniconda3/envs/libcantera/lib
ln -s libmkl_rt.so.1 libmkl_rt.so.2

- name: build_notorch
- name: build and validation with CPU inference
env:
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
OMPI_MCA_btl_vader_single_copy_mechanism: none
run:
/bin/bash -c "source ~/miniconda3/etc/profile.d/conda.sh && conda activate libcantera && source /opt/openfoam7/etc/bashrc && . install.sh --use_pytorch"
/bin/bash -c "source ~/miniconda3/etc/profile.d/conda.sh && conda activate libcantera && source /opt/openfoam7/etc/bashrc && . configure.sh --use_pytorch && source ./bashrc && . install.sh && cd test && ./Allrun && cmake -B build && cmake --build build && cd build && ctest"


46 changes: 0 additions & 46 deletions .github/workflows/cvode_validate.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ build/
*.tar
*.tgz
*.gtgz
*.pt


cantera_build/
log.*
Expand All @@ -54,7 +54,7 @@ log.*
dynamicCode/
postProcessing/
*.out
*.json

processor*/
chemkin/
*.foam
Expand Down
Empty file modified Allwclean
100644 → 100755
Empty file.
85 changes: 85 additions & 0 deletions mechanisms/H2/pytorchDNN/ESH2-sub1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"seed":20,
"mech_path":"/home/yaojunjie/data/mechanism/ES80_H2-7-16.yaml",
"shuffle":true,
"batch_size":1024,
"valid_batch_size":8192,
"train_size":10735978,
"valid_size":1192887,
"valid_ratio":0.1,
"prefetch":10,
"num_workers":16,
"pin_memory":true,
"power_transform":0.1,
"delta_t":1e-06,
"dim":9,
"layers":[
9,
1600,
800,
400,
9
],
"net_type":"fc",
"actfun":"CustomGELU",
"max_epoch":5000,
"epoch_decay":2500,
"learnrate":0.0001,
"lr_decay_rate":0.1,
"batch_grow_rate":128,
"lossfun":"L1",
"optim":"Adam",
"device":"cuda:0",
"n_gpu":8,
"use_DP":false,
"use_DDP":true,
"local_rank":-1,
"world_size":8,
"backend":"nccl",
"description":"test",
"current_time":"2022-10-28 00:02:52",
"Xmu":[
956.4666683951323,
1.2621251609602075,
-8.482865855078037,
-8.60195200775564,
-7.5687249938092975,
-8.739604352829021,
-3.0365348658864555,
-4.044646973729736,
-0.12868046894653598
],
"Xstd":[
144.56082979138094,
0.4316114858005481,
1.3421800304159297,
1.3271564927376922,
1.964747648182199,
1.1993472911833807,
1.2594695379275647,
1.3518816605077604,
0.17392016053354714
],
"Ymu":[
115735.41509559377,
4.2646672113712347e-13,
8901.112679962635,
27135.624769093312,
30141.97503208172,
24712.755148584696,
-372.9651472886253,
-493.34322699725413,
-4.31138850114707e-12
],
"Ystd":[
115735.41509559377,
1.1513875522375139e-10,
8901.112679962635,
27135.624769093312,
30141.97503208172,
24712.755148584696,
372.96514728862553,
493.3432269972544,
9.409165181242247e-11
]
}
85 changes: 85 additions & 0 deletions mechanisms/H2/pytorchDNN/ESH2-sub2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"seed": 2022,
"mech_path": "Chem/ESH2.yaml",
"shuffle": true,
"batch_size": 1024,
"valid_batch_size": 8192,
"train_size": 5792898,
"valid_size": 643656,
"valid_ratio": 0.1,
"prefetch": 10,
"num_workers": 16,
"pin_memory": true,
"power_transform": 0.1,
"delta_t": 1e-06,
"dim": 9,
"layers": [
9,
1600,
800,
400,
9
],
"net_type": "fc",
"actfun": "CustomGELU",
"max_epoch": 5000,
"epoch_decay": 2500,
"learnrate": 0.0001,
"lr_decay_rate": 0.1,
"batch_grow_rate": 128,
"lossfun": "L1",
"optim": "Adam",
"device": "cuda:6",
"n_gpu": 8,
"use_DP": false,
"use_DDP": false,
"local_rank": -1,
"world_size": 1,
"backend": "nccl",
"description": "test",
"current_time": "2022-10-19 17:09:44",
"Xmu":[
1933.118541482812,
1.2327983023706526,
-5.705591538151852,
-6.446971251373195,
-4.169802387800032,
-6.1200334699867165,
-4.266343396329115,
-2.6007437468608616,
-0.4049762774428252
],
"Xstd":[
716.6568054751183,
0.43268544913281914,
2.0857655247141387,
2.168997234412133,
2.707064105162402,
2.2681157746245897,
2.221785173612795,
1.5510851480805254,
0.30283229364455927
],
"Ymu":[
6381847.837202463,
4.751063937334583e-14,
175072.98234441387,
125434.41067566245,
285397.9376620931,
172924.8443087139,
-97451.53428068386,
-7160.953630852251,
-9.791262408691773e-10
],
"Ystd":[
6396799.801910002,
1.3523423408265769e-10,
179830.51132577812,
256152.83860126554,
285811.9455262339,
263600.5448448552,
98110.53711881173,
11752.979335965118,
4.0735353885293555e-09
]
}
85 changes: 85 additions & 0 deletions mechanisms/H2/pytorchDNN/ESH2-sub3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"seed":20,
"mech_path":"/home/yaojunjie/data/mechanism/ES80_H2-7-16.yaml",
"shuffle":true,
"batch_size":1024,
"valid_batch_size":8192,
"train_size":2392228,
"valid_size":265804,
"valid_ratio":0.1,
"prefetch":10,
"num_workers":16,
"pin_memory":true,
"power_transform":0.1,
"delta_t":1e-06,
"dim":9,
"layers":[
9,
1600,
800,
400,
9
],
"net_type":"fc",
"actfun":"CustomGELU",
"max_epoch":5000,
"epoch_decay":2500,
"learnrate":0.0001,
"lr_decay_rate":0.1,
"batch_grow_rate":128,
"lossfun":"L1",
"optim":"Adam",
"device":"cuda:0",
"n_gpu":6,
"use_DP":false,
"use_DDP":true,
"local_rank":-1,
"world_size":6,
"backend":"nccl",
"description":"test",
"current_time":"2022-10-27 15:06:21",
"Xmu":[
2717.141719004927,
1.2871371577864235,
-5.240181052513087,
-4.8947914078286345,
-3.117070179161789,
-4.346362771443917,
-4.657258124450032,
-4.537442872141596,
-0.11656950757756744
],
"Xstd":[
141.48030419772115,
0.4281422992061657,
0.6561518672685264,
0.9820405777881894,
1.0442969662425572,
0.7554583907448359,
1.7144519099198097,
1.1299391466695952,
0.15743252221610685
],
"Ymu":[
592947.6742955892,
5.1584233576272535e-14,
-611.0636921032669,
-915.1244682112174,
519.5930550881994,
-11.949500174512165,
-2660.9187297995336,
159.56360614662788,
-7.136459430073843e-11
],
"Ystd":[
592947.6742955892,
1.2527170559513018e-10,
611.0636921032669,
915.1244682112174,
519.5930550881994,
342.3100987934528,
2754.8463649064784,
313.3717647966624,
2.463374792192512e-10
]
}
2 changes: 1 addition & 1 deletion src/dfChemistryModel/dfChemistryModel.H
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public IOdictionary
scalar Qdotact2_;
scalar Tact3_;
scalar Qdotact3_;
int coresPerGPU;
int coresPerGPU_;

// profiling
double time_allsolve_;
Expand Down
4 changes: 2 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)


file(COPY ./df0DFoam/zeroD_cubicReactor/H2/cvodeSolver/postProcessing/probes/0/T DESTINATION 0DH2)
file(COPY ./df0DFoam/zeroD_cubicReactor/CH4/cvodeSolver/postProcessing/probes/0/T DESTINATION 0DCH4)
file(COPY ./df0DFoam/postProcessing/probes/0/T DESTINATION 0DH2)

file(COPY ./dfHighSpeedFoam/oneD_detonationH2/postProcessing/minMax/0/fieldMinMax.dat DESTINATION 1Ddetonation)
file(COPY ./dfLowMachFoam/twoD_reactingTGV/H2/cvodeSolver/postProcessing/sample/0.0005/data_T.xy DESTINATION 2DTGV/5)
file(COPY ./dfLowMachFoam/twoD_reactingTGV/H2/cvodeSolver/postProcessing/sample/0.0004/data_T.xy DESTINATION 2DTGV/4)
Expand Down
Loading