Skip to content

Commit e06a6e5

Browse files
coreyjadamspeterdsharpe
authored andcommitted
Cleanup configs (#1654)
* Merge against main * Update the configs and python files * Update README too * undo change to paths * This new line character is essential * Undo most changes to the examples for a cleaner PR * trying to organize and de-duplicate configs * Bug fixes for congid consolidation. * undo unneeded changes * Update examples/cfd/external_aerodynamics/unified_external_aero_recipe/tests/test_synthetic_configs.py Co-authored-by: Peter Sharpe <peterdsharpe@gmail.com> * Update examples/cfd/external_aerodynamics/unified_external_aero_recipe/tests/test_synthetic_configs.py Co-authored-by: Peter Sharpe <peterdsharpe@gmail.com> * Clean uop config tests. * ensure first metrics is in the args again * Rmove env defaults for distributed set up on one gpu, for now --------- Co-authored-by: Peter Sharpe <peterdsharpe@gmail.com> Signed-off-by: Kashif Rasul <kashif.rasul@gmail.com>
1 parent 0ca57bd commit e06a6e5

39 files changed

Lines changed: 1285 additions & 2075 deletions

examples/cfd/external_aerodynamics/unified_external_aero_recipe/README.md

Lines changed: 252 additions & 60 deletions
Large diffs are not rendered by default.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2023 - 2026 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+
# ---------------------------------------------------------------------------
18+
# Universal cross-cutting defaults shared by train.yaml and (eventually)
19+
# infer.yaml. Anything truly training-only (output_dir, compile,
20+
# num_epochs, optimizer.lr, scheduler) lives in train.yaml so the
21+
# inference companion can stay clean of it.
22+
# ---------------------------------------------------------------------------
23+
24+
# -- Runtime knobs -----------------------------------------------------------
25+
precision: "bfloat16"
26+
profile: false
27+
augment: false
28+
benchmark_io: false
29+
30+
# -- Training fundamentals (the constants every loop needs, regardless
31+
# of schedule) -----------------------------------------------------------
32+
training:
33+
seed: 42
34+
save_interval: 25
35+
loss_type: "huber"
36+
batch_size: 1
37+
scheduler_update_mode: "epoch"
38+
optimizer:
39+
weight_decay: 1.0e-4
40+
betas: [0.9, 0.999]
41+
eps: 1.0e-8
42+
43+
# -- DataLoader / Dataset Performance Tuning --------------------------------
44+
dataloader:
45+
prefetch_factor: 1
46+
num_streams: 1
47+
use_streams: false
48+
num_workers: 1
49+
pin_memory: true
50+
51+
# -- Logging -----------------------------------------------------------------
52+
logging:
53+
log_every_n_steps: 10
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# @package _global_
2+
# SPDX-FileCopyrightText: Copyright (c) 2023 - 2026 NVIDIA CORPORATION & AFFILIATES.
3+
# SPDX-FileCopyrightText: All rights reserved.
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
18+
# ---------------------------------------------------------------------------
19+
# DoMINO template -- SURFACE-only recipes. >>> DRAFT (see comments).
20+
# ---------------------------------------------------------------------------
21+
# DoMINO uses a geometry-encoding UNet + basis-function architecture
22+
# that natively handles SDF grids and surface neighbor information.
23+
# Its forward method accepts a single ``data_dict`` argument; the
24+
# recipe's forward_kwargs resolver builds that dict by recursing into
25+
# the nested-dict spec below.
26+
#
27+
# >>> NOTE: DoMINO is still in progress in this recipe. The dataset
28+
# YAML (drivaer_ml_surface.yaml) does not yet expose all the per-cell
29+
# neighbor / grid features that DoMINO's full `forward(data_dict)`
30+
# expects. The references below are illustrative; running this config
31+
# end-to-end requires extending the dataset pipeline with a
32+
# DoMINO-specific pre-processing stage.
33+
input_type: tensors
34+
output_type: tensors
35+
36+
forward_kwargs:
37+
data_dict:
38+
geometry_coordinates: interior.points
39+
surface_mesh_centers: interior.points
40+
surface_normals: boundaries.vehicle.cell_data.normals
41+
global_params_values: global_data.U_inf
42+
global_params_reference: global_data.U_inf
43+
44+
model:
45+
_target_: physicsnemo.models.domino.DoMINO
46+
input_features: 3 # x, y, z coordinates
47+
output_features_surf: ${out_dim} # auto-set from the chosen dataset's `targets:` block
48+
output_features_vol: null # surface-only mode
49+
global_features: 3 # freestream velocity U_inf (3 components)
50+
model_parameters:
51+
interp_res: [128, 64, 64]
52+
use_sdf_in_basis_func: true
53+
surface_neighbors: true
54+
num_neighbors_surface: 7
55+
use_surface_normals: true
56+
use_surface_area: true
57+
geometry_encoding_type: "both"
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# @package _global_
2+
# SPDX-FileCopyrightText: Copyright (c) 2023 - 2026 NVIDIA CORPORATION & AFFILIATES.
3+
# SPDX-FileCopyrightText: All rights reserved.
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
18+
# ---------------------------------------------------------------------------
19+
# DoMINO template -- VOLUME-only recipes. >>> DRAFT (see comments).
20+
# ---------------------------------------------------------------------------
21+
# >>> NOTE: DoMINO is still in progress in this recipe (the dataset
22+
# pipeline does not yet expose all the volume-grid / neighbor features
23+
# DoMINO's full forward expects). The forward_kwargs spec below is
24+
# illustrative; see the surface variant for context.
25+
input_type: tensors
26+
output_type: tensors
27+
28+
forward_kwargs:
29+
data_dict:
30+
geometry_coordinates: interior.points
31+
volume_mesh_centers: interior.points
32+
sdf_nodes: interior.point_data.sdf
33+
global_params_values: global_data.U_inf
34+
global_params_reference: global_data.U_inf
35+
36+
model:
37+
_target_: physicsnemo.models.domino.DoMINO
38+
input_features: 3 # x, y, z coordinates
39+
output_features_vol: ${out_dim} # auto-set from the chosen dataset's `targets:` block
40+
output_features_surf: null # volume-only mode
41+
global_features: 3 # freestream velocity U_inf (3 components)
42+
model_parameters:
43+
interp_res: [128, 64, 64]
44+
use_sdf_in_basis_func: true
45+
num_neighbors_volume: 10
46+
geometry_encoding_type: "both"
47+
solution_calculation_mode: "two-loop"
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# @package _global_
2+
# SPDX-FileCopyrightText: Copyright (c) 2023 - 2026 NVIDIA CORPORATION & AFFILIATES.
3+
# SPDX-FileCopyrightText: All rights reserved.
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
18+
# ---------------------------------------------------------------------------
19+
# FLARE template -- SURFACE recipes.
20+
# ---------------------------------------------------------------------------
21+
# FLARE inherits from Transolver and replaces physics attention blocks
22+
# with FLARE (Fast Low-rank Attention Routing Engine) blocks. TE is
23+
# not supported, so there are no use_te / plus knobs to configure.
24+
# Forward signature matches Transolver's, hence the identical
25+
# forward_kwargs spec.
26+
input_type: tensors
27+
output_type: tensors
28+
29+
forward_kwargs:
30+
embedding:
31+
- interior.points
32+
- boundaries.vehicle.cell_data.normals
33+
fx:
34+
source: global_data.U_inf
35+
expand_like: embedding
36+
37+
model:
38+
_target_: physicsnemo.experimental.models.flare.FLARE
39+
out_dim: ${out_dim} # auto-set from the chosen dataset's `targets:` block
40+
functional_dim: 3 # fx = freestream velocity U_inf (3)
41+
embedding_dim: 6 # embedding = points (3) + normals (3)
42+
n_layers: 12
43+
n_hidden: 256
44+
dropout: 0.0
45+
n_head: 8
46+
act: "gelu"
47+
mlp_ratio: 4
48+
slice_num: 256 # n_global_queries for FLARE attention
49+
unified_pos: false
50+
structured_shape: null # unstructured mesh
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# @package _global_
2+
# SPDX-FileCopyrightText: Copyright (c) 2023 - 2026 NVIDIA CORPORATION & AFFILIATES.
3+
# SPDX-FileCopyrightText: All rights reserved.
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
18+
# ---------------------------------------------------------------------------
19+
# FLARE template -- VOLUME recipes.
20+
# ---------------------------------------------------------------------------
21+
# Same volume forward signature as Transolver volume; only the
22+
# attention backbone differs.
23+
input_type: tensors
24+
output_type: tensors
25+
26+
forward_kwargs:
27+
embedding:
28+
- interior.points
29+
- interior.point_data.sdf
30+
- interior.point_data.sdf_normals
31+
fx:
32+
source: global_data.U_inf
33+
expand_like: embedding
34+
35+
model:
36+
_target_: physicsnemo.experimental.models.flare.FLARE
37+
out_dim: ${out_dim} # auto-set from the chosen dataset's `targets:` block
38+
functional_dim: 3 # fx = freestream velocity U_inf (3)
39+
embedding_dim: 7 # embedding = points (3) + SDF (1) + SDF normals (3)
40+
n_layers: 12
41+
n_hidden: 256
42+
dropout: 0.0
43+
n_head: 8
44+
act: "gelu"
45+
mlp_ratio: 4
46+
slice_num: 256 # n_global_queries for FLARE attention
47+
unified_pos: false
48+
structured_shape: null # unstructured mesh
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# @package _global_
2+
# SPDX-FileCopyrightText: Copyright (c) 2023 - 2026 NVIDIA CORPORATION & AFFILIATES.
3+
# SPDX-FileCopyrightText: All rights reserved.
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
18+
# ---------------------------------------------------------------------------
19+
# GeoTransolver template -- SURFACE recipes (DrivAerML and HiLiftAeroML).
20+
# ---------------------------------------------------------------------------
21+
# Bundles the model class, its data contract (input_type / output_type /
22+
# forward_kwargs), and the surface-scale defaults shared by both
23+
# DrivAerML and HiLift surface datasets (small radii / neighbor counts,
24+
# no local-feature path). The forward_kwargs block resolves DomainMesh
25+
# paths into model.forward(): the dataset YAML produces a DomainMesh
26+
# whose `interior` is a Mesh[0, 3] point cloud at the (subsampled)
27+
# surface cell centroids and whose `boundaries.vehicle` is the
28+
# triangulated surface with precomputed cell normals.
29+
#
30+
# Each train_*.yaml overrides `out_dim` (channel count from `targets:`)
31+
# and, for FA variants, `attention_type` and (sometimes) `state_mixing_mode`.
32+
input_type: tensors
33+
output_type: tensors
34+
35+
forward_kwargs:
36+
geometry: interior.points
37+
local_embedding:
38+
- interior.points
39+
- boundaries.vehicle.cell_data.normals
40+
local_positions: interior.points
41+
global_embedding: global_data.U_inf
42+
43+
model:
44+
_target_: physicsnemo.experimental.models.geotransolver.GeoTransolver
45+
out_dim: ${out_dim} # auto-set from the chosen dataset's `targets:` block
46+
functional_dim: 6 # local_embedding = geometry coords (3) + normals (3)
47+
geometry_dim: 3 # point coordinates
48+
global_dim: 3 # inlet velocity (3)
49+
n_layers: 12
50+
n_hidden: 256
51+
dropout: 0.0
52+
n_head: 8
53+
act: "gelu"
54+
mlp_ratio: 4
55+
slice_num: 256
56+
use_te: false
57+
plus: false
58+
include_local_features: false
59+
radii: [0.1, 0.5, 2.0]
60+
neighbors_in_radius: [16, 32, 64]
61+
n_hidden_local: 32
62+
state_mixing_mode: "weighted" # "weighted" (default) or "concat_project"
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# @package _global_
2+
# SPDX-FileCopyrightText: Copyright (c) 2023 - 2026 NVIDIA CORPORATION & AFFILIATES.
3+
# SPDX-FileCopyrightText: All rights reserved.
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
18+
# ---------------------------------------------------------------------------
19+
# GeoTransolver template -- VOLUME recipes for DrivAerML.
20+
# ---------------------------------------------------------------------------
21+
# Multi-scale radii / neighbor counts span the car body to the far
22+
# field; `include_local_features` is on so the model consumes the
23+
# precomputed SDF / SDF-normal channels in interior.point_data. For
24+
# HiLift volumes (much smaller physical scale, no local-feature path),
25+
# use geotransolver_volume_highlift.yaml instead.
26+
#
27+
# The forward_kwargs block resolves DomainMesh paths into
28+
# model.forward(): volume dataset YAMLs produce a DomainMesh whose
29+
# `interior` is the (subsampled) volume mesh carrying both the
30+
# prediction targets and the precomputed SDF inputs in
31+
# `interior.point_data`. The contract is satisfied because the loss
32+
# only extracts target names; non-target fields like `sdf` can be
33+
# referenced as inputs without contaminating the loss.
34+
input_type: tensors
35+
output_type: tensors
36+
37+
forward_kwargs:
38+
geometry: interior.points
39+
local_embedding:
40+
- interior.points
41+
- interior.point_data.sdf
42+
- interior.point_data.sdf_normals
43+
local_positions: interior.points
44+
global_embedding: global_data.U_inf
45+
46+
model:
47+
_target_: physicsnemo.experimental.models.geotransolver.GeoTransolver
48+
out_dim: ${out_dim} # auto-set from the chosen dataset's `targets:` block
49+
functional_dim: 7 # local_embedding = coords (3) + SDF (1) + SDF normals (3)
50+
geometry_dim: 3 # point coordinates
51+
global_dim: 3 # inlet velocity (3)
52+
n_layers: 12
53+
n_hidden: 256
54+
dropout: 0.0
55+
n_head: 8
56+
act: "gelu"
57+
mlp_ratio: 4
58+
slice_num: 256
59+
use_te: false
60+
plus: false
61+
include_local_features: true
62+
radii: [0.01, 0.05, 0.25, 1.0, 2.5, 5.0]
63+
neighbors_in_radius: [8, 16, 32, 32, 64, 128]
64+
n_hidden_local: 32
65+
state_mixing_mode: "weighted" # "weighted" (default) or "concat_project"

0 commit comments

Comments
 (0)