ForkBaidu (ERNIE)Baidu (ERNIE)published Apr 22, 2024seen 5d

PaddlePaddle/modulus-sym

forked from NVIDIA/physicsnemo-sym

Open original ↗

Captured source

source ↗
published Apr 22, 2024seen 5dcaptured 9hhttp 200method plain

PaddlePaddle/modulus-sym

Description: Framework providing pythonic APIs, algorithms and utilities to be used with Modulus core to physics inform model training as well as higher level abstraction for domain experts

Language: Python

License: Apache-2.0

Stars: 1

Forks: 2

Open issues: 0

Created: 2024-04-22T02:33:08Z

Pushed: 2025-04-15T05:26:04Z

Default branch: paddle

Fork: yes

Parent repository: NVIDIA/physicsnemo-sym

Archived: no

README:

Modulus Symbolic (Beta)(Paddle Backend)

> [!IMPORTANT] > This branch(paddle) experimentally supports Paddle backend + CINN compiler > as almost all the core code has been completely rewritten using the Paddle API. > > It is recommended to install nightly-build(develop) Paddle before running any code in this branch.

![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/#active)

Modulus Symbolic (Modulus Sym) provides pythonic APIs, algorithms and utilities to be used with Modulus core, to explicitly physics inform the model training. This includes symbolic APIs for PDEs, domain sampling and PDE-based residuals.

It also provides higher level abstraction to compose a training loop from specification of the geometry, PDEs and constraints like boundary conditions using simple symbolic APIs. Please refer to the Lid Driven cavity that illustrates the concept. Additional information can be found in the Modulus documentation.

Users of Modulus versions older than 23.05 can refer to the migration guide for updating to the latest version.

Installation

Container

The recommended Modulus docker image can be pulled from the NVIDIA Container Registry:

docker pull nvcr.io/nvidia/modulus/modulus:24.04

From Source[Recommended]

Package

For a local build of the Modulus Symbolic Python package from source use:

git clone -b paddle https://github.com/PaddlePaddle/modulus-sym.git && cd modulus-sym

pip install --upgrade pip
pip install .

Source Container

To build release image, you will need to do the below preliminary steps:

Clone this repo, and download the Optix SDK from .

git clone -b paddle https://github.com/PaddlePaddle/modulus-sym.git
cd modulus-sym/ && mkdir deps

Currently Modulus supports v7.0. Place the Optix file in the deps directory and make it executable. Also clone the pysdf library in the deps folder (NVIDIA Internal)

chmod +x deps/NVIDIA-OptiX-SDK-7.0.0-linux64.sh
git clone

Then to build the image, insert next tag and run below:

docker build -t modulus-sym:deploy \
--build-arg TARGETPLATFORM=linux/amd64 --target deploy -f Dockerfile .

Alternatively, if you want to skip pysdf installation, you can run the following:

docker build -t modulus-sym:deploy \
--build-arg TARGETPLATFORM=linux/amd64 --target no-pysdf -f Dockerfile .

Currently only linux/amd64 and linux/arm64 platforms are supported.

Quickly run

Quickly run a simple exmaple: ldc_2d.py with script below.

cd ./examples/ldc/

# run on dynamic(i.e. eager mode) graph mode
python ldc_2d.py

# run on dy2st mode
python ldc_2d.py jit=true jit_use_cinn=false

# run on cinn mode(i.e. compiled mode, recommended for performance)
python ldc_2d.py jit=true

Contributing

For guidance on making a contribution to Modulus, see the contributing guidelines.

Communication

  • Github Discussions: Discuss architectures, implementations, Physics-ML research, etc.
  • GitHub Issues: Bug reports, feature requests, install issues, etc.
  • Modulus Forum: The Modulus Forum

hosts an audience of new to moderate level users and developers for general chat, online discussions, collaboration, etc.

License

Modulus Symbolic is provided under the Apache License 2.0, please see [LICENSE.txt](./LICENSE.txt) for full license text.