File size: 8,956 Bytes
549d36c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
{
"cells": [
{
"cell_type": "markdown",
"id": "528a57dc",
"metadata": {},
"source": [
"## Introduction\n",
"\n",
"Participants will work with the **Ahmed body** benchmark — a canonical problem in automotive aerodynamics — to build a surrogate model. The course blends classical CFD data handling with modern AI-based modeling. \n",
"For the sake of education here we will use only **Ahmed Body Surface data** for training and not volume data. "
]
},
{
"cell_type": "markdown",
"id": "d61bf370",
"metadata": {},
"source": [
"## Course Modules\n",
"\n",
"### 0. [Dataset download](#download-ahmed-body-surface-dataset)\n",
"\n",
"### 1. [Preprocessing Ahmed body dataset for training with DoMINO](domino-data-preprocessing.ipynb)\n",
"- Loading and understanding VTK simulation data\n",
"- Data normalization techniques for ML\n",
"- Extracting key physical quantities\n",
"- Creating standardized datasets for training\n",
"\n",
"### 2. [Training and Inferencing DoMINO Model](domino-training-test.ipynb)\n",
"- Understanding DoMINO architecture and physics-informed learning\n",
"- Training process\n",
"- Load Model Checkpoint & Run Inference\n",
"- Visualizing the predicted results\n",
"\n",
"### Hardware Requirements\n",
"- NVIDIA GPU with CUDA support\n",
"- 4GB+ RAM\n",
"- 100GB+ disk space\n",
"\n",
"### Software Requirements\n",
"- Docker with NVIDIA Container Toolkit\n",
"- NVIDIA Drivers (version 545 or later)\n",
"- SLURM workload manager"
]
},
{
"cell_type": "markdown",
"id": "8643a4d3",
"metadata": {},
"source": [
"## Quick Start Guide\n",
"\n",
"### Course Environment\n",
"This course is set up to use the the PhysicsNeMo docker environment from NVIDIA NGC, and all other additional dependencies are already installed. If you wish to set up the environment outside of this space, the following steps can be used, but note, they are not necessary for this HuggingFace Space.\n",
"\n",
"### Required Setup Steps\n",
"The only required step is to pull the dataset from NVIDIA NGC.\n",
"\n",
"#### Download Ahmed Body surface dataset\n",
"\n",
"The complete Ahmed body surface dataset is hosted on NGC and accessible from the following link:\n",
"\n",
"https://catalog.ngc.nvidia.com/orgs/nvidia/teams/physicsnemo/resources/physicsnemo_ahmed_body_dataset\n",
"\n",
"The data can be downloaded using the NVIDIA NGC cli. Please note that the dataset contains VTP files, but training DoMINO and X-MeshGraphNet also requires STL files. Therefore, in the `domino-data-preprocessing.ipynb` notebook, STL files are extracted from the available VTP data.\n",
"\n",
"The data should be available in this space already at \"/data/physicsnemo_ahmed_body_dataset_vv1\". If it is not, we can download it again:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "99acc658",
"metadata": {
"vscode": {
"languageId": "plaintext"
}
},
"outputs": [],
"source": [
"!if [ ! -d \"/data/physicsnemo_ahmed_body_dataset_vv1\" ]; then \\\n",
" echo \"Dataset not found. Downloading...\"; \\\n",
" ~/app/ngc-cli/ngc registry resource download-version \"nvidia/physicsnemo/physicsnemo_ahmed_body_dataset:v1\" --dest /data; \\\n",
"else \\\n",
" echo \"Dataset already exists at /data/physicsnemo_ahmed_body_dataset_vv1\"; \\\n",
"fi"
]
},
{
"cell_type": "markdown",
"id": "93554844",
"metadata": {},
"source": [
"### Optional Steps for Standalone Environment Setup\n",
"\n",
"The next set of steps are only necessary if you would like to rebuild the environment outside of HuggingFace Spaces.\n",
"\n",
"Once the dataset is downloaded, you man procede to [domino-data-preprocessing.ipynb](domino-data-preprocessing.ipynb)!"
]
},
{
"cell_type": "markdown",
"id": "0086ae4a",
"metadata": {},
"source": [
"#### Setting your environment to pull the PhysicsNeMo container from NGC:\n",
"\n",
"Please refer to the following link for instructions on setting up your environment to pull the PhysicsNeMo container from NGC:\n",
"https://docs.nvidia.com/launchpad/ai/base-command-coe/latest/bc-coe-docker-basics-step-02.html\n",
"\n",
"\n",
"#### Running PhysicsNeMo container using docker command\n",
"\n",
"Pull the PhysicsNeMo container with the following command:\n",
"```bash\n",
"docker pull nvcr.io/nvidia/physicsnemo/physicsnemo:25.06\n",
" ```\n",
"\n",
"To launch the PhysicsNeMo container using docker, use the following command:\n",
"\n",
"```bash\n",
"docker run --gpus 1 --shm-size=2g -p 7008:7008 --ulimit memlock=-1 --ulimit stack=67108864 --runtime nvidia -v <path_on_host>:/workspace -it --rm $(docker images | grep 25.03| awk '{print $3}')\n",
" \n",
"```\n",
"\n",
"Make sure to replace <path_on_host> with the absolute path to the directory on the host system that contains your Jupyter notebooks and Ahmed Body surface data. This path will be mounted as `/workspace` inside the container, providing access to your data and scripts during the session\n",
"\n",
"#### Start Jupyter Lab\n",
"\n",
"From the terminal inside the container run the following command to start Jupyter Lab in the background:\n",
"\n",
"```bash\n",
"nohup python3 -m jupyter lab --ip=0.0.0.0 --port=7008 --allow-root --no-browser --NotebookApp.token='' --notebook-dir='/workspace/' --NotebookApp.allow_origin='*' > /dev/null 2>&1 &\n",
"```\n",
"\n",
"Then from your labtop start a SSH tunnel using the host which your job is running and the port which you assigned above `--port=1234`: \n",
"\n",
"```bash\n",
"ssh -L 3030:eos0311:7008 eos\n",
"```\n",
"Access Jupyter Lab using `http://localhost:1234` in your browser. \n",
"\n",
"#### Dependencies\n",
"\n",
"Please install the following in the container.\n",
"```bash\n",
"pip install numpy pyvista vtk matplotlib tqdm numpy-stl torchinfo\n",
"apt install xvfb\n",
"```"
]
},
{
"cell_type": "markdown",
"id": "cc765d6a",
"metadata": {},
"source": [
"## Troubleshooting\n",
"\n",
"### Common Issues\n",
"\n",
"1. **Memory Issues**\n",
" - Monitor GPU memory: `nvidia-smi`\n",
" - Check system memory: `free -h`\n",
"\n",
"2. **GPU Support**\n",
"\n",
" - Run the following command to verify your container runtime supports NVIDIA GPUs:\n",
"\n",
"```bash\n",
"docker run --rm --runtime=nvidia --gpus all ubuntu nvidia-smi\n",
"```\n",
"\n",
"Expected output should show your GPU information, for example:\n",
"```\n",
"+-----------------------------------------------------------------------------------------+\n",
"| NVIDIA-SMI 560.35.03 Driver Version: 560.35.03 CUDA Version: 12.6 |\n",
"|-----------------------------------------+------------------------+----------------------+\n",
"| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |\n",
"| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |\n",
"| | | MIG M. |\n",
"|=========================================+========================+======================|\n",
"| 0 NVIDIA A100-PCIE-40GB Off | 00000000:41:00.0 Off | 0 |\n",
"| N/A 37C P0 35W / 250W | 40423MiB / 40960MiB | 0% Default |\n",
"| | | Disabled |\n",
"+-----------------------------------------+------------------------+----------------------+\n",
"```\n",
"\n",
"## Additional Resources\n",
"\n",
"- [NVIDIA Physics NeMo Documentation](https://docs.nvidia.com/deeplearning/nemo-physics/user-guide)\n",
"- [PyVista Documentation](https://docs.pyvista.org/) for 3D visualization\n",
"- [Ahmed Body Benchmark](https://www.cfd-online.com/Wiki/Ahmed_body) for background\n",
"- [Physics-Informed Neural Networks](https://www.sciencedirect.com/science/article/abs/pii/S0021999118307125) paper\n",
"- [Graph Neural Networks](https://arxiv.org/abs/2106.10943) for scientific computing\n",
"- [Neural Operators](https://arxiv.org/abs/2108.08481) for PDEs\n",
"- [DGL Documentation](https://www.dgl.ai/) for graph neural networks\n",
"- [Triton Inference Server](https://github.com/triton-inference-server/server) for deployment\n"
]
}
],
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
|