NVIDIA PhysicsNeMo

repository·main·Indexed 25 days ago

https://github.com/nvidia/physicsnemo

An open-source deep-learning framework for building and training Physics AI models, targeting AI4Science and engineering through SciML methods. The framework includes tools for multi-physics systems, active learning loops with configurable query and labeling strategies, and specialized examples such as Surface-CFD and Virtual Foundry GraphNet for metal sintering deformation prediction.

Tokens
173.8K
Snippets
488
Records
934
Agent score
85%

What's inside nvidia-physicsnemo

  1. Overview of Lid Driven Cavity Flow PINN Example

    main

    This example demonstrates how to solve Lid Driven Cavity (LDC) flow using purely physics-driven models. It showcases the interoperability between nvidia-physicsnemo, physicsnemo.sym, and torch.

    Key workflows demonstrated:

    • Using physicsnemo.sym geometry and physics utilities in custom PyTorch training pipelines.
    • Handling geometry objects (CAE workflows).
    • Explicitly defining physics residual and boundary condition losses.
    • Generating geometry via physicsnemo.mesh and sampling point clouds using GeometryDatapipe.
    • Computing physics losses using PhysicsInformer from physicsnemo.sym.

    Note: This example uses an explicit style for defining constraints and losses. If you are migrating from the archived physicsnemo-sym repository, you should refer to the PhysicsNeMo v2.0 Migration Guide for mapping Solver, Domain, and Constraint abstractions to this new explicit style.

  2. Overview of Unified External Aerodynamics Recipe Modules

    main

    The Unified External Aerodynamics recipe is composed of several specialized modules in src/ that handle the end-to-end pipeline from data loading to inference:

    • Data Handling: datasets.py provides factory functions (build_dataset, load_dataset_config, build_dataloaders) to assemble loaders and samplers. It uses Hydra to instantiate readers and transforms from YAML.
    • Physics & Transforms: nondim.py implements NonDimensionalizeByMetadata for physics-based scaling (pressure, stress, velocity, etc.). output_normalize.py handles statistical normalization.
    • Model Interface: forward_kwargs.py resolves declarative forward_kwargs: specs into actual model.forward() arguments. collate.py handles batching and target extraction.
    • Loss & Metrics: loss.py provides LossCalculator (Huber, MSE, relative MSE) and metrics.py provides MetricCalculator (relative L1, L2, MAE).
    • Aerodynamics: forces.py calculates aerodynamic force/moment coefficients (CD, CL, CM) by integrating traction over the vehicle mesh.
    • Execution: train.py manages the DDP training loop with mixed precision and logging, while infer.py handles checkpoint loading and physical-unit prediction output.
  3. Overview of DoMINO for External Aerodynamics

    main

    DoMINO (Decomposable Multi-scale Iterative Neural Operator) is a local, multi-scale, point-cloud based model architecture designed for large-scale physics problems like external aerodynamics.

    Key Capabilities:

    • Inputs: Takes STL geometries as input.
    • Outputs: Evaluates flow quantities such as pressure and wall shear stress on surfaces, and velocity fields and pressure in the surrounding volume.
    • Architecture: Uses a global geometry encoding (via multi-scale iterative approach with SDF and positional encoding) followed by local geometry encoding using dynamic point convolution kernels to predict solutions on discrete points via a dynamically constructed computational stencil.
  4. Overview of Mixture of Weather Experts (MoWE)

    main

    The Mixture of Weather Experts (MoWE) framework combines forecasts from multiple state-of-the-art weather models (such as Aurora, Pangu-Weather, and FCN3) into a single, more accurate prediction. It uses a gating network to learn optimal weights ($W_i$) and a bias ($b$) for each expert's forecast ($E_i$), synthesizing the final forecast ($\hat{Y}$) via a weighted sum: $\hat{Y} = \sum_{i=1}^{N} (W_i \cdot E_i) + b$.

    There are two model variants:

    • Deterministic: Produces a single best estimate.
    • Probabilistic: Models uncertainty via ensemble predictions using a noise vector.

    Note: The underlying Diffusion Transformer (DiT) architecture is experimental and subject to change.

  5. Overview of Discrete Calculus on Simplicial Meshes

    main

    The physicsnemo.mesh.calculus module provides differential operators (gradient, divergence, curl, Laplacian) for simplicial meshes using two distinct mathematical approaches:

    1. Discrete Exterior Calculus (DEC): A mathematically rigorous framework based on differential geometry that satisfies exact discrete versions of continuous theorems like Stokes and Gauss-Bonnet. Best for geometric rigor.
    2. Weighted Least-Squares (LSQ): A practical approach for general CFD/FEM use cases that works robustly on arbitrary meshes. Best for general-purpose engineering applications.
  6. Overview of NVIDIA PhysicsNeMo

    main
    NVIDIA PhysicsNeMo is an open-source deep-learning framework designed for building, training, fine-tuning, and inferring Physics AI models. It utilizes state-of-the-art Scientific Machine Learning (SciML) methods for AI4Science and engineering applications. The framework allows developers to combine physics knowledge with data to enable real-time predictions using architectures like Neural Operators, Graph Neural Networks (GNNs), Transformers, and Physics-Informed Neural Networks (PINNs).
  7. Overview of Transformer Models for External Aerodynamics

    main

    This directory provides training and inference recipes for transformer-based surrogate models designed for CFD applications on irregular meshes. It supports two primary model architectures:

    • Transolver: A high-performance surrogate model that uses a modified PhysicsAttention mechanism to map functional input spaces to output spaces with high fidelity. It is optimized for numerical stability and NVIDIA TransformerEngine compatibility.
    • GeoTransolver: An evolution of Transolver that uses GALE (Geometry-Aware Latent Embeddings) attention. It combines physics-aware self-attention with cross-attention to geometry and global context embeddings, making it particularly effective for capturing fine-grained near-boundary behavior and far-field interactions on large, irregular discretizations.
  8. Overview of DoMINO-Automotive-Aero NIM Fine-tuning

    main

    This recipe implements a predictor-corrector approach for fine-tuning the DoMINO-Automotive-Aero NIM for automotive CFD simulations. Instead of training from scratch, it uses a pre-trained model (the Predictor) with frozen weights to provide baseline predictions, and a lightweight, trainable network (the Corrector) to learn dataset-specific refinements.

    Mathematical Formulation: Y_finetuned = Y_predictor + Y_corrector

    Key Benefits:

    • Accelerated Training: Faster convergence by leveraging pre-trained weights.
    • Smart Transfer Learning: Efficient adaptation to new vehicle configurations and boundary conditions.
    • Modular Design: Easy customization of both predictor and corrector components.
  9. Overview of GLOBE architecture

    main

    GLOBE (Green's-function-Like Operator for Boundary Element PDEs) is an experimental architecture designed for solving Partial Differential Equations (PDEs) using a boundary element approach. It represents the solution as a linear combination of learnable kernel functions evaluated from boundary source faces to target points.

    Suitable PDE Problems

    GLOBE is intended for PDEs with these properties:

    • Behavior is primarily driven by boundary conditions (specifically boundary geometry).
    • The PDE is elliptic (requires global information propagation).
    • Engineering quantities of interest are located on or near the boundary.
    • The PDE is linear or can be approximated as linear.

    Mathematical Invariants

    Without retraining, the model maintains several properties:

    • Translation-equivariant: Predictions follow translations of the problem setup.
    • Rotation-equivariant: Predictions follow rotations of the problem setup (also invariant to in-plane rotations of boundary mesh faces).
    • Discretization-invariant: Predictions remain stable in the fine-mesh limit when the boundary mesh is uniformly decimated.
    • Parity-equivariant: Predictions follow reflections across a plane.
    • Units-invariant: Predictions remain consistent across different physical scales if the reference_lengths argument is used correctly.
    • Physical Prior: The model incorporates a $1/r^2$ (3D) or $1/r$ (2D) influence decay prior.
  10. Overview of PhysicsNeMo-Mesh features

    main

    PhysicsNeMo-Mesh is a PyTorch-based library for working with simplicial meshes (point clouds, curves, surfaces, volumes) in a unified, dimensionally-generic framework.

    Key capabilities include:

    • GPU-Acceleration: All operations are vectorized with PyTorch and run natively on CUDA.
    • Dimensional Genericity: Supports n-D manifolds embedded in m-D spaces.
    • TensorDict Integration: Uses structured data management with automatic device handling.
    • Differentiability: Integrates seamlessly with PyTorch autograd for physics-informed ML.
    • Flexible Data: Supports arbitrary-rank tensor fields on points, cells, or globally.
  11. Overview of PhysicsNeMo DataPipes

    main

    PhysicsNeMo DataPipes are designed for Scientific Machine Learning (SciML) applications where datasets consist of large, high-resolution examples. Unlike standard CPU-centric data loaders (like the default PyTorch DataLoader), PhysicsNeMo uses a GPU-first approach to maximize throughput and prevent GPU pipeline stalls during preprocessing.

    Key design principles include:

    • GPU-first: Offloads preprocessing (augmentation, normalization, etc.) to the GPU.
    • Threading over Multiprocessing: Uses asynchronous execution and stream-based parallelism on the GPU rather than spawning multiple CPU processes, avoiding GIL-related bottlenecks.
    • Unambiguous Configuration: Supports instantiation from hydra YAML files, allowing data pipelines to be serialized and version-controlled.
    • Familiar Interfaces: Designed as drop-in replacements for PyTorch DataLoaders and compatible with tools like DistributedSampler and torchvision-style transformation chaining.
    • Extensibility: Supports custom readers for new data formats and custom transforms via a built-in registry.
  12. Overview of Multi-Diffusion for Large Spatial Domains

    main

    Multi-diffusion is a technique used to scale diffusion models to spatial domains that are too large to be processed in a single pass due to GPU memory constraints. This is particularly useful for large-scale physics-AI and scientific machine learning applications (e.g., weather or CFD) where grids can reach billions of points.

    Key concepts:

    • Mechanism: The full domain is split into smaller patches. The model runs on these patches, and they are fused back into a globally coherent result when necessary.
    • Trade-off: It trades GPU parallelism (and thus throughput) for memory efficiency. It allows training and sampling on domains up to 64x larger in pixels than a standard full-domain pipeline.
    • Compatibility: Multi-diffusion utilities are opt-in wrappers that are fully compatible with existing PhysicsNeMo diffusion components like noise schedulers, samplers, solvers, and preconditioners.