Nvidia Modulus Symbolic (Modulus Sym)
Nvidia Modulus
NVIDIA Modulus blendsbrings together the world of physics, aswhich expressedinvolves byspecial governing partial differentialmath equations (known as PDEs), boundaryalong conditions,with information about boundaries and training datadata. This combination is used to buildcreate high-fidelity,advanced, parameterized,customizable, surrogatepretend models using deep learning models.learning. The platform abstractstakes away the complexitycomplicated ofsetup settingprocess up a scalablefor training pipeline,these models, so you can leverageuse your domainexpertise expertisein a particular field to mapguide problemsthe creation of smart models and design improved ways for computers to anunderstand AIthings. model’sThere trainingare andalso developexamples betteravailable neuralthat networkcan architectures.help Availableyou referenceget applicationstarted serveon as a great starting point for applyingusing the same principlesideas tofor new use cases.situations.
WhetherIf you’you're a researcher lookingaiming to developcreate novelnew AI-basedAI approachesmethods for reimagininginnovative engineering and scientific simulationssimulations, or you’if you're an engineer lookingseeking to acceleratespeed up design optimizationimprovements and digital twin applications, the Modulus platform canis supporta valuable resource for advancing your model development. Modulus offersprovides a varietyrange of approachestechniques forto training physics-basedtrain neural network models,models frombased purelyon physics-drivenphysics principles. These approaches include models withsolely driven by physics, which integrate physics knowledge through physics-informed neural networks (PINNs), toas well as models that blend physics concepts with real-world data, like the physics-based,oriented, data-driven architecturesdesigns suchseen asin neural operators.
Modulus has been rearchitected into modules:architecture:
Modulus Core isforms the basefoundational modulemodule, thatincorporating consists of the coreessential components of the framework necessary for developingcreating Physics-ML modelsmodels.
Modulus Sym providesintroduces an abstraction layer fordesigned usingto facilitate the utilization of PDE-based symbolic loss functionsfunctions.
Modulus Launch provides optimized training recipes for data driven Physics-ML modelsmodels.
Setting up Nvidia Modulus Sym in OAsis
In this guide, we'll use Modulus Sym as an illustrative example.
Login into OAsis, select "TERMINAL"
Execute the following commands:
# create job with gpu resource
srun -p gpu --cpus-per-task=4 --mem=16G --gres=gpu:3g.40gb:1 --pty bash
# load required modules
module load Anaconda3/2022.05
module load CUDA/12.1.0
module load GCCcore/11.3.0 git/2.36.0-nodocs
module load git-lfs/3.2.0
# create conda environment with python version 3.8
conda create -n modulus-symbolic python=3.8 anaconda
source activate modulus-symbolic
# install required package in "modulus-symbolic" conda environment
conda install pip ipykernel
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
pip install blosc2==2.0.0 cython protobuf pyqtwebengine pyqt5 blosc2 lit cmake nvidia-modulus.sym tensorboard
After successfully setting up the conda environment, you can load the module and activate the environment effortlessly by following commands:
module load Anaconda3/2022.05
module load CUDA/12.1.0
source activate modulus-symbolic
Clone the source code and run an example.
cd $HOME
git clone https://github.com/NVIDIA/modulus-sym.git
cd $HOME/modulus-sym/examples/chip_2d/
python chip_2d.py
# To reduce the training time, you can adjust the max_steps parameter in the conf/config.yaml file to a lower value, such as 5000.
# This change will limit the number of training steps the model undergoes, thereby speeding up the training process.
Edit the conf/cconfig.yaml file according to adjust the traning max_steps.
Finished Training .
Examine the trained model using the TensorBoard Web UI.
# type following command to bind hostname, port to tensorboard
host=$(hostname)
port=$(hc acquire-port -j $SLURM_JOB_ID -u web --host $host -l TensorBoard)
# you can edit logdir to other directory
tensorboard --logdir . --host $host --port $port
Click the "TensorBoard" button to access the web-based user interface.
Navigate to the "SCALARS" tab to delve into comprehensive training insights.
This tutorial elucidates how to set up and utilize Nvidia Modulus Sym within the OAsis platform, showcasing the potential of merging physics and AI to achieve exceptional model performance.