-
Notifications
You must be signed in to change notification settings - Fork 645
Pnm mesh datapipes #1512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
coreyjadams
wants to merge
36
commits into
NVIDIA:main
Choose a base branch
from
coreyjadams:pnm_mesh_datapipes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Pnm mesh datapipes #1512
Changes from 34 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
2b1f535
Adding mesh datapipe temporarily
coreyjadams 132d72a
first, very early, draft of mesh-based datapipe
coreyjadams 8987172
Update datapipes for physicsnemo mesh: now can read and transform sur…
coreyjadams aeb8c06
Add a functionally working - but not yet cxonverging - xaero recipe
coreyjadams 6459144
Add functional physicsnemo mesh pipeline
coreyjadams 5821b15
Update README
coreyjadams 0da2cd1
Snapshotting training recipe
coreyjadams f5cb9bc
Merge branch 'NVIDIA:main' into pnm_mesh_datapipes
coreyjadams 42740e8
Remove Ahmed dataset with physicsnemo mesh, it's not needed.
coreyjadams beb2da0
Simplify and consolidate, or remove statistics work for this example.
coreyjadams 36d3365
Remove inspect_data, and ensure readme is updated
coreyjadams f7e77be
Remove AGENT.md
coreyjadams 6977270
Training recipe is basically complete
coreyjadams 5db9027
Merge branch 'main' into pnm_mesh_datapipes
coreyjadams bb9e995
Merge branch 'main' into pnm_mesh_datapipes
coreyjadams 0c5d58e
Merge branch 'main' into pnm_mesh_datapipes
coreyjadams b669aa7
Update physicsnemo/datapipes/readers/mesh.py
coreyjadams e8ef574
Update physicsnemo/datapipes/transforms/mesh/transforms.py
coreyjadams 5493428
Update physicsnemo/datapipes/readers/mesh.py
coreyjadams 70e806b
Addressing some PR comments.
coreyjadams 0c21bb1
make sure rotations are flexible, add docstrings
coreyjadams 1277d3d
Update distribution handling per PR review.
coreyjadams c8370d2
Merge branch 'NVIDIA:main' into pnm_mesh_datapipes
coreyjadams 492892a
Merge branch 'NVIDIA:main' into pnm_mesh_datapipes
coreyjadams 93b10d1
This commit enablers the datapipes to be reproducible
coreyjadams 4a13b3e
Add testing for the datapipes
coreyjadams d7d2e01
Add missing rng updates
coreyjadams 1fea170
Update training python codes
coreyjadams 53069e2
Add geotransolver configs with obscured paths
coreyjadams aa8cced
Remove shift suv configs for now
coreyjadams c5b8e6d
Merge branch 'main' into pnm_mesh_datapipes
coreyjadams 7b79c58
Adding configs for flare and geotransolver with a flare backend.
coreyjadams d77b582
Update README.md
coreyjadams 6189fe5
Add datapipes.md. Describes some of the computational design of the d…
coreyjadams 957d6c3
Update datapipes to use non-blocking stream syncs when streams are ac…
coreyjadams 019e46b
Fix cuda memory access errors arising from incorrect fake tensor ops.…
coreyjadams File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| CODE_OF_CONDUCT.md | ||
| physicsnemo/datapipes/transforms/mesh/DISTRIBUTIONS.md |
11 changes: 11 additions & 0 deletions
11
examples/cfd/external_aerodynamics/unified_external_aero_recipe/.gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| *.sh | ||
| runs/ | ||
| mlruns/ | ||
| *.err | ||
| *.out | ||
| outputs/ | ||
| stats/ | ||
| checkpoints/ | ||
| *.mdlus | ||
| *.tfevents* | ||
| *.parquet |
537 changes: 537 additions & 0 deletions
537
examples/cfd/external_aerodynamics/unified_external_aero_recipe/README.md
Large diffs are not rendered by default.
Oops, something went wrong.
89 changes: 89 additions & 0 deletions
89
...d/external_aerodynamics/unified_external_aero_recipe/conf/dataset/drivaer_ml_surface.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2023 - 2026 NVIDIA CORPORATION & AFFILIATES. | ||
| # SPDX-FileCopyrightText: All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # DrivaerML surface dataset | ||
| # Reads the boundary surface Mesh directly from DomainMesh .pdmsh files | ||
| # by navigating into the on-disk tensordict directory structure. | ||
| # Triangulated surface mesh. Fields live in cell_data. | ||
| # Splits are controlled by manifest.json + train_split/val_split in the training config. | ||
|
|
||
| name: drivaer_ml_surface | ||
|
|
||
| train_datadir: /lustre/fsw/portfolios/coreai/projects/coreai_modulus_cae/datasets/PhysicsNeMo-DrivaerML/ | ||
|
|
||
| metadata: | ||
| U_inf: [30.0, 0.0, 0.0] # freestream velocity | ||
| p_inf: 0.0 # reference pressure, drivaerml is gauge pressure | ||
| rho_inf: 1.225 # freestream density | ||
| nu: 1 | ||
| L_ref: 5.0 # reference length [m] | ||
|
|
||
| pipeline: | ||
| reader: | ||
| _target_: ${dp:MeshReader} | ||
| path: ${train_datadir} | ||
| pattern: "**/*.pdmsh/_tensordict/boundaries/surface" | ||
| subsample_n_cells: ${sampling_resolution} | ||
| augmentations: | ||
| - _target_: ${dp:RandomRotateMesh} | ||
| axes: ["z"] | ||
| transform_cell_data: true | ||
| transform_global_data: true | ||
| - _target_: ${dp:RandomTranslateMesh} | ||
| distribution: | ||
| _target_: torch.distributions.Uniform | ||
| low: [-1.0, -1.0, 0.0] | ||
| high: [1.0, 1.0, 0.0] | ||
| transforms: | ||
| - _target_: ${dp:DropMeshFields} | ||
| global_data: [TimeValue] | ||
| - _target_: ${dp:CenterMesh} | ||
| use_area_weighting: false | ||
| - _target_: ${dp:NonDimensionalizeByMetadata} | ||
| fields: | ||
| pMeanTrim: pressure | ||
| wallShearStressMeanTrim: stress | ||
| section: cell_data | ||
| - _target_: ${dp:RenameMeshFields} | ||
| cell_data: | ||
| pMeanTrim: pressure | ||
| wallShearStressMeanTrim: wss | ||
| - _target_: ${dp:NormalizeMeshFields} | ||
| section: cell_data | ||
| fields: | ||
| wss: {type: vector, mean: [0.0, 0.0, 0.0], std: 0.00313} | ||
| - _target_: ${dp:ComputeSurfaceNormals} | ||
| store_as: cell_data | ||
| field_name: normals | ||
| - _target_: ${dp:SubsampleMesh} | ||
| n_cells: ${sampling_resolution} | ||
| - _target_: ${dp:MeshToTensorDict} | ||
| - _target_: ${dp:ComputeCellCentroids} | ||
| - _target_: ${dp:RestructureTensorDict} | ||
| groups: | ||
| input: | ||
| points: cell_centroids | ||
| normals: cell_data.normals | ||
| U_inf: global_data.U_inf | ||
| output: | ||
| pressure: cell_data.pressure | ||
| wss: cell_data.wss | ||
|
|
||
| targets: | ||
| pressure: scalar | ||
| wss: vector | ||
|
|
||
| metrics: [l1, l2, mae] | ||
100 changes: 100 additions & 0 deletions
100
...fd/external_aerodynamics/unified_external_aero_recipe/conf/dataset/drivaer_ml_volume.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2023 - 2026 NVIDIA CORPORATION & AFFILIATES. | ||
| # SPDX-FileCopyrightText: All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # DrivaerML volume dataset (DomainMesh) | ||
| # Loads domain_*.pmsh files containing interior volume mesh + surface boundary + global_data. | ||
| # Interior: tetrahedral volume mesh with fields in point_data. | ||
| # Boundary: triangulated surface mesh ("surface"). | ||
| # global_data: U_inf, rho_inf (baked into .pmsh); p_inf, nu, L_ref injected from metadata below. | ||
| # Splits are controlled by manifest.json + train_split/val_split in the training config. | ||
|
|
||
| name: drivaer_ml_volume | ||
|
|
||
| train_datadir: /lustre/fsw/portfolios/coreai/projects/coreai_modulus_cae/datasets/PhysicsNeMo-DrivaerML/ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Accidental paths? |
||
|
|
||
| metadata: | ||
| U_inf: [30.0, 0.0, 0.0] # freestream velocity | ||
| p_inf: 0.0 # reference pressure, drivaerml is gauge pressure | ||
| rho_inf: 1.225 # freestream density | ||
| nu: 1 | ||
| L_ref: 5.0 # reference length [m] | ||
|
|
||
| pipeline: | ||
| reader: | ||
| _target_: ${dp:DomainMeshReader} | ||
| path: ${train_datadir} | ||
| pattern: "**/domain_*.pdmsh" | ||
| subsample_n_points: ${sampling_resolution} | ||
| subsample_n_cells: ${sampling_resolution} | ||
| extra_boundaries: | ||
| stl_geometry: | ||
| pattern: "*_single_solid.stl.pmsh" | ||
| augmentations: | ||
| - _target_: ${dp:RandomRotateMesh} | ||
| axes: ["z"] | ||
| transform_point_data: true | ||
| transform_global_data: true | ||
| - _target_: ${dp:RandomTranslateMesh} | ||
| distribution: | ||
| _target_: torch.distributions.Uniform | ||
| low: [-1.0, -1.0, 0.0] | ||
| high: [1.0, 1.0, 0.0] | ||
| transforms: | ||
| - _target_: ${dp:DropMeshFields} | ||
| global_data: [TimeValue] | ||
| - _target_: ${dp:CenterMesh} | ||
| use_area_weighting: false | ||
| - _target_: ${dp:NonDimensionalizeByMetadata} | ||
| fields: | ||
| UMeanTrim: velocity | ||
| pMeanTrim: pressure | ||
| nutMeanTrim: identity | ||
| section: point_data | ||
| - _target_: ${dp:ComputeSDFFromBoundary} | ||
| boundary_name: stl_geometry | ||
| sdf_field: sdf | ||
| normals_field: sdf_normals | ||
| use_winding_number: true | ||
| - _target_: ${dp:DropBoundary} | ||
| names: [stl_geometry] | ||
| - _target_: ${dp:RenameMeshFields} | ||
| point_data: | ||
| UMeanTrim: velocity | ||
| pMeanTrim: pressure | ||
| nutMeanTrim: nut | ||
| - _target_: ${dp:NormalizeMeshFields} | ||
| section: point_data | ||
| fields: | ||
| nut: {type: scalar, mean: 4.8e-4, std: 9.4e-4} | ||
| - _target_: ${dp:MeshToTensorDict} | ||
| - _target_: ${dp:RestructureTensorDict} | ||
| groups: | ||
| input: | ||
| points: interior.points | ||
| U_inf: global_data.U_inf | ||
| sdf: interior.point_data.sdf | ||
| sdf_normals: interior.point_data.sdf_normals | ||
| output: | ||
| velocity: interior.point_data.velocity | ||
| pressure: interior.point_data.pressure | ||
| nut: interior.point_data.nut | ||
|
|
||
| targets: | ||
| velocity: vector | ||
| pressure: scalar | ||
| nut: scalar | ||
|
|
||
| metrics: [l1, l2, mae] | ||
108 changes: 108 additions & 0 deletions
108
...cfd/external_aerodynamics/unified_external_aero_recipe/conf/dataset/highlift_surface.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2023 - 2026 NVIDIA CORPORATION & AFFILIATES. | ||
| # SPDX-FileCopyrightText: All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # High-lift airplane surface dataset (compressible) | ||
| # Reads the boundary surface Mesh directly from DomainMesh .pdmsh files | ||
| # by navigating into the on-disk tensordict directory structure. | ||
| # Boundary mesh from HiLiftAeroML. Fields live in point_data. | ||
| # Splits are controlled by manifest.json + train_split/val_split in the training config. | ||
|
|
||
| name: highlift_surface | ||
|
|
||
| train_datadir: /lustre/fsw/portfolios/coreai/projects/coreai_modulus_cae/datasets/PhysicsNeMo-HighLiftAeroML/ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Accidental paths? |
||
|
|
||
| # Freestream conditions — slug-inch-second-Rankine unit system | ||
| metadata: | ||
| U_inf: [2672.95, 0.0, 186.92] # 2679.505 in/s at AoA=4° | ||
| p_inf: 176.352 # 14.696 psi × 12 → slug/(in·s²) | ||
| rho_inf: 1.3756e-6 # 0.002377 slug/ft³ → slug/in³ | ||
| T_inf: 518.67 # [°R] | ||
| L_ref: 1156.75 # [in] — span | ||
|
|
||
| pipeline: | ||
| reader: | ||
| _target_: ${dp:MeshReader} | ||
| path: ${train_datadir} | ||
| pattern: "**/*.pdmsh/_tensordict/boundaries/boundary" | ||
| subsample_n_cells: ${sampling_resolution} | ||
| augmentations: | ||
| - _target_: ${dp:RandomRotateMesh} | ||
| axes: ["z"] | ||
| transform_point_data: true | ||
| transform_global_data: true | ||
| - _target_: ${dp:RandomTranslateMesh} | ||
| distribution: | ||
| _target_: torch.distributions.Uniform | ||
| low: [-1.0, -1.0, 0.0] | ||
| high: [1.0, 1.0, 0.0] | ||
| transforms: | ||
| - _target_: ${dp:CenterMesh} | ||
| use_area_weighting: false | ||
| - _target_: ${dp:NonDimensionalizeByMetadata} | ||
| fields: | ||
| PROJ(AVG(P)): pressure | ||
| PROJ(AVG(T)): temperature | ||
| PROJ(AVG(RHO)): density | ||
| PROJ(AVG(U)): velocity | ||
| AVG(TAU_WALL): stress | ||
| section: point_data | ||
| - _target_: ${dp:RenameMeshFields} | ||
| point_data: | ||
| PROJ(AVG(P)): pressure | ||
| PROJ(AVG(T)): temperature | ||
| PROJ(AVG(RHO)): density | ||
| PROJ(AVG(U)): velocity | ||
| AVG(TAU_WALL): tau_wall | ||
| # z-score normalization (dataset-wide stats, 180 cases / 24B points) | ||
| # Stats are post-nondimensionalization values. | ||
| - _target_: ${dp:NormalizeMeshFields} | ||
| section: point_data | ||
| fields: | ||
| pressure: {type: scalar, mean: -0.26, std: 0.62} | ||
| temperature: {type: scalar, mean: 1.004, std: 0.00224} | ||
| density: {type: scalar, mean: 0.988, std: 0.0156} | ||
| velocity: {type: vector, mean: [0.413, -0.005, 0.029], std: 0.20} | ||
| tau_wall: {type: scalar, mean: 0.005068, std: 0.003735} | ||
| # Full subsampling before normals: subsample cells first, then points | ||
| # to the final count. Normals are computed on the surviving triangles. | ||
| - _target_: ${dp:SubsampleMesh} | ||
| n_cells: 500000 | ||
| n_points: ${sampling_resolution} | ||
| - _target_: ${dp:ComputeSurfaceNormals} | ||
| store_as: point_data | ||
| field_name: normals | ||
| - _target_: ${dp:MeshToTensorDict} | ||
| - _target_: ${dp:RestructureTensorDict} | ||
| groups: | ||
| input: | ||
| points: points | ||
| normals: point_data.normals | ||
| U_inf: global_data.U_inf | ||
| output: | ||
| pressure: point_data.pressure | ||
| temperature: point_data.temperature | ||
| density: point_data.density | ||
| velocity: point_data.velocity | ||
| tau_wall: point_data.tau_wall | ||
|
|
||
| targets: | ||
| pressure: scalar | ||
| temperature: scalar | ||
| density: scalar | ||
| velocity: vector | ||
| tau_wall: scalar | ||
|
|
||
| metrics: [l1, l2, mae] | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accidental paths?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I had these purged, and then I broke all my training scripts. Arg.