Commit 3f8b350
Multi-res grid refinement + Neon backend support (#159)
* WIP
* Single level working, multi-level runtime error: not enough resources
* WIP: recursive
* Refactoring.
* WIP
* Debugging
* LDC
* WIP
* Improving GPU utilization.
* Printing stats.
* Printing stats.
* Printing stats.
* Printing stats.
* Printing stats.
* Cleaning.
* Cleaning.
* Fusion
* Fusion
* clean up and removing deprecated odd/even approach
* added dGrid and mGrid handling in indices masker
* Update test
* Added a multires_boundary_masker and made sure results are correct.
* Added KBC to the Neon backend
* renamed some files and classes
* added Neon backend to a couple BCs
* converted missing mask from boolean to uint8 everywhere.
* Heavily relying on existing warp functionals for the Neon backend of operators
* added back post-collision apply_bc and the results are correct.
* WIP: extrapolation outflow in Neon
* added neon_apply_aux_recovery_bc, used center_index and more refactoring
* Always using Warp backend when creating bc helper class to support Neon as well.
* fixed a bug
* Compelted Encoding/Decoding of BC aux data for ZouHe/Regularized for Multires
* addressed PR review
* Added capability to handle BC profiles in MRES
* Reduced register pressure by avoiding reading f1_thread for all cells
* fixed BC profile handling for Neon dense
* The container should loop over all levels not the call to the container
* no need to have separate functions for initializing and launching containers. Operator definition does that.
* Simplified the multires simulation manager a lot by inheriting from MultiresStepper
* Fixed a nasty bug!
* no need to pass xlb_grid
* Added padding to allow non cubic domains.
* added a mesher utility function for multires
* enabling mesh masker for multires cases
* fixed the output order of cuboid mesher
* Added a new example to showcase STL handling in MRES
* stl handling in MRES working reasonably with 2 levels
* parameterized problem 2
* No need for padding after Neon fix. Updated multi-res exampels.
* Added new hybrid methods to handle stationary and moving boundaries.
* Added hybridBC to the Neon backend and MultiRes settings
* addressed PR review comments.
* added a generic read and write method to further unify Warp and Neon backends
* added store_dtype to neon backend
* Added neon backend to AABB mesh masker using generic function calls.
* added multires mesh masker (AABB).
* Added moving boundary capability of halfway BC also to the JAX backend.
* fixed couple emerging bugs in the JAX backend
* Moved padding to BC class and improved the logic of indices masker in JAX
* Changed indices masker WARP to rely on local write instead of remote write. Interior treatment is now consistent with JAX.
* switched to generic read and write methods in indices masker to support both warp and neon
* Added and used a helper function for boundary maskers
* added read_field_neighbor and further unified neon and warp helpers in indices masker
* made individual functionals for each kernel in indices masker
* Converted indices masker to be launched over the entire grid and not just bc indices. This is needed for consistency with Neon and also mesh masker.
* added a helper to check if a grid index matches a bc index
* Added neon containers to indices masker. Working now but still lots of refactoring to be done.
* WIP: added multi-res indice masker
* WIP: Fixed a bug in multires indice masker and applied ruff formatting
* Fixed a bug related to get global indices
* Getting dtype from field using neon_get_dtype
* deleted the old multires boundary masker
* Ensuring other voxelization methods work for dense and raising error if chosen for multi-res
* moved the computations of the momentum exchange to a functional and used read_field
* moved the definition of streaming functional to construct warp
* Added neon implementations of MomentumTransfer for dense and multires
* Moved no-slip bc functional also outside to the warp and neon construct
* fixed some operators default values
* moved force to be a member of the class with a single pointer. Otherwise the pointers would be recreated at every launch and that was not captured properly by the neon implementation
* minor todo items done
* fixed force calculation for multires. Neon results seem to be non-deterministic! WIP: handling BC w/ distance!
* Added the sphere example using the cuboid mesher
* neon_get_type does not work. reverting back to hard-coded solution for now.
* Added ExportMultiresHDF5 as a new class in mesher with Neon container implementation
* Fixed issues with ExportMultiresHDF5. Outputs are now correct!
* commented out bc_mask vtk export
* fixed the fp64 issues
* minor: updated rotating sphere example to use latest voxelization method
* minor fix in other examples for fp64
* Added an OutletInitializer as a helper initializer class
* replaced open3d with trimesh in all files and examples which gets rid of weird voxelization artifacts due to open3d
* fixing CPU memory issue: merging duplicates in chucks
* Generalized outlet initializer definition using bc_mask and made generic functional to handle both warp and neon
* Added multires outlet initializer
* Addressed PR review
* Generalized the MRES IO class and added a new method to export a 2D image at an arbitrary slice
* removed the redundant stl sphere example and corrected the sphere indices example.
* Enabled auto chunking in the exporter
* Fix: reducing memory usage on CPU for mres.
* Perf: fusion at the finest level for mres.
- OptimizationType class to manage different optimization for the mres LBM
- Fused neon kernel for finest level of mres
* Generalized the MultiresIO class to be used for any given field (not predefined fields)
* Added a new method to multires grid class to enable extracting boundary indices across multiple levels.
* cast to store dtype for any input type of mres IO
* added remove_edges as an input arg to boundary_indices_across_levels
* Fixed an error in cuboid mesher introduced in previous commits
* fixed couple issues in MresIO class
* addressed PR review comments
* Refactoring: renaming DataUse to MemoryType
* Debug: adding function to print neon grid information.
* Fixed the IO culprit!
* ruff changes
* Enhancement: integrate neon skeleton with dGrid stepper
* Added a minimal LBM stepper to the MomentumTransfer operator
* Added force calculation to this example as well.
* Applied the changes to multi-res. This enables generic handling of BCs in MRES.
* Rename OptimizationType -> MresPerfOptimizationType
* Add comment to multi-res grid.
* Renaming related to mres perf. optimization type class.
* Adding nvtx into requirements.
* Uses only device memory for LBM population fields in Neon.
Changes the memory type used for fields f_0 and f_1 to device memory only.
* Updating to the latest Neon API.
* fixed ruff formatting
* minor refactoring
* WIP: multi-GPU with Neon
* Added force calculation to multires even when mesh distance is used. Only works with FUSION_AT_FINEST for now.
* Fixed large memory usage in boundary_indices_across_levels
* Refactoring mlups example
* Refactoring mlups example
* Refactoring mlups example
* Refactoring mlups example
* Add new command-line options for MLUPS simulation and enhance reporting features
- Introduced options for generating reports, exporting final velocity fields, measuring scalability, and specifying the number of repetitions in the MLUPS simulation.
- Updated argument parsing and output formatting to reflect new options.
- Enhanced simulation summary and scalability analysis with detailed statistics and performance results.
- Refactored simulation functions to accommodate new features and improve clarity.
* Update MLUPS argument parsing and enhance OCC handling in NSE stepper
- Modified command-line argument parsing for the MLUPS simulation to simplify occupancy options.
- Updated the NSE stepper to validate and handle occupancy configuration more robustly.
- Improved readability and clarity in the code by restructuring argument checks and adding comments.
* fix xdmf path when saving in subfolder
* MultiResIO updates
* fixed ruff
* improved the implementation of boundary data aux encoding during initialization
* new aux encoder works with multires
* added neon_index_to_warp to the bc helper
* fixed a bug
* Moved ZouHe/Regularized decoding function to the new EncodeAuxiliaryData helper class.
* Major improvements to the handling of user-specified profiles in hybridBC
* fixed bugs in ZouHe and Regularized after changes
* HybridBC now working as expected with profiles
* improved the logic a bit. needs more testing
* minor change: not attributing the EncodeAuxiliaryData object to the BC object but rather using it as needed.
* update(api): propagating API changes to mres code.
* fix(extra): removing debug export operation for bc_mask.
* style(ruff): running ruff
* corrected interpolated bounceback method to achieve better results when applying hybridBC as inlet
* refactoring(PR): applying changes base on the review from PR #18
* minor refactoring
* enabled handling or user-defined profiles that span across multiple levels
* This commit addresses the issue discussed in hsalehipour#20
* addressed PR review comments
* Fixed the missing mask in MRES that was incorrect on +x, +y and +z bounds of the domain
* Multi-res AABB close (#17)
* Multi res AABB close neon impl, performs morpheological close operation on multi-res mesh and assigns boundary conditions appropriately
* Support for multiple close voxels so larger gaps can be filled
* Mesh voxelization method (#22)
mesh_voxelization_method is callable now with optional input arguments. Also bc values are not hardcoded in multires macroscopic kernel.
* Modified the OutletInitializer to be more customizable. Also added its JAX implementation.
* refactor(mesher) : remove JAX dependency for warp and neon backends.
Uses the `.numpy()` method directly for converting field warp data to NumPy arrays.
This avoids the needs for JAX for the warp or neon backend.
* Added multi-res RAY mesh masker (and Neon dense)
* moved prepare skeleton to neon_launch and fixed occ none type in neon dense
* added a util function to convert data in various backends to JAX for post-processing in single res.
* added extrapolation outflow BC to Neon
* updated wind tunnel example with Neon on multi-GPU
* fixed the call to assemble_auxiliary_data for mres.
* refactoring(perf-test): adding more options to the performance tests
* refactoring(CLI): improving CLI for the performance tests
refactoring(CLI): improving CLI for the performance tests
* Omega must vary across resolutions to maintain viscosity as a constant
* Added a utility class for unit conversion.
* Added Ahmed benchmark example
* refactoring(mres-stepper): new 'add_to_app' functionality
Simplifies the `add_to_app` method in the multiresolution stepper.
It now leverages keyword arguments and introspection for more flexible and maintainable operator calls.
This change enhances code readability and reduces the risk of errors when adding new operators.
* (feature) Two new optimization strategies for the mres stepper.
* (refactoring) Removing debug IO
* (refactoring) Applying ruff.
* Function renaming.
* Fixed a bug left from previous merge PR
* The second moment computation includes "rho" embedded in its output. So no need to further multiply by rho in KBC.
* Removed unused parameters (rho, u) from various collision methods, simplifying the function signatures across multiple classes.
* Updared wall BC in this example to ensure numerical stability
* Clean up (#34)
* Fixed some runtime bugs
* fixed some naming/spelling errors
* removed some debugging comments.
* Introduced a new file `cell_type.py` containing boundary-mask constants for fluid voxelss to replace hardcoded values with the new constants.
* Applied renaming of 254 to SFV to function names
* Refactoring to remove duplications.
- Unified multi-resolution recursion builder in `simulation_manager.py` to streamline the construction of simulation steps.
- Refactored nse_multires_stepper for improved clarity
- Updated performance optimization handling in `multires_momentum_transfer.py` to support multiple fusion strategies.
* Removed redundant functions from `nse_multires_stepper.py` to streamline and clarify the implementation of multi-resolution streaming steps.
* Renamed functions in `nse_multires_stepper.py` for improved clarity.
* Cleaning up multi-res stepper.
* Documentation
* Fixed mixed precision handling of the Neon backend for single-res and multi-res by ensuring consistent use of `store_dtype` and `compute_dtype`.
* (refactoring) Allowing Warp backend to run without neon to be installed + README update (#39)
* Ensuring all pytests are passing.
* (install) extend XLB install for the Neon backend. (#40)
* (build) Introducing Neon backend as an optional installation parameter.
* (install) new installation mode for neon backend.
* (build) Add ARM support for Neon wheel resolution
* (documentation) Fixes to README and AUTHORS
* (ruff) fixes to the style
* (documentation) fix list of supported python versions
* (install) Add installation unit tests for JAX, Warp and Neon backends (#41)
* (build) Introducing Neon backend as an optional installation parameter.
* (install) new installation mode for neon backend.
* (build) Add ARM support for Neon wheel resolution
* (documentation) Fixes to README and AUTHORS
* (ruff) fixes to the style
* (documentation) fix list of supported python versions
* (install) Add installation unit tests for JAX, Warp and Neon backends, update utils for Warp to JAX conversion
* (install) Enhance warp-lang uninstallation process for Neon installation (#42)
* (build) Introducing Neon backend as an optional installation parameter.
* (install) new installation mode for neon backend.
* (build) Add ARM support for Neon wheel resolution
* (documentation) Fixes to README and AUTHORS
* (ruff) fixes to the style
* (documentation) fix list of supported python versions
* (install) Add installation unit tests for JAX, Warp and Neon backends, update utils for Warp to JAX conversion
* (install) Enhance warp-lang uninstallation process for Neon installation
- Updated `_uninstall_warp_lang` function to include a reason for uninstallation.
- Modified `InstallWithNeonHooks` class to uninstall `warp-lang` before and after installation when the `[neon]` extra is requested.
- Added a new test to verify that pre-existing `warp-lang` is uninstalled during the editable install of XLB with the `[neon]` extra.
* (refactor) Update JSON data structure and clean up code (#43)
* (build) Introducing Neon backend as an optional installation parameter.
* (install) new installation mode for neon backend.
* (build) Add ARM support for Neon wheel resolution
* (documentation) Fixes to README and AUTHORS
* (ruff) fixes to the style
* (documentation) fix list of supported python versions
* (install) Add installation unit tests for JAX, Warp and Neon backends, update utils for Warp to JAX conversion
* (install) Enhance warp-lang uninstallation process for Neon installation
- Updated `_uninstall_warp_lang` function to include a reason for uninstallation.
- Modified `InstallWithNeonHooks` class to uninstall `warp-lang` before and after installation when the `[neon]` extra is requested.
- Added a new test to verify that pre-existing `warp-lang` is uninstalled during the editable install of XLB with the `[neon]` extra.
* (cleaning) removed unnecessary 'pass' call
* (refactor) Update JSON data structure and clean up code
- Modified the `ahmed.json` file to ensure consistent formatting of velocity and height data.
- Removed a hardcoded comment in `multires_grid.py` regarding device initialization.
- Commented out the `info_print` call in `neon_grid.py` to reduce output clutter.
- Enhanced the `_create_constant_prescribed_profile` method in `bc_halfway_bounce_back.py` to better handle different compute backends and added error handling for unsupported backends.
* Addressing multires PR review (#44)
* added missing neon functionals and fixed forced_collision
* fixed global coordinate calculations in NeonMultiresGrid for improved bounding box face detection across levels
* Remove deprecated BC from README
* fixed an issue in setting prescribed values in zouhe bc
* Fixes to the PR comments (#45)
* fix(install): add h5py when the neon installation option is selected.
* refactor(mres): changed 'omega' to 'coalescence_factor' in function signatures.
* refactor(grid): change default values of sparsity_pattern_list and sparsity_pattern_origins to None
* fix(docs): correct typos in multires_flow_past_sphere_3d.py and update NEON backend description in compute_backend.py
* ruff
---------
Co-authored-by: massimim <57805133+massimim@users.noreply.github.com>
---------
Co-authored-by: Massimiliano Meneghin <massimiliano.meneghin@autodesk.com>
Co-authored-by: massimim <57805133+massimim@users.noreply.github.com>
Co-authored-by: Apolo Vanderberg <apolo.vanderberg@autodesk.com>
Co-authored-by: nmorrisad <nigel.morris@autodesk.com>1 parent ec0f07e commit 3f8b350
92 files changed
Lines changed: 11577 additions & 1026 deletions
File tree
- examples
- cfd
- data
- ibm
- performance
- tests
- boundary_conditions
- bc_equilibrium
- bc_fullway_bounce_back
- mask
- install
- kernels/collision
- xlb
- grid
- helper
- operator
- boundary_condition
- boundary_masker
- collision
- equilibrium
- force
- macroscopic
- stepper
- stream
- utils
- velocity_set
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
134 | 136 | | |
135 | 137 | | |
136 | 138 | | |
| |||
155 | 157 | | |
156 | 158 | | |
157 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
158 | 168 | | |
159 | 169 | | |
160 | 170 | | |
161 | 171 | | |
162 | 172 | | |
163 | 173 | | |
164 | 174 | | |
165 | | - | |
| 175 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
19 | 25 | | |
20 | 26 | | |
21 | 27 | | |
| |||
28 | 34 | | |
29 | 35 | | |
30 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
31 | 52 | | |
32 | 53 | | |
33 | | - | |
| 54 | + | |
34 | 55 | | |
35 | 56 | | |
36 | 57 | | |
| |||
63 | 84 | | |
64 | 85 | | |
65 | 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 | + | |
66 | 111 | | |
67 | | - | |
| 112 | + | |
| 113 | + | |
68 | 114 | | |
69 | 115 | | |
70 | | - | |
| 116 | + | |
71 | 117 | | |
72 | 118 | | |
73 | 119 | | |
| |||
103 | 149 | | |
104 | 150 | | |
105 | 151 | | |
106 | | - | |
| 152 | + | |
107 | 153 | | |
108 | 154 | | |
109 | 155 | | |
| |||
128 | 174 | | |
129 | 175 | | |
130 | 176 | | |
| 177 | + | |
131 | 178 | | |
132 | 179 | | |
133 | 180 | | |
| |||
143 | 190 | | |
144 | 191 | | |
145 | 192 | | |
| 193 | + | |
| 194 | + | |
146 | 195 | | |
147 | 196 | | |
| 197 | + | |
148 | 198 | | |
149 | 199 | | |
150 | 200 | | |
151 | 201 | | |
152 | 202 | | |
| 203 | + | |
153 | 204 | | |
154 | 205 | | |
155 | | - | |
| 206 | + | |
156 | 207 | | |
157 | 208 | | |
158 | 209 | | |
159 | 210 | | |
160 | | - | |
| 211 | + | |
161 | 212 | | |
162 | 213 | | |
163 | 214 | | |
| |||
171 | 222 | | |
172 | 223 | | |
173 | 224 | | |
| 225 | + | |
| 226 | + | |
174 | 227 | | |
175 | 228 | | |
176 | | - | |
177 | | - | |
| 229 | + | |
178 | 230 | | |
179 | | - | |
| 231 | + | |
180 | 232 | | |
181 | | - | |
| 233 | + | |
182 | 234 | | |
| 235 | + | |
| 236 | + | |
183 | 237 | | |
184 | | - | |
| 238 | + | |
185 | 239 | | |
186 | 240 | | |
187 | 241 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
0 commit comments